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

Michele Lim michele.lim at intel.com
Fri Nov 3 20:35:33 EET 2017


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));
 }
 
 static int hwaccel_retrieve_data(AVCodecContext *avctx, AVFrame *input)
-- 
2.7.4



More information about the ffmpeg-devel mailing list