]> git.sesse.net Git - vlc/blobdiff - src/misc/filter.c
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / misc / filter.c
index 7ced511d9d532e564628243fb6412daa5c756b91..adc7ad7a6d62bf209d8ef2b6e3b244ef7ad02982 100644 (file)
 #include <vlc_common.h>
 #include <libvlc.h>
 #include <vlc_filter.h>
+#include <vlc_modules.h>
 
 filter_t *filter_NewBlend( vlc_object_t *p_this,
-                           vlc_fourcc_t i_chroma_dst )
+                           const video_format_t *p_dst_chroma )
 {
     filter_t *p_blend = vlc_custom_create( p_this, sizeof(*p_blend),
                                            VLC_OBJECT_GENERIC, "blend" );
@@ -42,7 +43,16 @@ filter_t *filter_NewBlend( vlc_object_t *p_this,
     es_format_Init( &p_blend->fmt_out, VIDEO_ES, 0 );
 
     p_blend->fmt_out.i_codec        = 
-    p_blend->fmt_out.video.i_chroma = i_chroma_dst;
+    p_blend->fmt_out.video.i_chroma = p_dst_chroma->i_chroma;
+    p_blend->fmt_out.video.i_rmask  = p_dst_chroma->i_rmask;
+    p_blend->fmt_out.video.i_gmask  = p_dst_chroma->i_gmask;
+    p_blend->fmt_out.video.i_bmask  = p_dst_chroma->i_bmask;
+    p_blend->fmt_out.video.i_rrshift= p_dst_chroma->i_rrshift;
+    p_blend->fmt_out.video.i_rgshift= p_dst_chroma->i_rgshift;
+    p_blend->fmt_out.video.i_rbshift= p_dst_chroma->i_rbshift;
+    p_blend->fmt_out.video.i_lrshift= p_dst_chroma->i_lrshift;
+    p_blend->fmt_out.video.i_lgshift= p_dst_chroma->i_lgshift;
+    p_blend->fmt_out.video.i_lbshift= p_dst_chroma->i_lbshift;
 
     /* The blend module will be loaded when needed with the real
     * input format */
@@ -102,7 +112,6 @@ void filter_DeleteBlend( filter_t *p_blend )
     if( p_blend->p_module )
         module_unneed( p_blend, p_blend->p_module );
 
-    vlc_object_detach( p_blend );
     vlc_object_release( p_blend );
 }
 
@@ -140,7 +149,6 @@ void video_splitter_Delete( video_splitter_t *p_splitter )
 
     video_format_Clean( &p_splitter->fmt );
 
-    vlc_object_detach( p_splitter );
     vlc_object_release( p_splitter );
 }