[FFmpeg-devel] [PATCH] ffmpeg_dxva2: call GetDesktopWindow() in place of GetShellWindow()

Hendrik Leppkes h.leppkes at gmail.com
Tue Jun 2 22:03:24 CEST 2015


On Tue, Jun 2, 2015 at 10:02 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> On Tue, Jun 2, 2015 at 7:11 PM, wm4 <nfxjfg at googlemail.com> wrote:
>> On Tue, 2 Jun 2015 12:25:34 +0200
>> Stefano Sabatini <stefasab at gmail.com> wrote:
>>
>>> On date Friday 2015-05-29 14:34:08 -0300, James Almer encoded:
>>> > On 29/05/15 12:40 PM, Stefano Sabatini wrote:
>>> > > On date Friday 2015-05-29 16:32:11 +0200, Hendrik Leppkes encoded:
>>> > >> On Fri, May 29, 2015 at 3:21 PM, Stefano Sabatini <stefasab at gmail.com> wrote:
>>> > >>> This fixes compilation with latest MinGW32 and MSYS2/MinGW64.
>>> > >>> ---
>>> > >>>  ffmpeg_dxva2.c | 2 +-
>>> > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> > >>>
>>> > >>> diff --git a/ffmpeg_dxva2.c b/ffmpeg_dxva2.c
>>> > >>> index 741c55b..6b20195 100644
>>> > >>> --- a/ffmpeg_dxva2.c
>>> > >>> +++ b/ffmpeg_dxva2.c
>>> > >>> @@ -364,7 +364,7 @@ static int dxva2_alloc(AVCodecContext *s)
>>> > >>>      d3dpp.SwapEffect       = D3DSWAPEFFECT_DISCARD;
>>> > >>>      d3dpp.Flags            = D3DPRESENTFLAG_VIDEO;
>>> > >>>
>>> > >>> -    hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, GetShellWindow(),
>>> > >>> +    hr = IDirect3D9_CreateDevice(ctx->d3d9, adapter, D3DDEVTYPE_HAL, GetDesktopWindow(),
>>> > >>>                                   D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE,
>>> > >>>                                   &d3dpp, &ctx->d3d9device);
>>> > >>>      if (FAILED(hr)) {
>>> > >>
>>> > >>
>>> > >
>>> > >> While the patch itself is fine, I would still encourage people to
>>> > >> abandon mingw32 (which is dead) and move to mingw-w64, which is much
>>> > >> newer and still maintained.
>>> > >
>>> > > I agree, I plan to update the wiki soon, but note that the patch is
>>> > > also required when compiling with MSYS2+MinGW64.
>>> >
>>> > I'm using MSYS2's gcc 4.9.2 package (which uses a recent Mingw-w64 snapshot from
>>> > trunk) yet I'm getting no failures of any kind. Also tried a self compiled gcc
>>> > 5.1.0 using Mingw-w64 v4 (latest stable release) and it compiles fine as well.
>>> > Can't comment about mingw32 since i haven't used in a long time.
>>> >
>>>
>>> > What error are you getting and is your MSYS2 environment modified in any way?
>>>
>>> So after rechecking, I realized that I was using the gcc defined in
>>> the MinGW32 directory. Compilation with MSYS2 went fine, with and
>>> without the patch.
>>>
>>> I'm going to push the patch today if there are no objections.
>>
>> Is there any value left to the patch? I'm a bit suspicious about
>> changing the window (I don't know if there's any significance to it).
>
> Which window you use is totally irrelevant, it just needs some window
> to receive window events. You could also create one just for that
> task, but thats kinda silly to do.
>

That is to say, its irrelevant since that D3D device is not used for
rendering, anyway.


More information about the ffmpeg-devel mailing list