]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/wrapper.c
Remove useless vlc_object_detach() before vlc_object_release()
[vlc] / modules / video_filter / wrapper.c
index 4a6218ed0cfbd99c823b10b73cf7b224a0e905be..9271c9723788b59b18ac327a027349447ce8ef32 100644 (file)
@@ -53,6 +53,7 @@ DECLARE_OPEN(logo, true)
 
 DECLARE_OPEN(clone, false)
 DECLARE_OPEN(wall, false)
+DECLARE_OPEN(panoramix, false)
 
 #undef DECLARE_OPEN
 
@@ -81,6 +82,9 @@ vlc_module_begin()
     add_submodule()
     DECLARE_MODULE(wall)
 
+    add_submodule()
+    DECLARE_MODULE(panoramix)
+
 vlc_module_end()
 
 #undef DECLARE_MODULE
@@ -141,12 +145,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;
@@ -279,22 +279,25 @@ static int Init( vout_thread_t *p_vout )
     {
         video_splitter_t *p_splitter = p_sys->p_splitter;
 
+        /* */
+        const int i_org_align = var_CreateGetInteger( p_vout, "align" );
+        const int i_org_x = var_CreateGetInteger( p_vout, "video-x" );
+        const int i_org_y = var_CreateGetInteger( p_vout, "video-y" );
+        const char *psz_org_vout = var_CreateGetNonEmptyString( p_vout, "vout" );
+
+        /* */
         for( int i = 0; i < p_splitter->i_output; i++ )
         {
             const video_splitter_output_t *p_cfg = &p_splitter->p_output[i];
 
             /* */
-            var_Create( p_vout, "align", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
             var_SetInteger( p_vout, "align", p_cfg->window.i_align);
 
-            var_Create( p_vout, "video-x", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-            var_SetInteger( p_vout, "video-x", p_cfg->window.i_x );
-
-            var_Create( p_vout, "video-y", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-            var_SetInteger( p_vout, "video-y", p_cfg->window.i_y );
+            var_SetInteger( p_vout, "video-x", i_org_x + p_cfg->window.i_x );
+            var_SetInteger( p_vout, "video-y", i_org_y + p_cfg->window.i_y );
 
-            var_Create( p_vout, "vout", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
-            var_SetString( p_vout, "vout", p_cfg->psz_module ? p_cfg->psz_module : "" );
+            if( p_cfg->psz_module )
+                var_SetString( p_vout, "vout", p_cfg->psz_module );
 
             /* */
             video_format_t fmt = p_cfg->fmt;
@@ -312,6 +315,11 @@ static int Init( vout_thread_t *p_vout )
             vout_filter_SetupChild( p_vout, p_sys->pp_vout[i],
                                     MouseEvent,
                                     FullscreenEventUp, FullscreenEventDown, true );
+        /* Restore settings */
+        var_SetInteger( p_vout, "align", i_org_align );
+        var_SetInteger( p_vout, "video-x", i_org_x );
+        var_SetInteger( p_vout, "video-y", i_org_y );
+        var_SetString( p_vout, "vout", psz_org_vout ? psz_org_vout : "" );
     }
 
     vout_filter_AllocateDirectBuffers( p_vout, VOUT_MAX_PICTURES );
@@ -518,16 +526,16 @@ 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 -- */