winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
April 2023
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
1 participants
817 discussions
Start a n
N
ew thread
Jactry Zeng : shell32/tests: Move interfaces creation to a function.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: bac369eb00f401e6ed1755322cc85a024de63e3b URL:
https://gitlab.winehq.org/wine/wine/-/commit/bac369eb00f401e6ed1755322cc85a…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Apr 8 09:57:54 2023 -0500 shell32/tests: Move interfaces creation to a function. --- dlls/shell32/tests/shlview.c | 76 +++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 46 deletions(-) diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index d25d626f829..9f85ba0459d 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -619,6 +619,22 @@ static const IShellBrowserVtbl shellbrowservtbl = { static IShellBrowser test_shellbrowser = { &shellbrowservtbl }; +static void create_interfaces(IShellFolder **desktop, IShellView **view) +{ + HRESULT hr; + + hr = SHGetDesktopFolder(desktop); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IShellFolder_CreateViewObject(*desktop, NULL, &IID_IShellView, (void **)view); + ok(hr == S_OK, "Got hr %#lx.\n", hr); +} + +static void destroy_interfaces(IShellFolder *desktop, IShellView *view) +{ + IShellFolder_Release(desktop); + IShellView_Release(view); +} + static void test_CreateViewWindow(void) { IShellFolder *desktop; @@ -631,11 +647,7 @@ static void test_CreateViewWindow(void) ULONG ref1, ref2; IUnknown *unk; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &view); hr = IShellView_QueryInterface(view, &IID_CDefView, (void **)&unk); ok(hr == S_OK, "got (0x%08lx)\n", hr); @@ -719,18 +731,13 @@ static void test_IFolderView(void) POINT pt; RECT r; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &view); hr = IShellView_QueryInterface(view, &IID_IFolderView, (void**)&fv); if (hr != S_OK) { win_skip("IFolderView not supported by desktop folder\n"); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); return; } @@ -772,8 +779,7 @@ if (0) win_skip("Failed to subclass ListView control\n"); IShellBrowser_Release(browser); IFolderView_Release(fv); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); return; } @@ -863,8 +869,7 @@ if (0) IShellBrowser_Release(browser); IFolderView_Release(fv); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); } static void test_GetItemObject(void) @@ -874,11 +879,7 @@ static void test_GetItemObject(void) IUnknown *unk; HRESULT hr; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &view); /* from documentation three interfaces are supported for SVGIO_BACKGROUND: IContextMenu, IDispatch, IPersistHistory */ @@ -900,8 +901,7 @@ static void test_GetItemObject(void) hr = IShellView_GetItemObject(view, SVGIO_BACKGROUND, &IID_IPersist, (void**)&unk); ok(hr == E_NOINTERFACE || broken(hr == E_NOTIMPL) /* W2K */, "got (0x%08lx)\n", hr); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); } static void test_IShellFolderView(void) @@ -913,18 +913,13 @@ static void test_IShellFolderView(void) UINT i; HRESULT hr; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &view); hr = IShellView_QueryInterface(view, &IID_IShellFolderView, (void**)&folderview); if (hr != S_OK) { win_skip("IShellView doesn't provide IShellFolderView on this platform\n"); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); return; } @@ -955,8 +950,7 @@ static void test_IShellFolderView(void) IShellFolderView_Release(folderview); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); } static void test_IOleWindow(void) @@ -966,11 +960,7 @@ static void test_IOleWindow(void) IOleWindow *wnd; HRESULT hr; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &view); hr = IShellView_QueryInterface(view, &IID_IOleWindow, (void**)&wnd); ok(hr == E_NOINTERFACE, "got (0x%08lx)\n", hr); @@ -981,8 +971,7 @@ static void test_IOleWindow(void) hr = IShellView_ContextSensitiveHelp(view, FALSE); ok(hr == E_NOTIMPL, "got (0x%08lx)\n", hr); - IShellView_Release(view); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, view); } static const struct message folderview_setcurrentviewmode1_2_prevista[] = { @@ -1088,11 +1077,7 @@ static void test_GetSetCurrentViewMode(void) static const int vista_res[11] = {0, 1, 5, 3, 4, 5, 6, 7, 7, 0, 0}; static const int win7_res[11] = {1, 1, 1, 3, 4, 1, 6, 1, 8, 8, 8}; - hr = SHGetDesktopFolder(&desktop); - ok(hr == S_OK, "got (0x%08lx)\n", hr); - - hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&sview); - ok(hr == S_OK, "got (0x%08lx)\n", hr); + create_interfaces(&desktop, &sview); hr = IShellView_QueryInterface(sview, &IID_IFolderView, (void **)&fview); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1290,8 +1275,7 @@ static void test_GetSetCurrentViewMode(void) IShellBrowser_Release(browser); IShellView_DestroyViewWindow(sview); - IShellView_Release(sview); - IShellFolder_Release(desktop); + destroy_interfaces(desktop, sview); } static void test_IOleCommandTarget(void)
1
0
0
0
Jactry Zeng : shell32: Assign a default view mode value for IShellView.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: e5c3a111c5045610a4509e2ef3a8151f179cd510 URL:
https://gitlab.winehq.org/wine/wine/-/commit/e5c3a111c5045610a4509e2ef3a815…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Sat Apr 8 09:51:02 2023 -0500 shell32: Assign a default view mode value for IShellView. --- dlls/shell32/shlview.c | 1 + dlls/shell32/tests/shlview.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c index 40a7d76c359..f2e8bc67267 100644 --- a/dlls/shell32/shlview.c +++ b/dlls/shell32/shlview.c @@ -3779,6 +3779,7 @@ IShellView *IShellView_Constructor(IShellFolder *folder) sv->cScrollDelay = 0; sv->ptLastMousePos.x = 0; sv->ptLastMousePos.y = 0; + sv->FolderSettings.ViewMode = FVM_TILE; TRACE("(%p)->(%p)\n", sv, folder); return (IShellView*)&sv->IShellView3_iface; diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c index a83f3137509..d25d626f829 100644 --- a/dlls/shell32/tests/shlview.c +++ b/dlls/shell32/tests/shlview.c @@ -1094,14 +1094,20 @@ static void test_GetSetCurrentViewMode(void) hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&sview); ok(hr == S_OK, "got (0x%08lx)\n", hr); + hr = IShellView_QueryInterface(sview, &IID_IFolderView, (void **)&fview); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + viewmode = 0xdeadbeef; + hr = IFolderView_GetCurrentViewMode(fview, &viewmode); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(viewmode == FVM_TILE || broken(viewmode == 0) /* pre win7 */, "Got view mode %u.\n", viewmode); + fs.ViewMode = 1; fs.fFlags = 0; browser = IShellBrowserImpl_Construct(); hr = IShellView_CreateViewWindow(sview, NULL, &fs, browser, &rc, &hwnd); ok(hr == S_OK || broken(hr == S_FALSE /*Win2k*/ ), "got (0x%08lx)\n", hr); - hr = IShellView_QueryInterface(sview, &IID_IFolderView, (void**)&fview); - ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got (0x%08lx)\n", hr); if(SUCCEEDED(hr)) { HWND hwnd_lv;
1
0
0
0
Jactry Zeng : include: Add FWF_NONE.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: eef4393fb7207bb1d2a31df3efff0d34f3fd3fb6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/eef4393fb7207bb1d2a31df3efff0d…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Thu Apr 6 23:42:36 2023 -0500 include: Add FWF_NONE. --- include/shobjidl.idl | 1 + 1 file changed, 1 insertion(+) diff --git a/include/shobjidl.idl b/include/shobjidl.idl index e213958f6e2..8aa24ea86fc 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -699,6 +699,7 @@ typedef char *LPVIEWSETTINGS; typedef [v1_enum] enum FOLDERFLAGS { + FWF_NONE = 0x00000000, FWF_AUTOARRANGE = 0x00000001, FWF_ABBREVIATEDNAMES = 0x00000002, FWF_SNAPTOGRID = 0x00000004,
1
0
0
0
Paul Gofman : winegstreamer: Pass temporary sample to wg_transform_read_mf() in h264 decoder.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 17c86f42de494620efb133ab471bb1b0b8ef9d0d URL:
https://gitlab.winehq.org/wine/wine/-/commit/17c86f42de494620efb133ab471bb1…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Apr 4 18:14:48 2023 -0600 winegstreamer: Pass temporary sample to wg_transform_read_mf() in h264 decoder. --- dlls/winegstreamer/Makefile.in | 2 +- dlls/winegstreamer/h264_decoder.c | 69 ++++++++++++++++++++++++++++++++++----- 2 files changed, 61 insertions(+), 10 deletions(-) diff --git a/dlls/winegstreamer/Makefile.in b/dlls/winegstreamer/Makefile.in index 82b1c148d6b..ae6420bad84 100644 --- a/dlls/winegstreamer/Makefile.in +++ b/dlls/winegstreamer/Makefile.in @@ -2,7 +2,7 @@ MODULE = winegstreamer.dll UNIXLIB = winegstreamer.so IMPORTLIB = winegstreamer IMPORTS = strmbase ole32 oleaut32 msdmo -DELAYIMPORTS = mfplat +DELAYIMPORTS = mfplat mf UNIX_CFLAGS = $(GSTREAMER_CFLAGS) UNIX_LIBS = $(GSTREAMER_LIBS) $(PTHREAD_LIBS) diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 00c6afd96cd..1e18aff2635 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -64,6 +64,8 @@ struct h264_decoder IMFVideoSampleAllocatorEx *allocator; BOOL allocator_initialized; + IMFTransform *copier; + IMFMediaBuffer *temp_buffer; }; static struct h264_decoder *impl_from_IMFTransform(IMFTransform *iface) @@ -212,6 +214,11 @@ static HRESULT init_allocator(struct h264_decoder *decoder) if (decoder->allocator_initialized) return S_OK; + if (FAILED(hr = IMFTransform_SetInputType(decoder->copier, 0, decoder->output_type, 0))) + return hr; + if (FAILED(hr = IMFTransform_SetOutputType(decoder->copier, 0, decoder->output_type, 0))) + return hr; + if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(decoder->allocator, 10, 10, decoder->attributes, decoder->output_type))) return hr; @@ -264,7 +271,10 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) if (!refcount) { + IMFTransform_Release(decoder->copier); IMFVideoSampleAllocatorEx_Release(decoder->allocator); + if (decoder->temp_buffer) + IMFMediaBuffer_Release(decoder->temp_buffer); if (decoder->wg_transform) wg_transform_destroy(decoder->wg_transform); if (decoder->input_type) @@ -637,6 +647,36 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); } +static HRESULT output_sample(struct h264_decoder *decoder, IMFSample **out, IMFSample *src_sample) +{ + MFT_OUTPUT_DATA_BUFFER output[1]; + IMFSample *sample; + DWORD status; + HRESULT hr; + + if (FAILED(hr = init_allocator(decoder))) + { + ERR("Failed to initialize allocator, hr %#lx.\n", hr); + return hr; + } + if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(decoder->allocator, &sample))) + return hr; + + if (FAILED(hr = IMFTransform_ProcessInput(decoder->copier, 0, src_sample, 0))) + { + IMFSample_Release(sample); + return hr; + } + output[0].pSample = sample; + if (FAILED(hr = IMFTransform_ProcessOutput(decoder->copier, 0, 1, output, &status))) + { + IMFSample_Release(sample); + return hr; + } + *out = sample; + return S_OK; +} + static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, MFT_OUTPUT_DATA_BUFFER *samples, DWORD *status) { @@ -646,6 +686,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, IMFSample *sample; UINT64 frame_rate; GUID subtype; + DWORD size; HRESULT hr; TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status); @@ -668,14 +709,21 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) { - if (FAILED(hr = init_allocator(decoder))) + if (decoder->temp_buffer) { - ERR("Failed to initialize allocator, hr %#lx.\n", hr); - return hr; + if (FAILED(IMFMediaBuffer_GetMaxLength(decoder->temp_buffer, &size)) || size < sample_size) + { + IMFMediaBuffer_Release(decoder->temp_buffer); + decoder->temp_buffer = NULL; + } } - if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(decoder->allocator, &sample))) + if (!decoder->temp_buffer && FAILED(hr = MFCreateMemoryBuffer(sample_size, &decoder->temp_buffer))) + return hr; + if (FAILED(hr = MFCreateSample(&sample))) + return hr; + if (FAILED(hr = IMFSample_AddBuffer(sample, decoder->temp_buffer))) { - ERR("Failed to allocate sample, hr %#lx.\n", hr); + IMFSample_Release(sample); return hr; } } @@ -705,10 +753,9 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) { - if (hr == S_OK) - samples->pSample = sample; - else - IMFSample_Release(sample); + if (hr == S_OK && FAILED(hr = output_sample(decoder, &samples->pSample, sample))) + ERR("Failed to output sample, hr %#lx.\n", hr); + IMFSample_Release(sample); } return hr; @@ -800,12 +847,16 @@ HRESULT h264_decoder_create(REFIID riid, void **ret) goto failed; if (FAILED(hr = MFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&decoder->allocator))) goto failed; + if (FAILED(hr = MFCreateSampleCopierMFT(&decoder->copier))) + goto failed; *ret = &decoder->IMFTransform_iface; TRACE("Created decoder %p\n", *ret); return S_OK; failed: + if (decoder->allocator) + IMFVideoSampleAllocatorEx_Release(decoder->allocator); if (decoder->wg_sample_queue) wg_sample_queue_destroy(decoder->wg_sample_queue); if (decoder->output_attributes)
1
0
0
0
Paul Gofman : winegstreamer: Provide samples if DXGI device manager is set in h264 decoder.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: a208589b2732f852d741b14b920714fba390c952 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a208589b2732f852d741b14b920714…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Mar 31 20:08:19 2023 -0600 winegstreamer: Provide samples if DXGI device manager is set in h264 decoder. --- dlls/mf/tests/transform.c | 3 +- dlls/winegstreamer/h264_decoder.c | 63 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 61 insertions(+), 5 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 26052e6ea6e..b41f87afabe 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -6867,8 +6867,7 @@ static void test_h264_with_dxgi_manager(void) status = 0; memset(output, 0, sizeof(output)); hr = IMFTransform_ProcessOutput(transform, 0, 1, output, &status); - todo_wine ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "got %#lx\n", hr); - if (hr != MF_E_TRANSFORM_NEED_MORE_INPUT) goto failed; + ok(hr == MF_E_TRANSFORM_NEED_MORE_INPUT, "got %#lx\n", hr); hr = IMFTransform_GetAttributes(transform, &attribs); ok(hr == S_OK, "got %#lx\n", hr); diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index e92d7bd730b..00c6afd96cd 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -63,6 +63,7 @@ struct h264_decoder struct wg_sample_queue *wg_sample_queue; IMFVideoSampleAllocatorEx *allocator; + BOOL allocator_initialized; }; static struct h264_decoder *impl_from_IMFTransform(IMFTransform *iface) @@ -204,6 +205,26 @@ static HRESULT fill_output_media_type(struct h264_decoder *decoder, IMFMediaType return S_OK; } +static HRESULT init_allocator(struct h264_decoder *decoder) +{ + HRESULT hr; + + if (decoder->allocator_initialized) + return S_OK; + + if (FAILED(hr = IMFVideoSampleAllocatorEx_InitializeSampleAllocatorEx(decoder->allocator, 10, 10, + decoder->attributes, decoder->output_type))) + return hr; + decoder->allocator_initialized = TRUE; + return S_OK; +} + +static void uninit_allocator(struct h264_decoder *decoder) +{ + IMFVideoSampleAllocatorEx_UninitializeSampleAllocator(decoder->allocator); + decoder->allocator_initialized = FALSE; +} + static HRESULT WINAPI transform_QueryInterface(IMFTransform *iface, REFIID iid, void **out) { struct h264_decoder *decoder = impl_from_IMFTransform(iface); @@ -583,11 +604,22 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { struct h264_decoder *decoder = impl_from_IMFTransform(iface); + HRESULT hr; TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); if (message == MFT_MESSAGE_SET_D3D_MANAGER) - return IMFVideoSampleAllocatorEx_SetDirectXManager(decoder->allocator, (IUnknown *)param); + { + if (FAILED(hr = IMFVideoSampleAllocatorEx_SetDirectXManager(decoder->allocator, (IUnknown *)param))) + return hr; + + uninit_allocator(decoder); + if (param) + decoder->output_info.dwFlags |= MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; + else + decoder->output_info.dwFlags &= ~MFT_OUTPUT_STREAM_PROVIDES_SAMPLES; + return S_OK; + } FIXME("Ignoring message %#x.\n", message); return S_OK; @@ -611,6 +643,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct wg_format wg_format; UINT32 sample_size; + IMFSample *sample; UINT64 frame_rate; GUID subtype; HRESULT hr; @@ -624,7 +657,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_TRANSFORM_TYPE_NOT_SET; *status = samples->dwStatus = 0; - if (!samples->pSample) + if (!(sample = samples->pSample) && !(decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES)) return E_INVALIDARG; if (FAILED(hr = IMFMediaType_GetGUID(decoder->output_type, &MF_MT_SUBTYPE, &subtype))) @@ -633,7 +666,21 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, decoder->wg_format.u.video.height, &sample_size))) return hr; - if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, samples->pSample, + if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) + { + if (FAILED(hr = init_allocator(decoder))) + { + ERR("Failed to initialize allocator, hr %#lx.\n", hr); + return hr; + } + if (FAILED(hr = IMFVideoSampleAllocatorEx_AllocateSample(decoder->allocator, &sample))) + { + ERR("Failed to allocate sample, hr %#lx.\n", hr); + return hr; + } + } + + if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, sample, sample_size, &wg_format, &samples->dwStatus))) wg_sample_queue_flush(decoder->wg_sample_queue, false); @@ -652,6 +699,16 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; + + uninit_allocator(decoder); + } + + if (decoder->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) + { + if (hr == S_OK) + samples->pSample = sample; + else + IMFSample_Release(sample); } return hr;
1
0
0
0
Paul Gofman : winegstreamer: Process MFT_MESSAGE_SET_D3D_MANAGER in h264 decoder.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 3f2ff939a10bc9ec14172d2798ea6f02e73048d2 URL:
https://gitlab.winehq.org/wine/wine/-/commit/3f2ff939a10bc9ec14172d2798ea6f…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Mar 31 19:16:59 2023 -0600 winegstreamer: Process MFT_MESSAGE_SET_D3D_MANAGER in h264 decoder. --- dlls/mf/tests/transform.c | 2 +- dlls/winegstreamer/h264_decoder.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 501747c94ae..26052e6ea6e 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -6832,7 +6832,7 @@ static void test_h264_with_dxgi_manager(void) IMFAttributes_Release(attribs); hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)transform); - todo_wine ok(hr == E_NOINTERFACE, "got %#lx\n", hr); + ok(hr == E_NOINTERFACE, "got %#lx\n", hr); hr = IMFTransform_ProcessMessage(transform, MFT_MESSAGE_SET_D3D_MANAGER, (ULONG_PTR)manager); ok(hr == S_OK || broken(hr == E_NOINTERFACE), "got %#lx\n", hr); diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 7d9c38837d3..e92d7bd730b 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -61,6 +61,8 @@ struct h264_decoder struct wg_format wg_format; struct wg_transform *wg_transform; struct wg_sample_queue *wg_sample_queue; + + IMFVideoSampleAllocatorEx *allocator; }; static struct h264_decoder *impl_from_IMFTransform(IMFTransform *iface) @@ -241,6 +243,7 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) if (!refcount) { + IMFVideoSampleAllocatorEx_Release(decoder->allocator); if (decoder->wg_transform) wg_transform_destroy(decoder->wg_transform); if (decoder->input_type) @@ -251,7 +254,6 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) IMFAttributes_Release(decoder->output_attributes); if (decoder->attributes) IMFAttributes_Release(decoder->attributes); - wg_sample_queue_destroy(decoder->wg_sample_queue); free(decoder); } @@ -580,7 +582,14 @@ static HRESULT WINAPI transform_ProcessEvent(IMFTransform *iface, DWORD id, IMFM static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_TYPE message, ULONG_PTR param) { - FIXME("iface %p, message %#x, param %Ix stub!\n", iface, message, param); + struct h264_decoder *decoder = impl_from_IMFTransform(iface); + + TRACE("iface %p, message %#x, param %Ix.\n", iface, message, param); + + if (message == MFT_MESSAGE_SET_D3D_MANAGER) + return IMFVideoSampleAllocatorEx_SetDirectXManager(decoder->allocator, (IUnknown *)param); + + FIXME("Ignoring message %#x.\n", message); return S_OK; } @@ -732,12 +741,16 @@ HRESULT h264_decoder_create(REFIID riid, void **ret) goto failed; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) goto failed; + if (FAILED(hr = MFCreateVideoSampleAllocatorEx(&IID_IMFVideoSampleAllocatorEx, (void **)&decoder->allocator))) + goto failed; *ret = &decoder->IMFTransform_iface; TRACE("Created decoder %p\n", *ret); return S_OK; failed: + if (decoder->wg_sample_queue) + wg_sample_queue_destroy(decoder->wg_sample_queue); if (decoder->output_attributes) IMFAttributes_Release(decoder->output_attributes); if (decoder->attributes)
1
0
0
0
Paul Gofman : mf/tests: Test h264 decoder with dxgi device manager.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 31d11d80f629b2a4d3a01c4af486d515fe07be4a URL:
https://gitlab.winehq.org/wine/wine/-/commit/31d11d80f629b2a4d3a01c4af486d5…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Mar 31 18:46:55 2023 -0600 mf/tests: Test h264 decoder with dxgi device manager. --- dlls/mf/tests/Makefile.in | 2 +- dlls/mf/tests/mf.c | 4 + dlls/mf/tests/mf_test.h | 2 + dlls/mf/tests/transform.c | 288 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 295 insertions(+), 1 deletion(-)
1
0
0
0
Paul Gofman : mf/tests: Increase h264data.bin video length.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 9ab380490362bbe0e7faed54921bd7e3ae530d2e URL:
https://gitlab.winehq.org/wine/wine/-/commit/9ab380490362bbe0e7faed54921bd7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Fri Apr 7 15:10:17 2023 -0600 mf/tests: Increase h264data.bin video length. --- dlls/mf/tests/h264data.bin | Bin 2220 -> 3465 bytes dlls/mf/tests/resource.rc | 2 +- dlls/mf/tests/transform.c | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/mf/tests/h264data.bin b/dlls/mf/tests/h264data.bin index 4f39bc7b4b0..a97ed63f205 100644 Binary files a/dlls/mf/tests/h264data.bin and b/dlls/mf/tests/h264data.bin differ diff --git a/dlls/mf/tests/resource.rc b/dlls/mf/tests/resource.rc index 25768d21983..10a969ff037 100644 --- a/dlls/mf/tests/resource.rc +++ b/dlls/mf/tests/resource.rc @@ -55,7 +55,7 @@ mp3encdata.bin RCDATA mp3encdata.bin mp3decdata.bin RCDATA mp3decdata.bin /* Generated with: - * gst-launch-1.0 videotestsrc num-buffers=60 pattern=smpte100 ! \ + * gst-launch-1.0 videotestsrc num-buffers=120 pattern=smpte100 ! \ * video/x-raw,format=I420,width=84,height=82,framerate=30000/1001 ! \ * videoflip method=clockwise ! videoconvert ! \ * x264enc ! filesink location=dlls/mf/tests/h264data.bin diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 602a03aabd0..e217e32d909 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -3845,7 +3845,7 @@ static void test_h264_decoder(void) todo_wine ok(i == 2, "got %lu iterations\n", i); todo_wine - ok(h264_encoded_data_len == 1180, "got h264_encoded_data_len %lu\n", h264_encoded_data_len); + ok(h264_encoded_data_len == 2425, "got h264_encoded_data_len %lu\n", h264_encoded_data_len); ok(hr == MF_E_TRANSFORM_STREAM_CHANGE, "ProcessOutput returned %#lx\n", hr); ok(output_status == MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE, "got output[0].dwStatus %#lx\n", output_status); hr = IMFSample_GetTotalLength(output_sample, &length);
1
0
0
0
Nikolay Sivov : mfplat: Handle more video subtypes in MFInitMediaTypeFromAMMediaType().
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 69b98b2b79f91a13bf3b083ec06527e96609cfd7 URL:
https://gitlab.winehq.org/wine/wine/-/commit/69b98b2b79f91a13bf3b083ec06527…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Sun Apr 9 18:09:47 2023 +0200 mfplat: Handle more video subtypes in MFInitMediaTypeFromAMMediaType(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/evr/tests/evr.c | 1 - dlls/mfplat/mediatype.c | 17 +++++++++++++++++ dlls/mfplat/tests/mfplat.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/dlls/evr/tests/evr.c b/dlls/evr/tests/evr.c index 4f30dd28570..e0cec1ba8c9 100644 --- a/dlls/evr/tests/evr.c +++ b/dlls/evr/tests/evr.c @@ -673,7 +673,6 @@ static void test_query_accept(void) { memcpy(&req_mt.subtype, subtype_tests[i], sizeof(GUID)); hr = IPin_QueryAccept(pin, &req_mt); - todo_wine_if(i) ok(hr == S_OK, "Got hr %#lx.\n", hr); } diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 245922ba068..16854c7a5a4 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -26,6 +26,7 @@ #include "ks.h" #include "ksmedia.h" #include "amvideo.h" +#include "wmcodecdsp.h" WINE_DEFAULT_DEBUG_CHANNEL(mfplat); @@ -3593,6 +3594,22 @@ static const GUID * get_mf_subtype_for_am_subtype(const GUID *subtype) if (IsEqualGUID(subtype, &MEDIASUBTYPE_RGB32)) return &MFVideoFormat_RGB32; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_ARGB32)) + return &MFVideoFormat_ARGB32; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_I420)) + return &MFVideoFormat_I420; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_AYUV)) + return &MFVideoFormat_AYUV; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YV12)) + return &MFVideoFormat_YV12; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YUY2)) + return &MFVideoFormat_YUY2; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_UYVY)) + return &MFVideoFormat_UYVY; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_YVYU)) + return &MFVideoFormat_YVYU; + else if (IsEqualGUID(subtype, &MEDIASUBTYPE_NV12)) + return &MFVideoFormat_NV12; else { FIXME("Unknown subtype %s.\n", debugstr_guid(subtype)); diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 1e5dc190944..58321672cea 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -56,6 +56,7 @@ #undef EXTERN_GUID #define EXTERN_GUID DEFINE_GUID #include "mfd3d12.h" +#include "wmcodecdsp.h" DEFINE_GUID(DUMMY_CLSID, 0x12345678,0x1234,0x1234,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19); DEFINE_GUID(DUMMY_GUID1, 0x12345678,0x1234,0x1234,0x21,0x21,0x21,0x21,0x21,0x21,0x21,0x21); @@ -8421,6 +8422,22 @@ static void test_MFInitMediaTypeFromAMMediaType(void) {0}, {0}, 0, 0, 0, {sizeof(BITMAPINFOHEADER), 32, 24, 1, 0, 0xdeadbeef} }; + static const struct guid_type_pair + { + const GUID *am_type; + const GUID *mf_type; + } guid_types[] = + { + { &MEDIASUBTYPE_I420, &MFVideoFormat_I420 }, + { &MEDIASUBTYPE_AYUV, &MFVideoFormat_AYUV }, + { &MEDIASUBTYPE_YV12, &MFVideoFormat_YV12 }, + { &MEDIASUBTYPE_YUY2, &MFVideoFormat_YUY2 }, + { &MEDIASUBTYPE_UYVY, &MFVideoFormat_UYVY }, + { &MEDIASUBTYPE_YVYU, &MFVideoFormat_YVYU }, + { &MEDIASUBTYPE_NV12, &MFVideoFormat_NV12 }, + { &MEDIASUBTYPE_ARGB32, &MFVideoFormat_ARGB32 }, + }; + unsigned int i; hr = MFCreateMediaType(&media_type); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); @@ -8539,6 +8556,22 @@ static void test_MFInitMediaTypeFromAMMediaType(void) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(value32 == 128, "Unexpected value %d.\n", value32); + vih.bmiHeader.biHeight = 24; + for (i = 0; i < ARRAY_SIZE(guid_types); ++i) + { + memcpy(&mt.subtype, guid_types[i].am_type, sizeof(GUID)); + + hr = MFInitMediaTypeFromAMMediaType(media_type, &mt); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + + hr = IMFMediaType_GetGUID(media_type, &MF_MT_MAJOR_TYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected guid %s.\n", debugstr_guid(&guid)); + hr = IMFMediaType_GetGUID(media_type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(IsEqualGUID(&guid, guid_types[i].mf_type), "Unexpected guid %s.\n", debugstr_guid(&guid)); + } + IMFMediaType_Release(media_type); }
1
0
0
0
Davide Beatrici : winecoreaudio: Implement and call timer_loop in unixlib.
by Alexandre Julliard
10 Apr '23
10 Apr '23
Module: wine Branch: master Commit: 357f0e9a493cd0a6a90cd89367548b57759a5297 URL:
https://gitlab.winehq.org/wine/wine/-/commit/357f0e9a493cd0a6a90cd89367548b…
Author: Davide Beatrici <git(a)davidebeatrici.dev> Date: Sat Apr 8 06:08:18 2023 +0200 winecoreaudio: Implement and call timer_loop in unixlib. --- dlls/winecoreaudio.drv/coreaudio.c | 41 ++++++++++++++++++++++-- dlls/winecoreaudio.drv/mmdevdrv.c | 65 +++++++++++--------------------------- 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index 4191958b1ca..aef678e7ca7 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -87,7 +87,7 @@ struct coreaudio_stream AUDCLNT_SHAREMODE share; HANDLE event; - BOOL playing; + BOOL playing, please_quit; REFERENCE_TIME period; UINT32 period_frames; UINT32 bufsize_frames, resamp_bufsize_frames; @@ -745,6 +745,12 @@ static NTSTATUS unix_release_stream( void *args ) struct coreaudio_stream *stream = handle_get_stream(params->stream); SIZE_T size; + if(params->timer_thread){ + stream->please_quit = TRUE; + NtWaitForSingleObject(params->timer_thread, FALSE, NULL); + NtClose(params->timer_thread); + } + if(stream->unit){ AudioOutputUnitStop(stream->unit); AudioComponentInstanceDispose(stream->unit); @@ -1370,6 +1376,35 @@ static NTSTATUS unix_reset(void *args) return STATUS_SUCCESS; } +static NTSTATUS unix_timer_loop(void *args) +{ + struct timer_loop_params *params = args; + struct coreaudio_stream *stream = handle_get_stream(params->stream); + LARGE_INTEGER delay, next, last; + int adjust; + + delay.QuadPart = -stream->period; + NtQueryPerformanceCounter(&last, NULL); + next.QuadPart = last.QuadPart + stream->period; + + while(!stream->please_quit){ + NtSetEvent(stream->event, NULL); + NtDelayExecution(FALSE, &delay); + NtQueryPerformanceCounter(&last, NULL); + + adjust = next.QuadPart - last.QuadPart; + if(adjust > stream->period / 2) + adjust = stream->period / 2; + else if(adjust < -stream->period / 2) + adjust = -stream->period / 2; + + delay.QuadPart = -(stream->period + adjust); + next.QuadPart += stream->period; + } + + return STATUS_SUCCESS; +} + static NTSTATUS unix_get_render_buffer(void *args) { struct get_render_buffer_params *params = args; @@ -1688,7 +1723,7 @@ unixlib_entry_t __wine_unix_call_funcs[] = unix_start, unix_stop, unix_reset, - unix_not_implemented, + unix_timer_loop, unix_get_render_buffer, unix_release_render_buffer, unix_get_capture_buffer, @@ -2050,7 +2085,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] = unix_start, unix_stop, unix_reset, - unix_not_implemented, + unix_timer_loop, unix_wow64_get_render_buffer, unix_release_render_buffer, unix_wow64_get_capture_buffer, diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index e40b3c0f019..97492440535 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -91,8 +91,7 @@ struct ACImpl { IUnknown *pUnkFTMarshal; EDataFlow dataflow; - UINT32 channel_count, period_ms; - HANDLE event; + UINT32 channel_count; float *vols; HANDLE timer; @@ -127,8 +126,6 @@ typedef struct _SessionMgr { static WCHAR drv_key_devicesW[256]; -static HANDLE g_timer_q; - static CRITICAL_SECTION g_sessions_lock; static CRITICAL_SECTION_DEBUG g_sessions_lock_debug = { @@ -212,15 +209,11 @@ BOOL WINAPI DllMain(HINSTANCE dll, DWORD reason, void *reserved) swprintf(drv_key_devicesW, ARRAY_SIZE(drv_key_devicesW), L"Software\\Wine\\Drivers\\%s\\devices", filename); - g_timer_q = CreateTimerQueue(); - if(!g_timer_q) - return FALSE; break; } case DLL_PROCESS_DETACH: if (reserved) break; DeleteCriticalSection(&g_sessions_lock); - CloseHandle(g_timer_q); break; } return TRUE; @@ -516,28 +509,17 @@ static ULONG WINAPI AudioClient_AddRef(IAudioClient3 *iface) static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) { ACImpl *This = impl_from_IAudioClient3(iface); - struct release_stream_params params; ULONG ref; - ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %lu\n", This, ref); if(!ref){ - if(This->timer){ - HANDLE event; - BOOL wait; - event = CreateEventW(NULL, TRUE, FALSE, NULL); - wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); - wait = wait && GetLastError() == ERROR_IO_PENDING; - if(event && wait) - WaitForSingleObject(event, INFINITE); - CloseHandle(event); - } if(This->stream){ + struct release_stream_params params; params.stream = This->stream; - params.timer_thread = NULL; + params.timer_thread = This->timer; UNIX_CALL(release_stream, ¶ms); - } - if(This->session){ + This->stream = 0; + EnterCriticalSection(&g_sessions_lock); list_remove(&This->entry); LeaveCriticalSection(&g_sessions_lock); @@ -752,7 +734,6 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, } This->channel_count = fmt->nChannels; - This->period_ms = period / 10000; This->vols = HeapAlloc(GetProcessHeap(), 0, This->channel_count * sizeof(float)); if(!This->vols){ @@ -922,18 +903,21 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface, return S_OK; } -void CALLBACK ca_period_cb(void *user, BOOLEAN timer) +static DWORD WINAPI ca_timer_thread(void *user) { + struct timer_loop_params params; ACImpl *This = user; - - if(This->event) - SetEvent(This->event); + params.stream = This->stream; + SetThreadDescription(GetCurrentThread(), L"winecoreaudio_timer_loop"); + UNIX_CALL(timer_loop, ¶ms); + return 0; } static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) { ACImpl *This = impl_from_IAudioClient3(iface); struct start_params params; + HRESULT hr; TRACE("(%p)\n", This); @@ -942,19 +926,15 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface) params.stream = This->stream; UNIX_CALL(start, ¶ms); + if(FAILED(hr = params.result)) + return hr; - if(SUCCEEDED(params.result)){ - if(This->event && !This->timer){ - if(!CreateTimerQueueTimer(&This->timer, g_timer_q, ca_period_cb, This, 0, - This->period_ms, WT_EXECUTEINTIMERTHREAD)){ - This->timer = NULL; - IAudioClient3_Stop(iface); - WARN("Unable to create timer: %lu\n", GetLastError()); - return E_OUTOFMEMORY; - } - } + if(!This->timer) { + This->timer = CreateThread(NULL, 0, ca_timer_thread, This, 0, NULL); + SetThreadPriority(This->timer, THREAD_PRIORITY_TIME_CRITICAL); } - return params.result; + + return S_OK; } static HRESULT WINAPI AudioClient_Stop(IAudioClient3 *iface) @@ -1004,13 +984,6 @@ static HRESULT WINAPI AudioClient_SetEventHandle(IAudioClient3 *iface, params.stream = This->stream; params.event = event; UNIX_CALL(set_event_handle, ¶ms); - - if(SUCCEEDED(params.result)){ - EnterCriticalSection(&g_sessions_lock); - This->event = event; - LeaveCriticalSection(&g_sessions_lock); - } - return params.result; }
1
0
0
0
← Newer
1
...
54
55
56
57
58
59
60
...
82
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
Results per page:
10
25
50
100
200