Commit c908181e authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

mfreadwrite/tests: Avoid using MFCreateMediaBufferFromMediaType.

It's not available on Win7.
parent 7b47833b
...@@ -2604,28 +2604,25 @@ static HRESULT WINAPI test_decoder_ProcessOutput(IMFTransform *iface, DWORD flag ...@@ -2604,28 +2604,25 @@ static HRESULT WINAPI test_decoder_ProcessOutput(IMFTransform *iface, DWORD flag
hr = MFCreateSample(&data->pSample); hr = MFCreateSample(&data->pSample);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMediaBufferFromMediaType(decoder->output_type, 0, 0, 0, &buffer); hr = MFCreateMemoryBuffer(96 * 96 * 4, &buffer);
todo_wine ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr != S_OK)
{
hr = MFCreateMemoryBuffer(96 * 96 * 4, &buffer);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
}
hr = IMFSample_AddBuffer(data->pSample, buffer); hr = IMFSample_AddBuffer(data->pSample, buffer);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaBuffer_Release(buffer); IMFMediaBuffer_Release(buffer);
} }
else
{
ok(!!data->pSample, "Missing sample\n");
ok(!!data->pSample, "Missing sample\n"); hr = IMFSample_GetBufferByIndex(data->pSample, 0, &buffer);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFSample_GetBufferByIndex(data->pSample, 0, &buffer); todo_wine check_interface(buffer, &IID_IMF2DBuffer2, TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); todo_wine check_interface(buffer, &IID_IMFGetService, TRUE);
todo_wine check_interface(buffer, &IID_IMF2DBuffer2, TRUE); check_interface(buffer, &IID_IMFDXGIBuffer, FALSE);
todo_wine check_interface(buffer, &IID_IMFGetService, TRUE); hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&unknown);
check_interface(buffer, &IID_IMFDXGIBuffer, FALSE); todo_wine ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
hr = MFGetService((IUnknown *)buffer, &MR_BUFFER_SERVICE, &IID_IDirect3DSurface9, (void **)&unknown); IMFMediaBuffer_Release(buffer);
todo_wine ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr); }
IMFMediaBuffer_Release(buffer);
if (decoder->next_output == MF_E_TRANSFORM_STREAM_CHANGE) if (decoder->next_output == MF_E_TRANSFORM_STREAM_CHANGE)
{ {
...@@ -2817,6 +2814,16 @@ static void test_source_reader_transform_stream_change(void) ...@@ -2817,6 +2814,16 @@ static void test_source_reader_transform_stream_change(void)
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaSource_Release(source); IMFMediaSource_Release(source);
/* skip tests on Win7 which misses IMFSourceReaderEx */
hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex);
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#lx.\n", hr);
if (broken(hr == E_NOINTERFACE))
{
win_skip("missing IMFSourceReaderEx interface, skipping tests on Win7\n");
goto skip_tests;
}
IMFSourceReaderEx_Release(reader_ex);
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE); hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
...@@ -2881,6 +2888,7 @@ static void test_source_reader_transform_stream_change(void) ...@@ -2881,6 +2888,7 @@ static void test_source_reader_transform_stream_change(void)
IMFTransform_Release(test_decoder); IMFTransform_Release(test_decoder);
skip_tests:
IMFSourceReader_Release(reader); IMFSourceReader_Release(reader);
hr = MFTUnregisterLocal(&factory); hr = MFTUnregisterLocal(&factory);
...@@ -2993,6 +3001,17 @@ static void test_source_reader_transforms_d3d(void) ...@@ -2993,6 +3001,17 @@ static void test_source_reader_transforms_d3d(void)
IMFAttributes_Release(attributes); IMFAttributes_Release(attributes);
IMFMediaSource_Release(source); IMFMediaSource_Release(source);
/* skip tests on Win7 which misses IMFSourceReaderEx */
hr = IMFSourceReader_QueryInterface(reader, &IID_IMFSourceReaderEx, (void **)&reader_ex);
ok(hr == S_OK || broken(hr == E_NOINTERFACE) /* Win7 */, "Unexpected hr %#lx.\n", hr);
if (broken(hr == E_NOINTERFACE))
{
win_skip("missing IMFSourceReaderEx interface, skipping tests on Win7\n");
IMFSourceReader_Release(reader);
goto skip_tests;
}
IMFSourceReaderEx_Release(reader_ex);
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE); hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
...@@ -3152,6 +3171,7 @@ static void test_source_reader_transforms_d3d(void) ...@@ -3152,6 +3171,7 @@ static void test_source_reader_transforms_d3d(void)
test_decoder_allocate_samples = FALSE; test_decoder_allocate_samples = FALSE;
skip_tests:
hr = MFTUnregisterLocal(&factory); hr = MFTUnregisterLocal(&factory);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment