[FFmpeg-devel] [PATCH] HW accelerator: Indicate when HW acceleration is in use

Michael Niedermayer michael at niedermayer.cc
Sat Nov 4 05:16:41 EET 2017


On Fri, Nov 03, 2017 at 11:35:33AM -0700, Michele Lim wrote:
> Having clear indication of when a hardware accelerator is in
> operation prevents false assumptions, for e.g., in situations when
> the command line argument inadvertently omits options for enabling
> it, resulting to the framework silently switching to the SW path.
> 
> Signed-off-by: Michele Lim <michele.lim at intel.com>
> ---
>  fftools/ffmpeg_hw.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/fftools/ffmpeg_hw.c b/fftools/ffmpeg_hw.c
> index a4d1cad..f071746 100644
> --- a/fftools/ffmpeg_hw.c
> +++ b/fftools/ffmpeg_hw.c
> @@ -306,6 +306,8 @@ int hw_device_setup_for_decode(InputStream *ist)
>      if (!ist->dec_ctx->hw_device_ctx)
>          return AVERROR(ENOMEM);
>  
> +    /* Indicate HW accelerator has been prepared for decode */
> +    av_log(ist->dec_ctx, AV_LOG_INFO, "HW accelerator prepared for decode: %s\n", av_hwdevice_get_type_name(type));
>      return 0;
>  }
>  

> @@ -331,6 +333,9 @@ int hw_device_setup_for_encode(OutputStream *ost)
>          // No device required.
>          return 0;
>      }
> +
> +    /* Indicate HW accelerator has been prepared for encode */
> +    av_log(ost->enc_ctx, AV_LOG_INFO, "HW accelerator prepared for encode: %s\n", av_hwdevice_get_type_name(type));
>  }

i dont know if this extra info is desireable or not but
this code is unreachable

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171104/da7ba0a7/attachment.sig>


More information about the ffmpeg-devel mailing list