[vlc-devel] [RFC PATCH 03/10] avcodec: don't use va if hwaccel is disabled
Rémi Denis-Courmont
remi at remlab.net
Thu Apr 21 14:13:16 CEST 2016
Le 2016-04-21 11:53, Thomas Guillem a écrit :
> ---
> modules/codec/avcodec/video.c | 23 +++++++++++++----------
> 1 file changed, 13 insertions(+), 10 deletions(-)
>
> diff --git a/modules/codec/avcodec/video.c
> b/modules/codec/avcodec/video.c
> index a97fec2..d102d03 100644
> --- a/modules/codec/avcodec/video.c
> +++ b/modules/codec/avcodec/video.c
> @@ -1188,17 +1188,20 @@ static enum PixelFormat ffmpeg_GetFormat(
> AVCodecContext *p_context,
> enum PixelFormat swfmt = avcodec_default_get_format(p_context,
> pi_fmt);
> bool can_hwaccel = false;
>
> - for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
> + if( decoder_ShouldHWAccel( p_dec ) )
> {
> - const AVPixFmtDescriptor *dsc =
> av_pix_fmt_desc_get(pi_fmt[i]);
> - if (dsc == NULL)
> - continue;
> - bool hwaccel = (dsc->flags & AV_PIX_FMT_FLAG_HWACCEL) != 0;
> -
> - msg_Dbg( p_dec, "available %sware decoder output format %d
> (%s)",
> - hwaccel ? "hard" : "soft", pi_fmt[i], dsc->name );
> - if (hwaccel)
> - can_hwaccel = true;
> + for( size_t i = 0; pi_fmt[i] != AV_PIX_FMT_NONE; i++ )
> + {
> + const AVPixFmtDescriptor *dsc =
> av_pix_fmt_desc_get(pi_fmt[i]);
> + if (dsc == NULL)
> + continue;
> + bool hwaccel = (dsc->flags & AV_PIX_FMT_FLAG_HWACCEL) !=
> 0;
> +
> + msg_Dbg( p_dec, "available %sware decoder output format
> %d (%s)",
> + hwaccel ? "hard" : "soft", pi_fmt[i], dsc->name
> );
> + if (hwaccel)
> + can_hwaccel = true;
> + }
Nack. We already have an option for this.
> }
>
> /* If the format did not actually change (e.g. seeking), try to
> reuse the
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list