]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/wrapper.c
Removed non converted opengl video output module.
[vlc] / modules / video_filter / wrapper.c
index 94823b686d35a14a32d2b071938750442957c5e7..99ff4276e7f409d8bcfae14a4600bcda1d7b8d94 100644 (file)
@@ -47,10 +47,6 @@ static void Close( vlc_object_t * );
 #define DECLARE_OPEN(name,filter) \
     static int  Open##name ( vlc_object_t *p_this ) { return Open( p_this, #name, filter ); }
 
-DECLARE_OPEN(magnify, true)
-DECLARE_OPEN(puzzle, true)
-DECLARE_OPEN(logo, true)
-
 DECLARE_OPEN(clone, false)
 DECLARE_OPEN(wall, false)
 DECLARE_OPEN(panoramix, false)
@@ -68,15 +64,6 @@ vlc_module_begin()
     set_category( CAT_VIDEO )
     set_subcategory( SUBCAT_VIDEO_VFILTER )
 
-    DECLARE_MODULE(magnify)
-
-    add_submodule()
-    DECLARE_MODULE(puzzle)
-
-    add_submodule()
-    DECLARE_MODULE(logo)
-
-    add_submodule()
     DECLARE_MODULE(clone)
 
     add_submodule()
@@ -117,8 +104,6 @@ static int  FilterAllocationInit ( filter_t *, void * );
 static void FilterAllocationClean( filter_t * );
 
 /* */
-static int  FullscreenEventUp( vlc_object_t *, char const *,
-                               vlc_value_t, vlc_value_t, void * );
 static int  FullscreenEventDown( vlc_object_t *, char const *,
                                  vlc_value_t, vlc_value_t, void * );
 static int  SplitterPictureNew( video_splitter_t *, picture_t *pp_picture[] );
@@ -145,12 +130,8 @@ static int Open( vlc_object_t *p_this, const char *psz_name, bool b_filter )
     es_format_Init( &fmt, VIDEO_ES, p_vout->render.i_chroma );
     video_format_Setup( &fmt.video, p_vout->render.i_chroma,
                         p_vout->render.i_width, p_vout->render.i_height,
-                        p_vout->render.i_aspect );
-    if( fmt.video.i_sar_num <= 0 || fmt.video.i_sar_den <= 0 )
-    {
-        fmt.video.i_sar_num = fmt.video.i_aspect * fmt.video.i_visible_height;
-        fmt.video.i_sar_den = VOUT_ASPECT_FACTOR * fmt.video.i_visible_width;
-    }
+                        p_vout->render.i_aspect * p_vout->render.i_height,
+                        VOUT_ASPECT_FACTOR      * p_vout->render.i_width );
 
     /* Try to open our real module */
     filter_chain_t   *p_chain = NULL;
@@ -314,11 +295,11 @@ static int Init( vout_thread_t *p_vout )
             }
         }
 
-        /* Attach once pp_vout is completly field to avoid race conditions */
+        /* Attach once pp_vout is completly filed to avoid race conditions */
         for( int i = 0; i < p_splitter->i_output; i++ )
             vout_filter_SetupChild( p_vout, p_sys->pp_vout[i],
                                     MouseEvent,
-                                    FullscreenEventUp, FullscreenEventDown, true );
+                                    FullscreenEventDown, true );
         /* Restore settings */
         var_SetInteger( p_vout, "align", i_org_align );
         var_SetInteger( p_vout, "video-x", i_org_x );
@@ -402,7 +383,7 @@ static void VoutsClean( vout_thread_t *p_vout, int i_count )
         else
              vout_filter_SetupChild( p_vout, p_sys->pp_vout[i],
                                      MouseEvent,
-                                     FullscreenEventUp, FullscreenEventDown, false );
+                                     FullscreenEventDown, false );
     }
 
     for( int i = 0; i < i_count; i++ )
@@ -460,8 +441,7 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
 
     vlc_mouse_t m;
     vlc_mouse_Init( &m );
-    m.i_x = var_GetInteger( p_vout_src, "mouse-x" );
-    m.i_y = var_GetInteger( p_vout_src, "mouse-y" );
+    var_GetCoords( p_vout_src, "mouse-moved", &m.i_x, &m.i_y );
     m.i_pressed = var_GetInteger( p_vout_src, "mouse-button-down" );
 
     vlc_mutex_lock( &p_sys->lock );
