Browse Source

filter: merge audio and video flush

The callbacks return nothing (unlike drain), so they can be treated
identically regardless of the ES category.
pull/36/head
Rémi Denis-Courmont 11 years ago
parent
commit
d7cb099f49
  1. 21
      include/vlc_filter.h
  2. 2
      modules/audio_filter/resampler/soxr.c
  3. 2
      modules/hw/mmal/deinterlace.c
  4. 2
      modules/hw/vdpau/chroma.c
  5. 2
      modules/video_filter/deinterlace/deinterlace.c
  6. 2
      modules/video_filter/deinterlace/deinterlace.h
  7. 2
      src/audio_output/filters.c
  8. 2
      src/misc/filter_chain.c

21
include/vlc_filter.h

@ -117,8 +117,6 @@ struct filter_t
* Flush (i.e. discard) any internal buffer in a video or audio filter.
*/
void (*pf_flush)( filter_t * );
#define pf_video_flush pf_flush
#define pf_audio_flush pf_flush
union
{
@ -163,21 +161,14 @@ static inline picture_t *filter_NewPicture( filter_t *p_filter )
}
/**
* This function will flush the state of a video filter.
*/
static inline void filter_FlushPictures( filter_t *p_filter )
{
if( p_filter->pf_video_flush )
p_filter->pf_video_flush( p_filter );
}
/**
* This function will flush the state of an audio filter.
* Flush a filter
*
* This function will flush the state of a filter (audio or video).
*/
static inline void filter_FlushAudio( filter_t *p_filter )
static inline void filter_Flush( filter_t *p_filter )
{
if( p_filter->pf_audio_flush )
p_filter->pf_audio_flush( p_filter );
if( p_filter->pf_flush != NULL )
p_filter->pf_flush( p_filter );
}
/**

2
modules/audio_filter/resampler/soxr.c

@ -192,7 +192,7 @@ Open( vlc_object_t *p_obj, bool b_change_ratio )
p_filter->p_sys = p_sys;
p_filter->pf_audio_filter = Resample;
p_filter->pf_audio_flush = Flush;
p_filter->pf_flush = Flush;
p_filter->pf_audio_drain = Drain;
return VLC_SUCCESS;
}

2
modules/hw/mmal/deinterlace.c

@ -231,7 +231,7 @@ static int Open(filter_t *filter)
sys->filtered_pictures = mmal_queue_create();
filter->pf_video_filter = deinterlace;
filter->pf_video_flush = flush;
filter->pf_flush = flush;
vlc_mutex_init_recursive(&sys->mutex);
vlc_mutex_init(&sys->buffer_cond_mutex);
vlc_cond_init(&sys->buffer_cond);

2
modules/hw/vdpau/chroma.c

@ -764,7 +764,7 @@ static int OutputOpen(vlc_object_t *obj)
sys->procamp.hue = 0.f;
filter->pf_video_filter = video_filter;
filter->pf_video_flush = Flush;
filter->pf_flush = Flush;
return VLC_SUCCESS;
error:
free(sys);

2
modules/video_filter/deinterlace/deinterlace.c

@ -757,7 +757,7 @@ notsupp:
p_filter->fmt_out.video = fmt;
p_filter->fmt_out.i_codec = fmt.i_chroma;
p_filter->pf_video_filter = Deinterlace;
p_filter->pf_video_flush = Flush;
p_filter->pf_flush = Flush;
p_filter->pf_video_mouse = Mouse;
msg_Dbg( p_filter, "deinterlacing" );

2
modules/video_filter/deinterlace/deinterlace.h

@ -197,7 +197,7 @@ int Open( vlc_object_t *p_this );
* Resets the filter state, including resetting all algorithm-specific state
* and discarding all histories, but does not stop the filter.
*
* Open() sets this up as the flush method (pf_video_flush)
* Open() sets this up as the flush method (pf_flush)
* in the filter structure.
*
* @param p_filter The filter instance.

2
src/audio_output/filters.c

@ -308,7 +308,7 @@ static void aout_FiltersPipelineFlush(filter_t *const *filters,
unsigned count)
{
for (unsigned i = 0; i < count; i++)
filter_FlushAudio (filters[i]);
filter_Flush (filters[i]);
}

2
src/misc/filter_chain.c

@ -417,7 +417,7 @@ void filter_chain_VideoFlush( filter_chain_t *p_chain )
FilterDeletePictures( f->pending );
f->pending = NULL;
filter_FlushPictures( p_filter );
filter_Flush( p_filter );
}
}

Loading…
Cancel
Save