]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/noise.c
Fixed YV12 and added YV9 support to our swscale wrapper.
[vlc] / modules / video_filter / noise.c
index 1c461bc0491ce18465b3a919f28161f90a3cb09a..e1858ca5c750b513d5b7a5560ab9f47afb6b1b49 100644 (file)
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>
-#include <vlc_vout.h>
 
-#include "vlc_filter.h"
+#include <vlc_filter.h>
 #include "filter_picture.h"
 
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
 static int  Create    ( vlc_object_t * );
-static void Destroy   ( vlc_object_t * );
-
 static picture_t *Filter( filter_t *, picture_t * );
 
 #define FILTER_PREFIX "noise-"
@@ -49,27 +46,16 @@ static picture_t *Filter( filter_t *, picture_t * );
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
-vlc_module_begin();
-    set_description( N_("Noise video filter") );
-    set_shortname( N_( "Noise" ));
-    set_capability( "video filter2", 0 );
-    set_category( CAT_VIDEO );
-    set_subcategory( SUBCAT_VIDEO_VFILTER );
+vlc_module_begin ()
+    set_description( N_("Noise video filter") )
+    set_shortname( N_( "Noise" ))
+    set_capability( "video filter2", 0 )
+    set_category( CAT_VIDEO )
+    set_subcategory( SUBCAT_VIDEO_VFILTER )
 
-    add_shortcut( "noise" );
-    set_callbacks( Create, Destroy );
-vlc_module_end();
-
-/*****************************************************************************
- * vout_sys_t: Distort video output method descriptor
- *****************************************************************************
- * This structure is part of the video output thread descriptor.
- * It describes the Distort specific properties of an output thread.
- *****************************************************************************/
-struct filter_sys_t
-{
-    mtime_t last_date;
-};
+    add_shortcut( "noise" )
+    set_callbacks( Create, NULL )
+vlc_module_end ()
 
 /*****************************************************************************
  * Create: allocates Distort video thread output method
@@ -79,30 +65,11 @@ struct filter_sys_t
 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 )
-        return VLC_ENOMEM;
-
     p_filter->pf_video_filter = Filter;
 
-    p_filter->p_sys->last_date = 0;
-
     return VLC_SUCCESS;
 }
 
-/*****************************************************************************
- * Destroy: destroy Distort video thread output method
- *****************************************************************************
- * Terminate an output method created by DistortCreateOutputMethod
- *****************************************************************************/
-static void Destroy( vlc_object_t *p_this )
-{
-    filter_t *p_filter = (filter_t *)p_this;
-    free( p_filter->p_sys );
-}
-
 /*****************************************************************************
  * Render: displays previously rendered output
  *****************************************************************************
@@ -113,13 +80,11 @@ static void Destroy( vlc_object_t *p_this )
 static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
 {
     picture_t *p_outpic;
-    filter_sys_t *p_sys = p_filter->p_sys;
     int i_index;
-    mtime_t new_date = mdate();
 
     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" );
@@ -127,8 +92,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
         return NULL;
     }
 
-    p_sys->last_date = new_date;
-
     for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
     {
         uint8_t *p_in = p_pic->p[i_index].p_pixels;