]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/invert.c
Use var_InheritString for --decklink-video-connection.
[vlc] / modules / video_filter / invert.c
index b6a566905fc78581a2948a9beeb525881275d9e6..33b2884e08b8495d788fff7e0d49de624d70d09a 100644 (file)
@@ -31,9 +31,8 @@
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 
-#include "vlc_filter.h"
+#include <vlc_filter.h>
 #include "filter_picture.h"
 
 /*****************************************************************************
@@ -47,25 +46,15 @@ static picture_t *Filter( filter_t *, picture_t * );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_description( N_("Invert video filter") );
-    set_shortname( N_("Color inversion" ));
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VFILTER );
-    set_capability( "video filter2", 0 );
-    add_shortcut( "invert" );
-    set_callbacks( Create, Destroy );
-vlc_module_end();
-
-/*****************************************************************************
- * vout_sys_t: Invert video output method descriptor
- *****************************************************************************
- * This structure is part of the video output thread descriptor.
- * It describes the Invert specific properties of an output thread.
- *****************************************************************************/
-struct filter_sys_t
-{
-};
+vlc_module_begin ()
+    set_description( N_("Invert video filter") )
+    set_shortname( N_("Color inversion" ))
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VFILTER )
+    set_capability( "video filter2", 0 )
+    add_shortcut( "invert" )
+    set_callbacks( Create, Destroy )
+vlc_module_end ()
 
 /*****************************************************************************
  * Create: allocates Invert video thread output method
@@ -76,14 +65,6 @@ static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
 
-    /* Allocate structure */
-    p_filter->p_sys = malloc( sizeof( filter_sys_t ) );
-    if( p_filter->p_sys == NULL )
-    {
-        msg_Err( p_filter, "out of memory" );
-        return VLC_ENOMEM;
-    }
-
     p_filter->pf_video_filter = Filter;
 
     return VLC_SUCCESS;
@@ -96,9 +77,7 @@ static int Create( vlc_object_t *p_this )
  *****************************************************************************/
 static void Destroy( vlc_object_t *p_this )
 {
-    filter_t *p_filter = (filter_t *)p_this;
-
-    free( p_filter->p_sys );
+    (void)p_this;
 }
 
 /*****************************************************************************
@@ -116,16 +95,15 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 
     if( !p_pic ) return NULL;
 
-    p_outpic = p_filter->pf_vout_buffer_new( p_filter );
+    p_outpic = filter_NewPicture( p_filter );
     if( !p_outpic )
     {
         msg_Warn( p_filter, "can't get output picture" );
-        if( p_pic->pf_release )
-            p_pic->pf_release( p_pic );
+        picture_Release( p_pic );
         return NULL;
     }
 
-    if( p_pic->format.i_chroma == VLC_FOURCC('Y','U','V','A') )
+    if( p_pic->format.i_chroma == VLC_CODEC_YUVA )
     {
         /* We don't want to invert the alpha plane */
         i_planes = p_pic->i_planes - 1;