@@ -491,15 +471,13 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
 
     if( vlc_mouse_HasMoved( &omouse, &nmouse ) )
     {
-        var_SetInteger( p_vout, "mouse-x", nmouse.i_x );
-        var_SetInteger( p_vout, "mouse-y", nmouse.i_y );
-        var_SetBool( p_vout, "mouse-moved", true );
+        var_SetCoords( p_vout, "mouse-moved", nmouse.i_x, nmouse.i_y );
     }
     if( vlc_mouse_HasButton( &omouse, &nmouse ) )
     {
         var_SetInteger( p_vout, "mouse-button-down", nmouse.i_pressed );
         if( vlc_mouse_HasPressed( &omouse, &nmouse, MOUSE_BUTTON_LEFT ) )
-            var_SetBool( p_vout, "mouse-clicked", true );
+            var_SetCoords( p_vout, "mouse-clicked", nmouse.i_x, nmouse.i_y );
     }
     if( m.b_double_click )
     {
@@ -530,46 +508,20 @@ static int FilterAllocationInit( filter_t *p_filter, void *p_data )
 {
     VLC_UNUSED( p_data );
 
-    p_filter->pf_vout_buffer_new = VideoBufferNew;
-    p_filter->pf_vout_buffer_del = VideoBufferDelete;
+    p_filter->pf_video_buffer_new = VideoBufferNew;
+    p_filter->pf_video_buffer_del = VideoBufferDelete;
     p_filter->p_owner = p_data;
 
     return VLC_SUCCESS;
 }
 static void FilterAllocationClean( filter_t *p_filter )
 {
-    p_filter->pf_vout_buffer_new = NULL;
-    p_filter->pf_vout_buffer_del = NULL;
+    p_filter->pf_video_buffer_new = NULL;
+    p_filter->pf_video_buffer_del = NULL;
 }
 
 /* -- Splitter callbacks -- */
 
-/**
- * Forward fullscreen event to/from the childrens.
- *
- * FIXME probably unsafe (pp_vout[] content)
- */
-static bool IsFullscreenActive( vout_thread_t *p_vout )
-{
-    vout_sys_t *p_sys = p_vout->p_sys;
-    for( int i = 0; i < p_sys->i_vout; i++ )
-    {
-        if( var_GetBool( p_sys->pp_vout[i], "fullscreen" ) )
-            return true;
-    }
-    return false;
-}
-static int FullscreenEventUp( vlc_object_t *p_this, char const *psz_var,
-                              vlc_value_t oldval, vlc_value_t newval, void *p_data )
-{
-    vout_thread_t *p_vout = p_data;
-    VLC_UNUSED(oldval); VLC_UNUSED(p_this); VLC_UNUSED(psz_var); VLC_UNUSED(newval);
-
-    const bool b_fullscreen = IsFullscreenActive( p_vout );
-    if( !var_GetBool( p_vout, "fullscreen" ) != !b_fullscreen )
-        return var_SetBool( p_vout, "fullscreen", b_fullscreen );
-    return VLC_SUCCESS;
-}
 static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
                                 vlc_value_t oldval, vlc_value_t newval, void *p_data )
 {
@@ -577,19 +529,10 @@ static int FullscreenEventDown( vlc_object_t *p_this, char const *psz_var,
     vout_sys_t *p_sys = p_vout->p_sys;
     VLC_UNUSED(oldval); VLC_UNUSED(p_data); VLC_UNUSED(psz_var);
 
-    const bool b_fullscreen = IsFullscreenActive( p_vout );
-    if( !b_fullscreen != !newval.b_bool )
+    for( int i = 0; i < p_sys->i_vout; i++ )
     {
-        for( int i = 0; i < p_sys->i_vout; i++ )
-        {
-            vout_thread_t *p_child = p_sys->pp_vout[i];
-            if( !var_GetBool( p_child, "fullscreen" ) != !newval.b_bool )
-            {
-                var_SetBool( p_child, "fullscreen", newval.b_bool );
-                if( newval.b_bool )
-                    return VLC_SUCCESS;
-            }
-        }
+        vout_thread_t *p_child = p_sys->pp_vout[i];
+        var_SetBool( p_child, "fullscreen", newval.b_bool );
     }
     return VLC_SUCCESS;
 }