diff mbox series

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

Message ID 20200424145219.54067-1-artem.galin@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,v3,1/4] fftools/qsv: enabling d3d11va/dxva2 device selection | expand

Checks

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

Commit Message

galinart April 24, 2020, 2:52 p.m. UTC
From: Artem Galin <artem.galin@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@intel.com>
---
 fftools/ffmpeg_opt.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Mark Thompson April 26, 2020, 6:20 p.m. UTC | #1
On 24/04/2020 15:52, artem.galin@gmail.com wrote:
> From: Artem Galin <artem.galin@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@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 680f0f1dfb..de5bc51bee 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -565,7 +565,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;
>      }
>  }

I fixed the setup which was making you want to hack devices like this.  See <http://git.videolan.org/?p=ffmpeg.git;a=commit;h=8abd3b202821e9c491f44d097686402aafdda7c5>.

- Mark
galinart May 8, 2020, 4:05 p.m. UTC | #2
On Sun, 26 Apr 2020 at 19:20, Mark Thompson <sw@jkqxz.net> wrote:

> On 24/04/2020 15:52, artem.galin@gmail.com wrote:
> > From: Artem Galin <artem.galin@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@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 680f0f1dfb..de5bc51bee 100644
> > --- a/fftools/ffmpeg_opt.c
> > +++ b/fftools/ffmpeg_opt.c
> > @@ -565,7 +565,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;
> >      }
> >  }
>
> I fixed the setup which was making you want to hack devices like this.
> See <
> http://git.videolan.org/?p=ffmpeg.git;a=commit;h=8abd3b202821e9c491f44d097686402aafdda7c5
> >.
>
> - Mark
> __________



Hi Mark,

New patch update with fixes is available by link below:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=1165

Thanks,
Artem.

> _____________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 680f0f1dfb..de5bc51bee 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -565,7 +565,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;
     }
 }