[FFmpeg-devel] [PATCH v2 1/4] fftools/qsv: enabling d3d11va/dxva2 device selection

artem.galin at gmail.com artem.galin at gmail.com
Wed Apr 15 16:07:38 EEST 2020


From: Artem Galin <artem.galin at intel.com>

child_device_type argument is responsible for selection.

Usage examples: -init_hw_device qsv:hw,child_device_type=d3d11va
                -init_hw_device qsv:hw,child_device_type=dxva2

Signed-off-by: Artem Galin <artem.galin at intel.com>
---
 fftools/ffmpeg_opt.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 95001a963f..82232c60b3 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -568,7 +568,17 @@ static int opt_init_hw_device(void *optctx, const char *opt, const char *arg)
         printf("\n");
         exit_program(0);
     } else {
-        return hw_device_init_from_string(arg, NULL);
+        HWDevice *dev;
+        int err;
+        if (!arg)
+            return AVERROR(ENOMEM);
+        err = hw_device_init_from_string(arg, &dev);
+        if (err < 0)
+            return err;
+        hw_device_ctx = av_buffer_ref(dev->device_ref);
+        if (!hw_device_ctx)
+            return AVERROR(ENOMEM);
+        return 0;
     }
 }
 
-- 
2.26.0



More information about the ffmpeg-devel mailing list