X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Fwave.c;h=6ad3ac27171ea742ab29c72cf651cb756075b283;hb=4d6247fdd024fcf4511eb40cf62d01e12c825e7d;hp=1e6236a1c7831f6368137daa5c47fff919bbf121;hpb=2085fb08ae43ba48a2ab115505b9524808233b3c;p=vlc diff --git a/modules/video_filter/wave.c b/modules/video_filter/wave.c index 1e6236a1c7..6ad3ac2717 100644 --- a/modules/video_filter/wave.c +++ b/modules/video_filter/wave.c @@ -26,17 +26,16 @@ * Preamble *****************************************************************************/ -#include /* sin(), cos() */ - #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include /* sin(), cos() */ + #include #include -#include -#include "vlc_filter.h" +#include #include "filter_picture.h" /***************************************************************************** @@ -50,19 +49,19 @@ static picture_t *Filter( filter_t *, picture_t * ); /***************************************************************************** * Module descriptor *****************************************************************************/ -vlc_module_begin(); - set_description( N_("Wave video filter") ); - set_shortname( N_( "Wave" )); - set_capability( "video filter2", 0 ); - set_category( CAT_VIDEO ); - set_subcategory( SUBCAT_VIDEO_VFILTER ); +vlc_module_begin () + set_description( N_("Wave video filter") ) + set_shortname( N_( "Wave" )) + set_capability( "video filter2", 0 ) + set_category( CAT_VIDEO ) + set_subcategory( SUBCAT_VIDEO_VFILTER ) - add_shortcut( "wave" ); - set_callbacks( Create, Destroy ); -vlc_module_end(); + add_shortcut( "wave" ) + set_callbacks( Create, Destroy ) +vlc_module_end () /***************************************************************************** - * vout_sys_t: Distort video output method descriptor + * filter_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. @@ -85,10 +84,7 @@ static int Create( vlc_object_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; @@ -125,12 +121,10 @@ 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; } @@ -151,6 +145,13 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) i_num_lines = p_pic->p[i_index].i_visible_lines; i_visible_pitch = p_pic->p[i_index].i_visible_pitch; i_pixel_pitch = p_pic->p[i_index].i_pixel_pitch; + switch( p_filter->fmt_in.video.i_chroma ) + { + CASE_PACKED_YUV_422 + // Quick hack to fix u/v inversion occuring with 2 byte pixel pitch + i_pixel_pitch *= 2; + break; + } i_visible_pixels = i_visible_pitch/i_pixel_pitch; black_pixel = ( p_pic->i_planes > 1 && i_index == Y_PLANE ) ? 0x00