]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/psychedelic.c
Qt: input manager: allow updating art for not current input_item
[vlc] / modules / video_filter / psychedelic.c
index b0cf07d0168fad64982b60bb03e1dccf997fa711..95f1feb84c57dec760cf354c05dd0acfd44711b1 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * Psychedelic.c : Psychedelic video effect plugin for vlc
+ * psychedelic.c : Psychedelic video effect plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2006 the VideoLAN team
  * $Id$
@@ -35,8 +35,8 @@
 #include <vlc_common.h>
 #include <vlc_plugin.h>
 
-#include "vlc_filter.h"
-#include "vlc_image.h"
+#include <vlc_filter.h>
+#include <vlc_image.h>
 #include "filter_picture.h"
 
 /*****************************************************************************
@@ -84,6 +84,13 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
+    const vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
+    const vlc_chroma_description_t *p_chroma = vlc_fourcc_GetChromaDescription( fourcc );
+    if( !p_chroma || p_chroma->plane_count != 3 || p_chroma->pixel_size != 1 ) {
+        msg_Err( p_filter, "Unsupported chroma (%4.4s)", (char*)&fourcc );
+        return VLC_EGENERIC;
+    }
+
     /* Allocate structure */
     p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
     if( p_filter->p_sys == NULL )
@@ -174,8 +181,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
     }
 
     /* luminance */
-    vlc_memcpy( p_outpic->p[Y_PLANE].p_pixels, p_pic->p[Y_PLANE].p_pixels,
-                p_outpic->p[Y_PLANE].i_lines * p_outpic->p[Y_PLANE].i_pitch );
+    plane_CopyPixels( &p_outpic->p[Y_PLANE], &p_pic->p[Y_PLANE] );
 
     /* image visualization */
     fmt_out = p_filter->fmt_out.video;