[FFmpeg-cvslog] cmdutils: dump supported hardware devices in print_codec()

Jun Zhao git at videolan.org
Mon May 28 14:01:30 EEST 2018


ffmpeg | branch: master | Jun Zhao <mypopydev at gmail.com> | Sat May 26 20:57:45 2018 +0800| [81b77e7bf16a754005a2af7e5cf35e2eefc91a39] | committer: Jun Zhao

cmdutils: dump supported hardware devices in print_codec()

dump the supported hardware devices for codec when use the command
like ./ffmpeg -h decoder=h264.

Signed-off-by: Jun Zhao <mypopydev at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81b77e7bf16a754005a2af7e5cf35e2eefc91a39
---

 fftools/cmdutils.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 70234b8923..844f43359c 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("    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;
 



More information about the ffmpeg-cvslog mailing list