Fixed vc1 packetizer.
[vlc.git] / modules / video_chroma / grey_yuv.c
index 4cfd11a..99e150c 100644 (file)
@@ -45,14 +45,17 @@ static int  Activate ( vlc_object_t * );
 static void GREY_I420( filter_t *, picture_t *, picture_t * );
 static void GREY_YUY2( filter_t *, picture_t *, picture_t * );
 
+static picture_t *GREY_I420_Filter( filter_t *, picture_t * );
+static picture_t *GREY_YUY2_Filter( filter_t *, picture_t * );
+
 /*****************************************************************************
  * Module descriptor.
  *****************************************************************************/
-vlc_module_begin();
-    set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) );
-    set_capability( "chroma", 80 );
-    set_callbacks( Activate, NULL );
-vlc_module_end();
+vlc_module_begin ()
+    set_description( N_("Conversions from " SRC_FOURCC " to " DEST_FOURCC) )
+    set_capability( "video filter2", 80 )
+    set_callbacks( Activate, NULL )
+vlc_module_end ()
 
 /*****************************************************************************
  * Activate: allocate a chroma function
@@ -69,6 +72,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('Y','8','0','0'):
@@ -77,10 +84,10 @@ static int Activate( vlc_object_t *p_this )
             switch( p_filter->fmt_out.video.i_chroma )
             {
                 case VLC_FOURCC('I','4','2','0'):
-                    p_filter->pf_video_filter_io = GREY_I420;
+                    p_filter->pf_video_filter = GREY_I420_Filter;
                     break;
                 case VLC_FOURCC('Y','U','Y','2'):
-                    p_filter->pf_video_filter_io = GREY_YUY2;
+                    p_filter->pf_video_filter = GREY_YUY2_Filter;
                     break;
                 default:
                     return -1;
@@ -94,6 +101,9 @@ static int Activate( vlc_object_t *p_this )
     return 0;
 }
 
+VIDEO_FILTER_WRAPPER( GREY_I420 )
+VIDEO_FILTER_WRAPPER( GREY_YUY2 )
+
 /* Following functions are local */
 
 /*****************************************************************************