[vlc-devel] [RFC PATCH 02/10] decoder: add decoder_ShouldHWAccel helper
Rémi Denis-Courmont
remi at remlab.net
Thu Apr 21 14:12:52 CEST 2016
Le 2016-04-21 11:53, Thomas Guillem a écrit :
> An helper that return true if a module should do hardware-accelerated
> decoding.
Nack. This makes no sense at core level.
> ---
> include/vlc_codec.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/include/vlc_codec.h b/include/vlc_codec.h
> index 2d01d26..f283041 100644
> --- a/include/vlc_codec.h
> +++ b/include/vlc_codec.h
> @@ -387,6 +387,14 @@ VLC_API mtime_t decoder_GetDisplayDate(
> decoder_t *, mtime_t ) VLC_USED;
> */
> VLC_API int decoder_GetDisplayRate( decoder_t * ) VLC_USED;
>
> +static inline bool decoder_ShouldHWAccel( decoder_t *p_dec )
> +{
> + return (p_dec->fmt_in.i_cat == VIDEO_ES
> + && var_CreateGetBool(p_dec, "codec-video-hw"))
> + || (p_dec->fmt_in.i_cat == AUDIO_ES
> + && var_CreateGetBool(p_dec, "codec-audio-hw"));
> +}
> +
> /** @} */
> /** @} */
> #endif /* _VLC_CODEC_H */
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list