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
September 2022
----- 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
553 discussions
Start a n
N
ew thread
Rémi Bernon : winegstreamer: Implement IWMSyncReader2_SetAllocateForOutput.
by Alexandre Julliard
29 Sep '22
29 Sep '22
Module: wine Branch: master Commit: 7eb50d5e5703dc660945554da70cae37324bb39c URL:
https://gitlab.winehq.org/wine/wine/-/commit/7eb50d5e5703dc660945554da70cae…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 14:57:10 2022 +0200 winegstreamer: Implement IWMSyncReader2_SetAllocateForOutput. --- dlls/winegstreamer/gst_private.h | 2 ++ dlls/winegstreamer/wm_reader.c | 30 +++++++++++++++++++++++++----- dlls/wmvcore/tests/wmvcore.c | 5 ----- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 178679c38ee..44b526c0044 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -158,6 +158,8 @@ struct wm_stream * compressed samples. Rather, the behaviour of the reader objects differs * in nontrivial ways depending on this field. */ bool read_compressed; + + IWMReaderAllocatorEx *output_allocator; }; struct wm_reader diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 4839ddb8fa3..916bfb68ea8 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1620,7 +1620,10 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA TRACE("Got buffer for '%s' stream %p.\n", get_major_type_string(stream->format.major_type), stream); - if (callback_advanced && stream->read_compressed && stream->allocate_stream) + if (!stream->read_compressed && stream->output_allocator) + hr = IWMReaderAllocatorEx_AllocateForOutputEx(stream->output_allocator, stream->index, + wg_buffer.size, &sample, 0, 0, 0, NULL); + else if (callback_advanced && stream->read_compressed && stream->allocate_stream) hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced, stream->index + 1, wg_buffer.size, &sample, NULL); else if (callback_advanced && !stream->read_compressed && stream->allocate_output) @@ -2417,11 +2420,28 @@ static HRESULT WINAPI reader_SetRangeByFrameEx(IWMSyncReader2 *iface, WORD strea return E_NOTIMPL; } -static HRESULT WINAPI reader_SetAllocateForOutput(IWMSyncReader2 *iface, DWORD output_num, IWMReaderAllocatorEx *allocator) +static HRESULT WINAPI reader_SetAllocateForOutput(IWMSyncReader2 *iface, DWORD output, IWMReaderAllocatorEx *allocator) { - struct wm_reader *This = impl_from_IWMSyncReader2(iface); - FIXME("(%p)->(%lu %p): stub!\n", This, output_num, allocator); - return E_NOTIMPL; + struct wm_reader *reader = impl_from_IWMSyncReader2(iface); + struct wm_stream *stream; + + TRACE("reader %p, output %lu, allocator %p.\n", reader, output, allocator); + + EnterCriticalSection(&reader->cs); + + if (!(stream = get_stream_by_output_number(reader, output))) + { + LeaveCriticalSection(&reader->cs); + return E_INVALIDARG; + } + + if (stream->output_allocator) + IWMReaderAllocatorEx_Release(stream->output_allocator); + if ((stream->output_allocator = allocator)) + IWMReaderAllocatorEx_AddRef(stream->output_allocator); + + LeaveCriticalSection(&reader->cs); + return S_OK; } static HRESULT WINAPI reader_GetAllocateForOutput(IWMSyncReader2 *iface, DWORD output_num, IWMReaderAllocatorEx **allocator) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 46e15c922c3..33f61889415 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -3491,7 +3491,6 @@ static void test_sync_reader_allocator(void) todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMSyncReader2_SetAllocateForOutput(reader, -1, &callback.IWMReaderAllocatorEx_iface); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); hr = IWMSyncReader2_SetAllocateForStream(reader, 0, &callback.IWMReaderAllocatorEx_iface); todo_wine @@ -3551,7 +3550,6 @@ static void test_sync_reader_allocator(void) hr = IWMSyncReader2_SetAllocateForOutput(reader, 0, &callback.IWMReaderAllocatorEx_iface); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); allocator = (void *)0xdeadbeef; hr = IWMSyncReader2_GetAllocateForOutput(reader, 1, &allocator); @@ -3572,7 +3570,6 @@ static void test_sync_reader_allocator(void) ok(allocator == &callback.IWMReaderAllocatorEx_iface, "Got allocator %p.\n", allocator); hr = IWMSyncReader2_SetAllocateForOutput(reader, 0, NULL); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); allocator = (void *)0xdeadbeef; hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); @@ -3596,7 +3593,6 @@ static void test_sync_reader_allocator(void) hr = IWMSyncReader2_SetReadStreamSamples(reader, stream_num, TRUE); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IWMSyncReader2_SetAllocateForOutput(reader, 1, &callback.IWMReaderAllocatorEx_iface); - todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr); callback.allocated_samples = true; @@ -3615,7 +3611,6 @@ static void test_sync_reader_allocator(void) hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, &output_num, &stream_num); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(sample->lpVtbl == &buffer_vtbl, "Buffer vtbl didn't match.\n"); INSSBuffer_Release(sample);
1
0
0
0
Rémi Bernon : winegstreamer: Factor wm reader sample allocator error checks.
by Alexandre Julliard
29 Sep '22
29 Sep '22
Module: wine Branch: master Commit: 45598d76e49dc3b651db6c8da1737c5e7e5eb692 URL:
https://gitlab.winehq.org/wine/wine/-/commit/45598d76e49dc3b651db6c8da1737c…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 15:53:53 2022 +0200 winegstreamer: Factor wm reader sample allocator error checks. --- dlls/winegstreamer/wm_reader.c | 44 +++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c index 95d6d8e0180..4839ddb8fa3 100644 --- a/dlls/winegstreamer/wm_reader.c +++ b/dlls/winegstreamer/wm_reader.c @@ -1573,9 +1573,10 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA struct wg_parser_stream *wg_stream; struct wg_parser_buffer wg_buffer; struct wm_stream *stream; + struct buffer *object; DWORD size, capacity; INSSBuffer *sample; - HRESULT hr; + HRESULT hr = S_OK; BYTE *data; for (;;) @@ -1620,36 +1621,16 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA TRACE("Got buffer for '%s' stream %p.\n", get_major_type_string(stream->format.major_type), stream); if (callback_advanced && stream->read_compressed && stream->allocate_stream) - { - if (FAILED(hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced, - stream->index + 1, wg_buffer.size, &sample, NULL))) - { - ERR("Failed to allocate stream sample of %u bytes, hr %#lx.\n", wg_buffer.size, hr); - wg_parser_stream_release_buffer(wg_stream); - return hr; - } - } + hr = IWMReaderCallbackAdvanced_AllocateForStream(callback_advanced, + stream->index + 1, wg_buffer.size, &sample, NULL); else if (callback_advanced && !stream->read_compressed && stream->allocate_output) - { - if (FAILED(hr = IWMReaderCallbackAdvanced_AllocateForOutput(callback_advanced, - stream->index, wg_buffer.size, &sample, NULL))) - { - ERR("Failed to allocate output sample of %u bytes, hr %#lx.\n", wg_buffer.size, hr); - wg_parser_stream_release_buffer(wg_stream); - return hr; - } - } + hr = IWMReaderCallbackAdvanced_AllocateForOutput(callback_advanced, + stream->index, wg_buffer.size, &sample, NULL); + /* FIXME: Should these be pooled? */ + else if (!(object = calloc(1, offsetof(struct buffer, data[wg_buffer.size])))) + hr = E_OUTOFMEMORY; else { - struct buffer *object; - - /* FIXME: Should these be pooled? */ - if (!(object = calloc(1, offsetof(struct buffer, data[wg_buffer.size])))) - { - wg_parser_stream_release_buffer(wg_stream); - return E_OUTOFMEMORY; - } - object->INSSBuffer_iface.lpVtbl = &buffer_vtbl; object->refcount = 1; object->capacity = wg_buffer.size; @@ -1658,6 +1639,13 @@ HRESULT wm_reader_get_stream_sample(struct wm_reader *reader, IWMReaderCallbackA sample = &object->INSSBuffer_iface; } + if (FAILED(hr)) + { + ERR("Failed to allocate sample of %u bytes, hr %#lx.\n", wg_buffer.size, hr); + wg_parser_stream_release_buffer(wg_stream); + return hr; + } + if (FAILED(hr = INSSBuffer_GetBufferAndLength(sample, &data, &size))) ERR("Failed to get data pointer, hr %#lx.\n", hr); if (FAILED(hr = INSSBuffer_GetMaxLength(sample, &capacity)))
1
0
0
0
Rémi Bernon : wmvcore/tests: Test IWMReaderAllocatorEx usage and parameters.
by Alexandre Julliard
29 Sep '22
29 Sep '22
Module: wine Branch: master Commit: 42e98094a33e908c8ecd39059eb230afc254465b URL:
https://gitlab.winehq.org/wine/wine/-/commit/42e98094a33e908c8ecd39059eb230…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Fri Sep 23 16:38:32 2022 +0200 wmvcore/tests: Test IWMReaderAllocatorEx usage and parameters. --- dlls/wmvcore/tests/wmvcore.c | 133 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 129 insertions(+), 4 deletions(-) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index 671b6602b47..46e15c922c3 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -2248,16 +2248,51 @@ static HRESULT WINAPI callback_allocator_AllocateForStreamEx(IWMReaderAllocatorE WORD stream_number, DWORD size, INSSBuffer **sample, DWORD flags, QWORD pts, QWORD duration, void *context) { - ok(0, "Unexpected call.\n"); - return E_NOTIMPL; + struct callback *callback = impl_from_IWMReaderAllocatorEx(iface); + struct buffer *object; + + ok(callback->allocated_samples, "Unexpected call.\n"); + ok(stream_number, "got stream_number %u.\n", stream_number); + ok(!flags, "got flags %#lx.\n", flags); + ok(!pts, "got pts %I64d.\n", pts); + ok(!duration, "got duration %I64d.\n", duration); + ok(!context, "got context %p.\n", context); + + if (!(object = malloc(offsetof(struct buffer, data[size])))) + return E_OUTOFMEMORY; + object->INSSBuffer_iface.lpVtbl = &buffer_vtbl; + object->refcount = 1; + object->capacity = size; + object->size = size; + + *sample = &object->INSSBuffer_iface; + InterlockedIncrement(&outstanding_buffers); + return S_OK; } static HRESULT WINAPI callback_allocator_AllocateForOutputEx(IWMReaderAllocatorEx *iface, DWORD output, DWORD size, INSSBuffer **sample, DWORD flags, QWORD pts, QWORD duration, void *context) { - ok(0, "Unexpected call.\n"); - return E_NOTIMPL; + struct callback *callback = impl_from_IWMReaderAllocatorEx(iface); + struct buffer *object; + + ok(callback->allocated_samples, "Unexpected call.\n"); + ok(!flags, "got flags %#lx.\n", flags); + ok(!pts, "got pts %I64d.\n", pts); + ok(!duration, "got duration %I64d.\n", duration); + ok(!context, "got context %p.\n", context); + + if (!(object = malloc(offsetof(struct buffer, data[size])))) + return E_OUTOFMEMORY; + object->INSSBuffer_iface.lpVtbl = &buffer_vtbl; + object->refcount = 1; + object->capacity = size; + object->size = size; + + *sample = &object->INSSBuffer_iface; + InterlockedIncrement(&outstanding_buffers); + return S_OK; } static const IWMReaderAllocatorExVtbl callback_allocator_vtbl = @@ -3419,7 +3454,11 @@ static void test_sync_reader_allocator(void) IWMReaderAllocatorEx *allocator; struct teststream stream; struct callback callback; + DWORD output_num, flags; IWMSyncReader2 *reader; + QWORD pts, duration; + INSSBuffer *sample; + WORD stream_num; HANDLE file; HRESULT hr; BOOL ret; @@ -3549,6 +3588,92 @@ static void test_sync_reader_allocator(void) ok(!allocator, "Got allocator %p.\n", allocator); + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForStream(reader, stream_num, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetReadStreamSamples(reader, stream_num, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForOutput(reader, 1, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + callback.allocated_samples = true; + + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, + &output_num, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(sample->lpVtbl == &buffer_vtbl, "Buffer vtbl didn't match.\n"); + INSSBuffer_Release(sample); + + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 1, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, + &output_num, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(sample->lpVtbl == &buffer_vtbl, "Buffer vtbl didn't match.\n"); + INSSBuffer_Release(sample); + + callback.allocated_samples = false; + + + /* without compressed sample read, allocator isn't used */ + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetReadStreamSamples(reader, stream_num, FALSE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, + &output_num, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(sample->lpVtbl != &buffer_vtbl, "Unexpected buffer vtbl.\n"); + INSSBuffer_Release(sample); + + + /* cannot change or remove allocators after they've been used */ + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForStream(reader, stream_num, NULL); + todo_wine + ok(hr == NS_E_INVALID_REQUEST, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForOutput(reader, 0, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == NS_E_INVALID_REQUEST, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForOutput(reader, 1, NULL); + todo_wine + ok(hr == NS_E_INVALID_REQUEST, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetReadStreamSamples(reader, stream_num, TRUE); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + callback.allocated_samples = true; + + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 1, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, + &output_num, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(sample->lpVtbl == &buffer_vtbl, "Buffer vtbl didn't match.\n"); + INSSBuffer_Release(sample); + + hr = IWMSyncReader2_GetStreamNumberForOutput(reader, 0, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetNextSample(reader, stream_num, &sample, &pts, &duration, &flags, + &output_num, &stream_num); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(sample->lpVtbl == &buffer_vtbl, "Unexpected buffer vtbl.\n"); + INSSBuffer_Release(sample); + + callback.allocated_samples = false; + + IWMSyncReader2_Release(reader); ok(stream.refcount == 1, "Got outstanding refcount %ld.\n", stream.refcount);
1
0
0
0
Rémi Bernon : wmvcore/tests: Test IWMSyncReader2_(Get|Set)AllocateFor(Output|Stream).
by Alexandre Julliard
29 Sep '22
29 Sep '22
Module: wine Branch: master Commit: 0c51f462a7316fbe64a60b5b92890b0d0945c638 URL:
https://gitlab.winehq.org/wine/wine/-/commit/0c51f462a7316fbe64a60b5b92890b…
Author: Rémi Bernon <rbernon(a)codeweavers.com> Date: Mon Aug 22 15:14:20 2022 +0200 wmvcore/tests: Test IWMSyncReader2_(Get|Set)AllocateFor(Output|Stream). --- dlls/wmvcore/tests/wmvcore.c | 147 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c index aacff6f7bda..671b6602b47 100644 --- a/dlls/wmvcore/tests/wmvcore.c +++ b/dlls/wmvcore/tests/wmvcore.c @@ -3413,6 +3413,152 @@ static void test_async_reader_file(void) ok(ret, "Failed to delete %s, error %lu.\n", debugstr_w(filename), GetLastError()); } +static void test_sync_reader_allocator(void) +{ + const WCHAR *filename = load_resource(L"test.wmv"); + IWMReaderAllocatorEx *allocator; + struct teststream stream; + struct callback callback; + IWMSyncReader2 *reader; + HANDLE file; + HRESULT hr; + BOOL ret; + + callback_init(&callback); + + hr = WMCreateSyncReader(NULL, 0, (IWMSyncReader **)&reader); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + file = CreateFileW(filename, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0); + ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %lu.\n", debugstr_w(file), GetLastError()); + + teststream_init(&stream, file); + + hr = IWMSyncReader2_OpenStream(reader, &stream.IStream_iface); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(stream.refcount > 1, "Got refcount %ld.\n", stream.refcount); + + + hr = IWMSyncReader2_GetAllocateForOutput(reader, -1, &allocator); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetAllocateForStream(reader, 0, &allocator); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, NULL); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, NULL); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForOutput(reader, -1, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + hr = IWMSyncReader2_SetAllocateForStream(reader, 0, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr); + + + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + + + hr = IWMSyncReader2_SetAllocateForStream(reader, 1, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForStream(reader, 2, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(allocator == &callback.IWMReaderAllocatorEx_iface, "Got allocator %p.\n", allocator); + + hr = IWMSyncReader2_SetAllocateForStream(reader, 1, NULL); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + + + hr = IWMSyncReader2_SetAllocateForOutput(reader, 0, &callback.IWMReaderAllocatorEx_iface); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForOutput(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(allocator == &callback.IWMReaderAllocatorEx_iface, "Got allocator %p.\n", allocator); + + hr = IWMSyncReader2_SetAllocateForOutput(reader, 0, NULL); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForOutput(reader, 0, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + allocator = (void *)0xdeadbeef; + hr = IWMSyncReader2_GetAllocateForStream(reader, 1, &allocator); + todo_wine + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine + ok(!allocator, "Got allocator %p.\n", allocator); + + + IWMSyncReader2_Release(reader); + + ok(stream.refcount == 1, "Got outstanding refcount %ld.\n", stream.refcount); + CloseHandle(stream.file); + ret = DeleteFileW(filename); + ok(ret, "Failed to delete %s, error %lu.\n", debugstr_w(filename), GetLastError()); + + callback_cleanup(&callback); +} + START_TEST(wmvcore) { HRESULT hr; @@ -3431,6 +3577,7 @@ START_TEST(wmvcore) test_WMCreateWriterPriv(); test_urlextension(); test_iscontentprotected(); + test_sync_reader_allocator(); test_sync_reader_settings(); test_sync_reader_streaming(); test_sync_reader_types();
1
0
0
0
Francois Gouget : tests: Print unhandled exception messages in colour.
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: 8bfb1ecf2582345c2380c0efdd4fa0c35373c911 URL:
https://gitlab.winehq.org/wine/wine/-/commit/8bfb1ecf2582345c2380c0efdd4fa0…
Author: Francois Gouget <fgouget(a)codeweavers.com> Date: Wed Sep 28 18:52:39 2022 +0200 tests: Print unhandled exception messages in colour. Note that quite often the unhandled exception messages actually come from Windows or Wine and these cannot be colorized. --- include/wine/test.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/wine/test.h b/include/wine/test.h index 94d92e19c57..c28128d9f0c 100644 --- a/include/wine/test.h +++ b/include/wine/test.h @@ -654,7 +654,9 @@ void winetest_wait_child_process( HANDLE process ) { DWORD pid = GetProcessId( process ); winetest_print_lock(); + if (winetest_color) printf( color_bright_red ); winetest_printf( "unhandled exception %08x in child process %04x\n", (UINT)exit_code, (UINT)pid ); + if (winetest_color) printf( color_reset ); winetest_print_unlock(); InterlockedIncrement( &failures ); } @@ -754,9 +756,11 @@ static LONG CALLBACK exc_filter( EXCEPTION_POINTERS *ptrs ) if (data->current_file) printf( "%s:%d: this is the last test seen before the exception\n", data->current_file, data->current_line ); + if (winetest_color) printf( color_bright_red ); printf( "%04x:%s:%s unhandled exception %08x at %p\n", (UINT)GetCurrentProcessId(), current_test->name, winetest_elapsed(), (UINT)ptrs->ExceptionRecord->ExceptionCode, ptrs->ExceptionRecord->ExceptionAddress ); + if (winetest_color) printf( color_reset ); fflush( stdout ); winetest_print_unlock(); return EXCEPTION_EXECUTE_HANDLER;
1
0
0
0
Paul Gofman : msi: Disable FS redirection for temporary file in cabinet_copy_file().
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: a58c6251870dfb7d214464e709bbbc9ca649b900 URL:
https://gitlab.winehq.org/wine/wine/-/commit/a58c6251870dfb7d214464e709bbbc…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Tue Sep 27 13:36:49 2022 -0500 msi: Disable FS redirection for temporary file in cabinet_copy_file(). --- dlls/msi/files.c | 9 +++++++++ dlls/msi/media.c | 6 +++--- dlls/msi/msipriv.h | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dlls/msi/files.c b/dlls/msi/files.c index 1b8e4fd7d90..94c733fca8f 100644 --- a/dlls/msi/files.c +++ b/dlls/msi/files.c @@ -48,6 +48,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi); +BOOL msi_get_temp_file_name( MSIPACKAGE *package, const WCHAR *tmp_path, const WCHAR *prefix, WCHAR *tmp_filename ) +{ + BOOL ret; + msi_disable_fs_redirection( package ); + ret = GetTempFileNameW( tmp_path, prefix, 0, tmp_filename ); + msi_revert_fs_redirection( package ); + return ret; +} + HANDLE msi_create_file( MSIPACKAGE *package, const WCHAR *filename, DWORD access, DWORD sharing, DWORD creation, DWORD flags ) { diff --git a/dlls/msi/media.c b/dlls/msi/media.c index 6aeb948de51..db65a282b93 100644 --- a/dlls/msi/media.c +++ b/dlls/msi/media.c @@ -468,10 +468,10 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, msi_free( tmppathW ); return ERROR_OUTOFMEMORY; } - if (!GetTempFileNameW(tmppathW, L"msi", 0, tmpfileW)) tmpfileW[0] = 0; + if (!msi_get_temp_file_name( data->package, tmppathW, L"msi", tmpfileW )) tmpfileW[0] = 0; msi_free( tmppathW ); - handle = CreateFileW(tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, attrs, NULL); + handle = msi_create_file( data->package, tmpfileW, GENERIC_READ | GENERIC_WRITE, 0, CREATE_ALWAYS, attrs ); if (handle != INVALID_HANDLE_VALUE && msi_move_file( data->package, path, NULL, MOVEFILE_DELAY_UNTIL_REBOOT ) && @@ -482,7 +482,7 @@ static INT_PTR cabinet_copy_file(FDINOTIFICATIONTYPE fdint, else { WARN( "failed to schedule rename operation %s (error %lu)\n", debugstr_w(path), GetLastError() ); - DeleteFileW( tmpfileW ); + msi_delete_file( data->package, tmpfileW ); } msi_free(tmpfileW); } diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index b5838bad6fe..d63c6f244ff 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -1073,6 +1073,7 @@ static inline void msi_revert_fs_redirection( MSIPACKAGE *package ) { if (is_wow64 && package->platform == PLATFORM_X64) Wow64RevertWow64FsRedirection( package->cookie ); } +extern BOOL msi_get_temp_file_name( MSIPACKAGE *, const WCHAR *, const WCHAR *, WCHAR * ) DECLSPEC_HIDDEN; extern HANDLE msi_create_file( MSIPACKAGE *, const WCHAR *, DWORD, DWORD, DWORD, DWORD ) DECLSPEC_HIDDEN; extern BOOL msi_delete_file( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN; extern BOOL msi_remove_directory( MSIPACKAGE *, const WCHAR * ) DECLSPEC_HIDDEN;
1
0
0
0
Alex Henrie : winegstreamer: Fix memory leak in get_available_media_type (Coverity).
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: 1be02b2b60faf41d3fd9a8fbcf386cb21b6db4e6 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1be02b2b60faf41d3fd9a8fbcf386c…
Author: Alex Henrie <alexhenrie24(a)gmail.com> Date: Wed Sep 28 10:19:02 2022 -0600 winegstreamer: Fix memory leak in get_available_media_type (Coverity). --- dlls/winegstreamer/resampler.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index a9c9ae32e8a..87c76274085 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -269,15 +269,15 @@ static HRESULT get_available_media_type(DWORD index, IMFMediaType **type, BOOL o const GUID *subtype; HRESULT hr; - if (FAILED(hr = MFCreateMediaType(&media_type))) - return hr; - *type = NULL; if (index >= (output ? 2 : 1) * ARRAY_SIZE(audio_formats)) return MF_E_NO_MORE_TYPES; subtype = audio_formats[index % ARRAY_SIZE(audio_formats)]; + if (FAILED(hr = MFCreateMediaType(&media_type))) + return hr; + if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio))) goto done; if (FAILED(hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, subtype)))
1
0
0
0
Jacek Caban : winevulkan: Separate 32-bit and 64-bit conversion functions.
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: 1f1713b07ef4da66c39816a872fa102cddb37151 URL:
https://gitlab.winehq.org/wine/wine/-/commit/1f1713b07ef4da66c39816a872fa10…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 27 22:47:18 2022 +0200 winevulkan: Separate 32-bit and 64-bit conversion functions. --- dlls/winevulkan/make_vulkan | 210 ++++----- dlls/winevulkan/vulkan_thunks.c | 996 ++++++++++++++++++++++++---------------- 2 files changed, 697 insertions(+), 509 deletions(-)
1
0
0
0
Jacek Caban : winevulkan: Pass VkVariable to ConversionFunction constructor.
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: c39a71e3cded3c927bfa83882562e2683e12074e URL:
https://gitlab.winehq.org/wine/wine/-/commit/c39a71e3cded3c927bfa83882562e2…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Sep 20 18:18:12 2022 +0200 winevulkan: Pass VkVariable to ConversionFunction constructor. --- dlls/winevulkan/make_vulkan | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index c0377ca9f17..87985f4296c 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -1395,16 +1395,10 @@ class VkMember(VkVariable): elif self.is_handle() or self.is_generic_handle(): direction = Direction.INPUT - operand = self.type_info["data"] - if self.is_dynamic_array(): - conversions.append(ConversionFunction(False, True, direction, operand)) - elif self.is_static_array(): - conversions.append(ConversionFunction(True, False, direction, operand)) - else: - conversions.append(ConversionFunction(False, False, direction, operand)) + conversions.append(ConversionFunction(self, direction)) if self.needs_free(): - conversions.append(FreeFunction(self.is_dynamic_array(), operand)) + conversions.append(FreeFunction(self.is_dynamic_array(), self.type_info["data"])) return conversions @@ -1526,20 +1520,20 @@ class VkParam(VkVariable): if not self.needs_conversion() and not self.needs_unwrapping(): return - operand = self.struct if self.is_struct() else self.handle - # Input functions require win to host conversion. if self._direction in [Direction.INPUT, Direction.INPUT_OUTPUT]: - self.input_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.INPUT, operand) + self.input_conv = ConversionFunction(self, Direction.INPUT) # Output functions require host to win conversion. if self._direction in [Direction.INPUT_OUTPUT, Direction.OUTPUT]: - self.output_conv = ConversionFunction(False, self.is_dynamic_array(), Direction.OUTPUT, operand) + self.output_conv = ConversionFunction(self, Direction.OUTPUT) + # Dynamic arrays, but also some normal structs (e.g. VkCommandBufferBeginInfo) need memory # allocation and thus some cleanup. if self.is_dynamic_array() or self.struct.needs_free(): - self.free_func = FreeFunction(self.is_dynamic_array(), operand) + self.free_func = FreeFunction(self.is_dynamic_array(), + self.struct if self.is_struct() else self.handle) def _set_direction(self): """ Internal helper function to set parameter direction (input/output/input_output). """ @@ -2068,12 +2062,12 @@ class VkStruct(Sequence): class ConversionFunction(object): - def __init__(self, array, dyn_array, direction, operand): - self.array = array + def __init__(self, variable, direction): self.direction = direction - self.dyn_array = dyn_array - self.operand = operand - self.type = operand.name + self.array = variable.is_static_array() + self.dyn_array = variable.is_dynamic_array() + self.operand = variable.struct if variable.is_struct() else variable.handle + self.type = variable.type self._set_name()
1
0
0
0
Alexandre Julliard : gdiplus: Get the compositing mode directly from the graphics object.
by Alexandre Julliard
28 Sep '22
28 Sep '22
Module: wine Branch: master Commit: fe7df461189e59e0e6d54a83ad3903f1fd93aa01 URL:
https://gitlab.winehq.org/wine/wine/-/commit/fe7df461189e59e0e6d54a83ad3903…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Sep 28 14:44:35 2022 +0200 gdiplus: Get the compositing mode directly from the graphics object. GdipGetCompositingMode() fails when the object is busy, which happens when flushing changes in GdipReleaseDC(). Fixes a test crash on Gitlab CI. --- dlls/gdiplus/graphics.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index a9f7a464ce3..fca66c8654b 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -418,9 +418,7 @@ static GpStatus alpha_blend_bmp_pixels(GpGraphics *graphics, INT dst_x, INT dst_ { GpBitmap *dst_bitmap = (GpBitmap*)graphics->image; INT x, y; - CompositingMode comp_mode; - - GdipGetCompositingMode(graphics, &comp_mode); + CompositingMode comp_mode = graphics->compmode; for (y=0; y<src_height; y++) {
1
0
0
0
← Newer
1
2
3
4
5
6
7
8
9
...
56
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
Results per page:
10
25
50
100
200