Re: [libav-devel] [PATCH 0/5] New D3D hwaccel API stuff

2017-05-08 Thread wm4
On Mon, 8 May 2017 22:38:55 +0100
Mark Thompson  wrote:

> On 04/05/17 07:44, wm4 wrote:
> > Radically rebased, and omits a few in-between commits that are
> > unnecessary for the end result. avconv_dxva2.c should probably
> > also be deleted, but for now it'd only inflate the diff. As
> > part of the rebase I've also removed Steve Lhomme as author
> > name - let me know whether I should set his name back on the
> > two relevant commits (first and last one), or how this should
> > be correctly handled.  
> 
> With the whole set applied, the default build configuration fails to build 
> avconv for me with:
> 
> libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.rdata$IID_IDirectXVideoDecoderService[IID_IDirectXVideoDecoderService]+0x0):
>  multiple definition of `IID_IDirectXVideoDecoderService'
> avtools/avconv_dxva2.o:avconv_dxva2.c:(.rdata+0x310): first defined here
> libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
> C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition 
> of `DXVA2_ModeVC1_D'
> avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:288:
>  first defined here
> libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
> C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition 
> of `DXVA2_ModeH264_F'
> avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:289:
>  first defined here
> libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
> C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition 
> of `DXVA2_ModeH264_E'
> avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:295:
>  first defined here
> libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
> C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition 
> of `DXVA2_ModeMPEG2_VLD'
> avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:295:
>  first defined here
> collect2.exe: error: ld returned 1 exit status

That really shouldn't happen. All those definitions start with ff_ in
the dxva2.c code (because I haven't figured out how to do it correctly).

Maybe the included headers actually define those GUIDs. How this GUID
definition stuff works always has been a mystery to me.

> Trying to get around that by building with --disable-dxva2 doesn't work 
> either (unknown type AVDXVA2FramesContext).  So, I haven't tested it at all 
> yet (may look more later).

I haven't tested yet whether it builds/works correctly with either
dxva2 or d3d11va disabled (because apparently we still want that to
work).

> The "D3D11VA" hwcontext doesn't have much to do with "VA" directly anymore - 
> maybe it should just be D3D11?

The dxva2 hwcontext is also actually a Direct3D 9 context, which means
there's a precedent to name it after the decoding API. So I didn't
bother renaming it. But if we decide that the VA should be dropped, I
can do that.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Re: [libav-devel] [PATCH 0/5] New D3D hwaccel API stuff

2017-05-08 Thread Mark Thompson
On 04/05/17 07:44, wm4 wrote:
> Radically rebased, and omits a few in-between commits that are
> unnecessary for the end result. avconv_dxva2.c should probably
> also be deleted, but for now it'd only inflate the diff. As
> part of the rebase I've also removed Steve Lhomme as author
> name - let me know whether I should set his name back on the
> two relevant commits (first and last one), or how this should
> be correctly handled.

With the whole set applied, the default build configuration fails to build 
avconv for me with:

libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.rdata$IID_IDirectXVideoDecoderService[IID_IDirectXVideoDecoderService]+0x0):
 multiple definition of `IID_IDirectXVideoDecoderService'
avtools/avconv_dxva2.o:avconv_dxva2.c:(.rdata+0x310): first defined here
libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition of 
`DXVA2_ModeVC1_D'
avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:288:
 first defined here
libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition of 
`DXVA2_ModeH264_F'
avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:289:
 first defined here
libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition of 
`DXVA2_ModeH264_E'
avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:295:
 first defined here
libavcodec/libavcodec.a(dxva2.o): In function `bufref_free_interface':
C:/msys64/home/mark/libav/d3d11/libavcodec/dxva2.c:210: multiple definition of 
`DXVA2_ModeMPEG2_VLD'
avtools/avconv_dxva2.o:C:/msys64/home/mark/libav/d3d11/avtools/avconv_dxva2.c:295:
 first defined here
collect2.exe: error: ld returned 1 exit status

Trying to get around that by building with --disable-dxva2 doesn't work either 
(unknown type AVDXVA2FramesContext).  So, I haven't tested it at all yet (may 
look more later).


The "D3D11VA" hwcontext doesn't have much to do with "VA" directly anymore - 
maybe it should just be D3D11?


- Mark


(All following comments should keep in mind that I'm not familiar with the D3D 
APIs, so I will definitely miss any subtlety there.)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

[libav-devel] [PATCH 0/5] New D3D hwaccel API stuff

2017-05-04 Thread wm4
Radically rebased, and omits a few in-between commits that are
unnecessary for the end result. avconv_dxva2.c should probably
also be deleted, but for now it'd only inflate the diff. As
part of the rebase I've also removed Steve Lhomme as author
name - let me know whether I should set his name back on the
two relevant commits (first and last one), or how this should
be correctly handled.

As far as I'm concerned, this is pretty much finished. Please review or
merge.

wm4 (5):
  lavu: add new D3D11 pixfmt and hwcontext
  lavc: set avctx->hwaccel before init
  dxva: preparations for new hwaccel API
  dxva: move d3d11 locking/unlocking to functions
  dxva: add support for new dxva2 and d3d11 hwaccel APIs

 Changelog  |   1 +
 avtools/avconv.h   |   2 +
 avtools/avconv_opt.c   |   8 +-
 configure  |  18 +-
 doc/APIchanges |   9 +
 libavcodec/allcodecs.c |   5 +
 libavcodec/decode.c|   4 +-
 libavcodec/dxva2.c | 723 +++--
 libavcodec/dxva2_h264.c|  36 +-
 libavcodec/dxva2_hevc.c|  32 +-
 libavcodec/dxva2_internal.h|  63 +++-
 libavcodec/dxva2_mpeg2.c   |  32 +-
 libavcodec/dxva2_vc1.c |  54 ++-
 libavcodec/h264_slice.c|   3 +-
 libavcodec/hevcdec.c   |   3 +-
 libavcodec/mpeg12dec.c |   1 +
 libavcodec/vc1dec.c|   1 +
 libavcodec/version.h   |   4 +-
 libavutil/Makefile |   3 +
 libavutil/hwcontext.c  |   4 +
 libavutil/hwcontext.h  |   1 +
 libavutil/hwcontext_d3d11va.c  | 488 +++
 libavutil/hwcontext_d3d11va.h  | 158 +
 libavutil/hwcontext_dxva2.h|   3 +
 libavutil/hwcontext_internal.h |   1 +
 libavutil/pixdesc.c|   4 +
 libavutil/pixfmt.h |   4 +-
 libavutil/version.h|   4 +-
 28 files changed, 1597 insertions(+), 72 deletions(-)
 create mode 100644 libavutil/hwcontext_d3d11va.c
 create mode 100644 libavutil/hwcontext_d3d11va.h

-- 
2.11.0

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel