diff mbox

[FFmpeg-devel,2/2] cmdutils: dump HWAccel type in print_codec()

Message ID 1527340452-23364-3-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao May 26, 2018, 1:14 p.m. UTC
dump the hwaccel type for codec when use the command like
./ffmpeg -h decoder=h264.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
---
 fftools/cmdutils.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Mark Thompson May 26, 2018, 4:13 p.m. UTC | #1
On 26/05/18 14:14, Jun Zhao wrote:
> dump the hwaccel type for codec when use the command like
> ./ffmpeg -h decoder=h264.
> 
> Signed-off-by: Jun Zhao <mypopydev@gmail.com>
> ---
>  fftools/cmdutils.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
> index 4f2e0a2..eeee14b 100644
> --- a/fftools/cmdutils.c
> +++ b/fftools/cmdutils.c
> @@ -1444,6 +1444,17 @@ static void print_codec(const AVCodec *c)
>          printf("\n");
>      }
>  
> +    if (avcodec_get_hw_config(c, 0)) {
> +        printf("    HWAccel devices: ");

These aren't necessarily for hwaccel, they can be hardware-only too.

Perhaps "Supported hardware devices:"?

> +        for (int i = 0;; i++) {
> +            const AVCodecHWConfig *config = avcodec_get_hw_config(c, i);
> +            if (!config)
> +                break;
> +            printf("%s ", av_hwdevice_get_type_name(config->device_type));
> +        }
> +        printf("\n");
> +    }
> +
>      if (c->supported_framerates) {
>          const AVRational *fps = c->supported_framerates;
>  
> 

Otherwise looks fine - good idea to make it show this information.

Thanks,

- Mark
diff mbox

Patch

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 4f2e0a2..eeee14b 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1444,6 +1444,17 @@  static void print_codec(const AVCodec *c)
         printf("\n");
     }
 
+    if (avcodec_get_hw_config(c, 0)) {
+        printf("    HWAccel devices: ");
+        for (int i = 0;; i++) {
+            const AVCodecHWConfig *config = avcodec_get_hw_config(c, i);
+            if (!config)
+                break;
+            printf("%s ", av_hwdevice_get_type_name(config->device_type));
+        }
+        printf("\n");
+    }
+
     if (c->supported_framerates) {
         const AVRational *fps = c->supported_framerates;