Fixed vc1 packetizer.
[vlc.git] / modules / video_chroma / i422_i420.c
index b5c122c..7cb40e3 100644 (file)
@@ -46,15 +46,18 @@ static int  Activate ( vlc_object_t * );
 static void I422_I420( filter_t *, picture_t *, picture_t * );
 static void I422_YV12( filter_t *, picture_t *, picture_t * );
 static void I422_YUVA( filter_t *, picture_t *, picture_t * );
+static picture_t *I422_I420_Filter( filter_t *, picture_t * );
+static picture_t *I422_YV12_Filter( filter_t *, picture_t * );
+static picture_t *I422_YUVA_Filter( filter_t *, picture_t * );
 
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) );
-    set_capability( "chroma", 60 );
-    set_callbacks( Activate, NULL );
-vlc_module_end();
+vlc_module_begin ()
+    set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) )
+    set_capability( "video filter2", 60 )
+    set_callbacks( Activate, NULL )
+vlc_module_end ()
 
 /*****************************************************************************
  * Activate: allocate a chroma function
@@ -71,6 +74,10 @@ static int Activate( vlc_object_t *p_this )
         return -1;
     }
 
+    if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
+     || p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
+        return -1;
+
     switch( p_filter->fmt_in.video.i_chroma )
     {
         case VLC_FOURCC('I','4','2','2'):
@@ -80,15 +87,15 @@ static int Activate( vlc_object_t *p_this )
                 case VLC_FOURCC('I','4','2','0'):
                 case VLC_FOURCC('I','Y','U','V'):
                 case VLC_FOURCC('J','4','2','0'):
-                    p_filter->pf_video_filter_io = I422_I420;
+                    p_filter->pf_video_filter = I422_I420_Filter;
                     break;
 
                 case VLC_FOURCC('Y','V','1','2'):
-                    p_filter->pf_video_filter_io = I422_YV12;
+                    p_filter->pf_video_filter = I422_YV12_Filter;
                     break;
 
                 case VLC_FOURCC('Y','U','V','A'):
-                    p_filter->pf_video_filter_io = I422_YUVA;
+                    p_filter->pf_video_filter = I422_YUVA_Filter;
                     break;
 
                 default:
@@ -103,6 +110,9 @@ static int Activate( vlc_object_t *p_this )
 }
 
 /* Following functions are local */
+VIDEO_FILTER_WRAPPER( I422_I420 )
+VIDEO_FILTER_WRAPPER( I422_YV12 )
+VIDEO_FILTER_WRAPPER( I422_YUVA )
 
 /*****************************************************************************
  * I422_I420: planar YUV 4:2:2 to planar I420 4:2:0 Y:U:V