vlc | branch: master | Steve Lhomme <[email protected]> | Mon Nov 25 13:03:43 2019 +0100| [7f4e81b24bbe6eaf55bcb6d3d55f90f2b6812d14] | committer: Steve Lhomme
filters: add an inline function to get the decoder device by type > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f4e81b24bbe6eaf55bcb6d3d55f90f2b6812d14 --- include/vlc_filter.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/vlc_filter.h b/include/vlc_filter.h index 2979224527..2a68f5e738 100644 --- a/include/vlc_filter.h +++ b/include/vlc_filter.h @@ -27,6 +27,7 @@ #include <vlc_es.h> #include <vlc_picture.h> +#include <vlc_codec.h> /** * \defgroup filter Filters @@ -201,6 +202,23 @@ static inline vlc_decoder_device * filter_HoldDecoderDevice( filter_t *p_filter return p_filter->owner.video->hold_device( VLC_OBJECT(p_filter), p_filter->owner.sys ); } +static inline vlc_decoder_device * filter_HoldDecoderDeviceType( filter_t *p_filter, + enum vlc_decoder_device_type type ) +{ + if ( !p_filter->owner.video || !p_filter->owner.video->hold_device ) + return NULL; + + vlc_decoder_device *dec_dev = p_filter->owner.video->hold_device( VLC_OBJECT(p_filter), + p_filter->owner.sys ); + if ( dec_dev != NULL ) + { + if ( dec_dev->type == type ) + return dec_dev; + vlc_decoder_device_Release(dec_dev); + } + return NULL; +} + /** * This function will drain, then flush an audio filter. */ _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
