[vlc-devel] commit: Validate input chromas here too. Currently only planar yuv is supported (Antoine Cellerier )

git version control git at videolan.org
Sat May 31 17:18:04 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Sat May 31 17:13:13 2008 +0200| [b2f6e68bff8cec278b8fb9b3dd10db961af0968a]

Validate input chromas here too. Currently only planar yuv is supported
but packed should be easy to implement.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b2f6e68bff8cec278b8fb9b3dd10db961af0968a
---

 modules/video_filter/motiondetect.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/modules/video_filter/motiondetect.c b/modules/video_filter/motiondetect.c
index 7f3c706..025c2e1 100644
--- a/modules/video_filter/motiondetect.c
+++ b/modules/video_filter/motiondetect.c
@@ -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 )




More information about the vlc-devel mailing list