diff mbox series

[FFmpeg-devel,v4,01/11] fftools/qsv: enabling d3d11va/dxva2 device selection

Message ID 20200508151821.49051-1-artem.galin@gmail.com
State New
Headers show
Series [FFmpeg-devel,v4,01/11] fftools/qsv: enabling d3d11va/dxva2 device selection
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Artem Galin May 8, 2020, 3:18 p.m. UTC
From: Artem Galin <artem.galin@intel.com>

child_device_type argument is responsible for selection.

Usage examples:

DirectX 11
-init_hw_device qsv:hw,child_device_type=d3d11va

DirectX 9
-init_hw_device qsv:hw,child_device_type=dxva2

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

Comments

Hendrik Leppkes May 8, 2020, 8:32 p.m. UTC | #1
On Fri, May 8, 2020 at 5:28 PM <artem.galin@gmail.com> wrote:
>
> From: Artem Galin <artem.galin@intel.com>
>
> child_device_type argument is responsible for selection.
>
> Usage examples:
>
> DirectX 11
> -init_hw_device qsv:hw,child_device_type=d3d11va
>
> DirectX 9
> -init_hw_device qsv:hw,child_device_type=dxva2
>
> Signed-off-by: Artem Galin <artem.galin@intel.com>
> ---
>  fftools/ffmpeg_opt.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index 60bb437ea7..83f1b53e9d 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -558,7 +558,11 @@ 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);
> +        int err;
> +        if (!arg)
> +            return AVERROR(ENOMEM);
> +        err = hw_device_init_from_string(arg, NULL);
> +        return err;
>      }

This change seems...odd? It certainly doesn't do anymore what the
commit title indicates what it might do.

- Hendrik
diff mbox series

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 60bb437ea7..83f1b53e9d 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -558,7 +558,11 @@  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);
+        int err;
+        if (!arg)
+            return AVERROR(ENOMEM);
+        err = hw_device_init_from_string(arg, NULL);
+        return err;
     }
 }