mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:00:30 +00:00
winegstreamer: Use IWMSyncReader2_GetAllocateForStream in the async reader.
This commit is contained in:
parent
04fa63913a
commit
b23154808f
|
@ -905,11 +905,21 @@ static HRESULT WINAPI WMReaderAdvanced_SetAllocateForStream(IWMReaderAdvanced6 *
|
||||||
return IWMSyncReader2_SetAllocateForStream(reader->reader, stream_number, allocate ? reader->allocator : NULL);
|
return IWMSyncReader2_SetAllocateForStream(reader->reader, stream_number, allocate ? reader->allocator : NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD output_num, BOOL *allocate)
|
static HRESULT WINAPI WMReaderAdvanced_GetAllocateForStream(IWMReaderAdvanced6 *iface, WORD stream_number, BOOL *allocate)
|
||||||
{
|
{
|
||||||
struct async_reader *This = impl_from_IWMReaderAdvanced6(iface);
|
struct async_reader *reader = impl_from_IWMReaderAdvanced6(iface);
|
||||||
FIXME("(%p)->(%d %p)\n", This, output_num, allocate);
|
IWMReaderAllocatorEx *allocator;
|
||||||
return E_NOTIMPL;
|
HRESULT hr;
|
||||||
|
|
||||||
|
TRACE("reader %p, stream_number %u, allocate %p.\n", reader, stream_number, allocate);
|
||||||
|
|
||||||
|
if (FAILED(hr = IWMSyncReader2_GetAllocateForStream(reader->reader, stream_number, &allocator)))
|
||||||
|
return hr;
|
||||||
|
|
||||||
|
if ((*allocate = allocator != NULL))
|
||||||
|
IWMReaderAllocatorEx_Release(allocator);
|
||||||
|
|
||||||
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI WMReaderAdvanced_GetStatistics(IWMReaderAdvanced6 *iface, WM_READER_STATISTICS *statistics)
|
static HRESULT WINAPI WMReaderAdvanced_GetStatistics(IWMReaderAdvanced6 *iface, WM_READER_STATISTICS *statistics)
|
||||||
|
|
|
@ -2514,17 +2514,15 @@ static void test_async_reader_allocate(IWMReader *reader,
|
||||||
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||||
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 0, &allocate);
|
||||||
todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(!allocate, "Got allocate %d.\n", allocate);
|
||||||
ok(!allocate, "Got allocate %d.\n", allocate);
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(!allocate, "Got allocate %d.\n", allocate);
|
||||||
ok(!allocate, "Got allocate %d.\n", allocate);
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 3, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 3, &allocate);
|
||||||
todo_wine ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
|
||||||
|
|
||||||
hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, TRUE);
|
hr = IWMReaderAdvanced2_SetAllocateForOutput(advanced, 0, TRUE);
|
||||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
|
@ -2541,13 +2539,11 @@ static void test_async_reader_allocate(IWMReader *reader,
|
||||||
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
||||||
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(!allocate, "Got allocate %d.\n", allocate);
|
||||||
ok(!allocate, "Got allocate %d.\n", allocate);
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(!allocate, "Got allocate %d.\n", allocate);
|
||||||
ok(!allocate, "Got allocate %d.\n", allocate);
|
|
||||||
|
|
||||||
run_async_reader(reader, advanced, callback);
|
run_async_reader(reader, advanced, callback);
|
||||||
|
|
||||||
|
@ -2575,13 +2571,11 @@ static void test_async_reader_allocate(IWMReader *reader,
|
||||||
ok(!allocate, "Got allocate %d.\n", allocate);
|
ok(!allocate, "Got allocate %d.\n", allocate);
|
||||||
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 1, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
||||||
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
|
||||||
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
hr = IWMReaderAdvanced2_GetAllocateForStream(advanced, 2, &allocate);
|
||||||
todo_wine ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||||
if (hr == S_OK)
|
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
||||||
ok(allocate == TRUE, "Got allocate %d.\n", allocate);
|
|
||||||
|
|
||||||
run_async_reader(reader, advanced, callback);
|
run_async_reader(reader, advanced, callback);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue