]> git.sesse.net Git - vlc/commitdiff
Validate input chromas here too. Currently only planar yuv is supported
authorAntoine Cellerier <dionoea@videolan.org>
Sat, 31 May 2008 15:13:13 +0000 (17:13 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Sat, 31 May 2008 15:19:41 +0000 (17:19 +0200)
but packed should be easy to implement.

modules/video_filter/motiondetect.c

index 7f3c706a98e457bd806ea4bcc49a3bd657f2d5b9..025c2e19f4d84fb637e5b24e4f63e1219bf86e64 100644 (file)
@@ -35,6 +35,7 @@
 #include <vlc_vout.h>
 
 #include "vlc_filter.h"
+#include "filter_picture.h"
 
 /*****************************************************************************
  * Local prototypes
@@ -79,6 +80,19 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
+    switch( p_filter->fmt_in.video.i_chroma )
+    {
+        CASE_PLANAR_YUV
+            break;
+
+        CASE_PACKED_YUV_422
+            msg_Err( p_filter, "FIXME ... this should be easy." );
+        default:
+            msg_Err( p_filter, "Unsupported input chroma (%4s)",
+                     (char*)&(p_filter->fmt_in.video.i_chroma) );
+            return VLC_EGENERIC;
+    }
+
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )