mfreadwrite/tests: Build without -DWINE_NO_LONG_TYPES.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
29a9ba6e18
commit
c8c40e9734
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = mfreadwrite.dll
|
||||
IMPORTS = ole32 user32 d3d9 dxva2 mfplat mfreadwrite mfuuid
|
||||
|
||||
|
|
|
@ -210,22 +210,22 @@ static HRESULT WINAPI test_media_stream_RequestSample(IMFMediaStream *iface, IUn
|
|||
return E_NOTIMPL;
|
||||
|
||||
hr = MFCreateSample(&sample);
|
||||
ok(hr == S_OK, "Failed to create a sample, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFSample_SetSampleTime(sample, 123);
|
||||
ok(hr == S_OK, "Failed to set sample time, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
if (token)
|
||||
IMFSample_SetUnknown(sample, &MFSampleExtension_Token, token);
|
||||
|
||||
/* Reader expects buffers, empty samples are considered an error. */
|
||||
hr = MFCreateMemoryBuffer(8, &buffer);
|
||||
ok(hr == S_OK, "Failed to create a buffer, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFSample_AddBuffer(sample, buffer);
|
||||
ok(hr == S_OK, "Failed to add a buffer, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFMediaBuffer_Release(buffer);
|
||||
|
||||
hr = IMFMediaEventQueue_QueueEventParamUnk(stream->event_queue, MEMediaSample, &GUID_NULL, S_OK,
|
||||
(IUnknown *)sample);
|
||||
ok(hr == S_OK, "Failed to submit event, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFSample_Release(sample);
|
||||
|
||||
return S_OK;
|
||||
|
@ -355,23 +355,23 @@ static HRESULT WINAPI test_source_CreatePresentationDescriptor(IMFMediaSource *i
|
|||
for (i = 0; i < source->stream_count; ++i)
|
||||
{
|
||||
hr = MFCreateMediaType(&media_type);
|
||||
ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = MFCreateStreamDescriptor(i, 1, &media_type, &sds[i]);
|
||||
ok(hr == S_OK, "Failed to create stream descriptor, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFMediaType_Release(media_type);
|
||||
}
|
||||
|
||||
hr = MFCreatePresentationDescriptor(source->stream_count, sds, &source->pd);
|
||||
ok(hr == S_OK, "Failed to create presentation descriptor, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
for (i = 0; i < source->stream_count; ++i)
|
||||
IMFStreamDescriptor_Release(sds[i]);
|
||||
|
||||
|
@ -413,7 +413,7 @@ static HRESULT WINAPI test_source_Start(IMFMediaSource *iface, IMFPresentationDe
|
|||
|
||||
event_type = source->state == SOURCE_RUNNING ? MESourceSeeked : MESourceStarted;
|
||||
hr = IMFMediaEventQueue_QueueEventParamVar(source->event_queue, event_type, &GUID_NULL, S_OK, NULL);
|
||||
ok(hr == S_OK, "Failed to queue event, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
for (i = 0; i < source->stream_count; ++i)
|
||||
{
|
||||
|
@ -425,12 +425,12 @@ static HRESULT WINAPI test_source_Start(IMFMediaSource *iface, IMFPresentationDe
|
|||
event_type = source->streams[i]->is_new ? MENewStream : MEUpdatedStream;
|
||||
source->streams[i]->is_new = FALSE;
|
||||
hr = IMFMediaEventQueue_QueueEventParamVar(source->event_queue, event_type, &GUID_NULL, S_OK, &var);
|
||||
ok(hr == S_OK, "Failed to queue event, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
event_type = source->state == SOURCE_RUNNING ? MEStreamSeeked : MEStreamStarted;
|
||||
hr = IMFMediaEventQueue_QueueEventParamVar(source->streams[i]->event_queue, event_type, &GUID_NULL,
|
||||
S_OK, NULL);
|
||||
ok(hr == S_OK, "Failed to queue event, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
}
|
||||
|
||||
source->state = SOURCE_RUNNING;
|
||||
|
@ -458,7 +458,7 @@ static HRESULT WINAPI test_source_Shutdown(IMFMediaSource *iface)
|
|||
HRESULT hr;
|
||||
|
||||
hr = IMFMediaEventQueue_Shutdown(source->event_queue);
|
||||
ok(hr == S_OK, "Failed to shut down event queue, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
@ -491,7 +491,7 @@ static struct test_media_stream *create_test_stream(DWORD stream_index, IMFMedia
|
|||
stream->IMFMediaStream_iface.lpVtbl = &test_media_stream_vtbl;
|
||||
stream->refcount = 1;
|
||||
hr = MFCreateEventQueue(&stream->event_queue);
|
||||
ok(hr == S_OK, "Failed to create event queue, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
stream->source = source;
|
||||
IMFMediaSource_AddRef(stream->source);
|
||||
stream->is_new = TRUE;
|
||||
|
@ -535,13 +535,13 @@ static IMFByteStream *get_resource_stream(const char *name)
|
|||
ptr = LockResource(LoadResource(GetModuleHandleA(NULL), res));
|
||||
|
||||
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
|
||||
ok(hr == S_OK, "Failed to create memory stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IStream_Write(stream, ptr, SizeofResource(GetModuleHandleA(NULL), res), &written);
|
||||
ok(hr == S_OK, "Failed to write stream content, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = pMFCreateMFByteStreamOnStream(stream, &bytestream);
|
||||
ok(hr == S_OK, "Failed to create bytestream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IStream_Release(stream);
|
||||
|
||||
return bytestream;
|
||||
|
@ -556,11 +556,11 @@ static void test_factory(void)
|
|||
|
||||
hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, NULL, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory,
|
||||
(void **)&factory);
|
||||
ok(hr == S_OK, "Failed to create class factory, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_MFReadWriteClassFactory, (IUnknown *)factory, CLSCTX_INPROC_SERVER, &IID_IMFReadWriteClassFactory,
|
||||
(void **)&factory2);
|
||||
ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == CLASS_E_NOAGGREGATION, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFReadWriteClassFactory_Release(factory);
|
||||
|
||||
|
@ -680,64 +680,64 @@ static void test_source_reader(void)
|
|||
IMFByteStream_Release(stream);
|
||||
return;
|
||||
}
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
/* Access underlying media source object. */
|
||||
hr = IMFSourceReader_GetServiceForStream(reader, MF_SOURCE_READER_MEDIASOURCE, &GUID_NULL, &IID_IMFMediaSource,
|
||||
(void **)&source);
|
||||
ok(hr == S_OK, "Failed to get media source interface, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFMediaSource_Release(source);
|
||||
|
||||
/* Stream selection. */
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, &selected);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, 100, &selected);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
selected = FALSE;
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, &selected);
|
||||
ok(hr == S_OK, "Failed to get stream selection, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(selected, "Unexpected selection.\n");
|
||||
|
||||
selected = FALSE;
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, 0, &selected);
|
||||
ok(hr == S_OK, "Failed to get stream selection, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(selected, "Unexpected selection.\n");
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, TRUE);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 100, TRUE);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, FALSE);
|
||||
ok(hr == S_OK, "Failed to deselect a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
selected = TRUE;
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, &selected);
|
||||
ok(hr == S_OK, "Failed to get stream selection, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!selected, "Unexpected selection.\n");
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, MF_SOURCE_READER_ALL_STREAMS, TRUE);
|
||||
ok(hr == S_OK, "Failed to deselect a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
selected = FALSE;
|
||||
hr = IMFSourceReader_GetStreamSelection(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, &selected);
|
||||
ok(hr == S_OK, "Failed to get stream selection, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(selected, "Unexpected selection.\n");
|
||||
|
||||
/* Native media type. */
|
||||
hr = IMFSourceReader_GetNativeMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &mediatype);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_GetNativeMediaType(reader, 100, 0, &mediatype);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_GetNativeMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &mediatype);
|
||||
ok(hr == S_OK, "Failed to get native mediatype, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFSourceReader_GetNativeMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &mediatype2);
|
||||
ok(hr == S_OK, "Failed to get native mediatype, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(mediatype != mediatype2, "Unexpected media type instance.\n");
|
||||
IMFMediaType_Release(mediatype2);
|
||||
IMFMediaType_Release(mediatype);
|
||||
|
@ -745,56 +745,56 @@ static void test_source_reader(void)
|
|||
/* MF_SOURCE_READER_CURRENT_TYPE_INDEX is Win8+ */
|
||||
hr = IMFSourceReader_GetNativeMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM,
|
||||
MF_SOURCE_READER_CURRENT_TYPE_INDEX, &mediatype);
|
||||
ok(hr == S_OK || broken(hr == MF_E_NO_MORE_TYPES), "Failed to get native mediatype, hr %#x.\n", hr);
|
||||
ok(hr == S_OK || broken(hr == MF_E_NO_MORE_TYPES), "Unexpected hr %#lx.\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IMFMediaType_Release(mediatype);
|
||||
|
||||
/* Current media type. */
|
||||
hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, &mediatype);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_GetCurrentMediaType(reader, 100, &mediatype);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_GetCurrentMediaType(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, &mediatype);
|
||||
ok(hr == S_OK, "Failed to get current media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFMediaType_Release(mediatype);
|
||||
|
||||
hr = IMFSourceReader_GetCurrentMediaType(reader, 0, &mediatype);
|
||||
ok(hr == S_OK, "Failed to get current media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFMediaType_Release(mediatype);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
if (hr != S_OK)
|
||||
goto skip_read_sample;
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
IMFSample_Release(sample);
|
||||
|
||||
/* There is no video stream. */
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(actual_index == MF_SOURCE_READER_FIRST_VIDEO_STREAM, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == MF_SOURCE_READER_FIRST_VIDEO_STREAM, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, NULL, &stream_flags, ×tamp,
|
||||
&sample);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM, 0, NULL, NULL, ×tamp, &sample);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
/* TODO: gstreamer outputs .wav sample in increments of 4096, instead of 4410 */
|
||||
todo_wine
|
||||
todo_wine
|
||||
{
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
}
|
||||
if(!stream_flags)
|
||||
|
@ -803,82 +803,82 @@ todo_wine
|
|||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
}
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %lu\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, &stream_flags, ×tamp, NULL);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, NULL, ×tamp, &sample);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
NULL, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, &stream_flags, NULL, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, MF_SOURCE_READER_CONTROLF_DRAIN,
|
||||
&actual_index, &stream_flags, NULL, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ENDOFSTREAM, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(!sample, "Unexpected sample object.\n");
|
||||
|
||||
skip_read_sample:
|
||||
|
||||
/* Flush. */
|
||||
hr = IMFSourceReader_Flush(reader, MF_SOURCE_READER_FIRST_VIDEO_STREAM);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_Flush(reader, 100);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_Flush(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM);
|
||||
ok(hr == S_OK, "Failed to flush stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_Flush(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM);
|
||||
ok(hr == S_OK, "Failed to flush stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_Flush(reader, MF_SOURCE_READER_ALL_STREAMS);
|
||||
ok(hr == S_OK, "Failed to flush all streams, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
refcount = IMFSourceReader_Release(reader);
|
||||
ok(!refcount, "Unexpected refcount %u.\n", refcount);
|
||||
ok(!refcount, "Unexpected refcount %lu.\n", refcount);
|
||||
|
||||
/* Async mode. */
|
||||
callback = create_async_callback();
|
||||
|
||||
hr = MFCreateAttributes(&attributes, 1);
|
||||
ok(hr == S_OK, "Failed to create attributes object, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFAttributes_SetUnknown(attributes, &MF_SOURCE_READER_ASYNC_CALLBACK,
|
||||
(IUnknown *)&callback->IMFSourceReaderCallback_iface);
|
||||
ok(hr == S_OK, "Failed to set attribute value, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFSourceReaderCallback_Release(&callback->IMFSourceReaderCallback_iface);
|
||||
|
||||
refcount = get_refcount(attributes);
|
||||
hr = MFCreateSourceReaderFromByteStream(stream, attributes, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(get_refcount(attributes) > refcount, "Unexpected refcount.\n");
|
||||
IMFAttributes_Release(attributes);
|
||||
IMFSourceReader_Release(reader);
|
||||
|
@ -905,60 +905,60 @@ static void test_source_reader_from_media_source(void)
|
|||
ok(!!source, "Failed to create test source.\n");
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
/* MF_SOURCE_READER_ANY_STREAM */
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, FALSE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 1, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
pos.vt = VT_I8;
|
||||
pos.hVal.QuadPart = 0;
|
||||
hr = IMFSourceReader_SetCurrentPosition(reader, &GUID_NULL, &pos);
|
||||
ok(hr == S_OK, "Failed to seek to beginning of stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 1, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == 1, "Unexpected stream index %lu\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 2, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
for (i = 0; i < TEST_SOURCE_NUM_STREAMS + 1; ++i)
|
||||
{
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == i % TEST_SOURCE_NUM_STREAMS, "%d: Unexpected stream index %u\n", i, actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == i % TEST_SOURCE_NUM_STREAMS, "%d: Unexpected stream index %lu.\n", i, actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
}
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, FALSE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
for (i = 0; i < TEST_SOURCE_NUM_STREAMS + 1; ++i)
|
||||
{
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == i % TEST_SOURCE_NUM_STREAMS, "%d: Unexpected stream index %u\n", i, actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == i % TEST_SOURCE_NUM_STREAMS, "%d: Unexpected stream index %lu.\n", i, actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
@ -971,31 +971,31 @@ static void test_source_reader_from_media_source(void)
|
|||
ok(!!source, "Failed to create test source.\n");
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
/* MF_SOURCE_READER_ANY_STREAM with a single stream */
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
pos.vt = VT_I8;
|
||||
pos.hVal.QuadPart = 0;
|
||||
hr = IMFSourceReader_SetCurrentPosition(reader, &GUID_NULL, &pos);
|
||||
ok(hr == S_OK, "Failed to seek to beginning of stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_ANY_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
@ -1008,29 +1008,29 @@ static void test_source_reader_from_media_source(void)
|
|||
ok(!!source, "Failed to create test source.\n");
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
||||
/* Request from deselected stream. */
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 1, FALSE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
actual_index = 0;
|
||||
stream_flags = 0;
|
||||
hr = IMFSourceReader_ReadSample(reader, 1, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr);
|
||||
ok(actual_index == 1, "Unexpected stream index %u\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#lx.\n", hr);
|
||||
ok(actual_index == 1, "Unexpected stream index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 0, "Unexpected timestamp.\n");
|
||||
ok(!sample, "Expected sample object.\n");
|
||||
|
||||
|
@ -1042,41 +1042,41 @@ static void test_source_reader_from_media_source(void)
|
|||
ok(!!source, "Failed to create test source.\n");
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = MFCreateMediaType(&media_type);
|
||||
ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 16);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type);
|
||||
ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected success setting current media type, hr %#x.\n", hr);
|
||||
ok(hr == MF_E_TOPO_CODEC_NOT_FOUND, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFMediaType_Release(media_type);
|
||||
|
||||
hr = MFCreateMediaType(&media_type);
|
||||
ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
hr = IMFMediaType_SetUINT32(media_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, 32);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetCurrentMediaType(reader, 0, NULL, media_type);
|
||||
ok(hr == S_OK, "Failed to set current media type, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == S_OK, "Failed to get a sample, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected stream index %u\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#x.\n", stream_flags);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected stream index %lu\n", actual_index);
|
||||
ok(!stream_flags, "Unexpected stream flags %#lx.\n", stream_flags);
|
||||
ok(timestamp == 123, "Unexpected timestamp.\n");
|
||||
ok(!!sample, "Expected sample object.\n");
|
||||
IMFSample_Release(sample);
|
||||
|
@ -1092,40 +1092,40 @@ static void test_source_reader_from_media_source(void)
|
|||
callback = create_async_callback();
|
||||
|
||||
hr = MFCreateAttributes(&attributes, 1);
|
||||
ok(hr == S_OK, "Failed to create attributes object, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFAttributes_SetUnknown(attributes, &MF_SOURCE_READER_ASYNC_CALLBACK,
|
||||
(IUnknown *)&callback->IMFSourceReaderCallback_iface);
|
||||
ok(hr == S_OK, "Failed to set attribute value, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IMFSourceReaderCallback_Release(&callback->IMFSourceReaderCallback_iface);
|
||||
|
||||
refcount = get_refcount(attributes);
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, attributes, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(get_refcount(attributes) > refcount, "Unexpected refcount.\n");
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
/* Return values are delivered to callback only. */
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, NULL, ×tamp, &sample);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, NULL, NULL, &sample);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
/* Flush() arguments validation. */
|
||||
hr = IMFSourceReader_Flush(reader, 123);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_INVALIDSTREAMNUMBER, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, NULL, NULL, NULL, NULL);
|
||||
ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == MF_E_NOTACCEPTING, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFSourceReader_Release(reader);
|
||||
IMFMediaSource_Release(source);
|
||||
|
@ -1137,36 +1137,36 @@ static void test_source_reader_from_media_source(void)
|
|||
fail_request_sample = TRUE;
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, NULL, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_SetStreamSelection(reader, 0, TRUE);
|
||||
ok(hr == S_OK, "Failed to select a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == E_NOTIMPL, "Unexpected ReadSample result, hr %#x.\n", hr);
|
||||
ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
actual_index = ~0u;
|
||||
stream_flags = 0;
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == E_NOTIMPL, "Unexpected ReadSample result, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected index %u.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#x.\n", stream_flags);
|
||||
ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#lx.\n", stream_flags);
|
||||
|
||||
actual_index = ~0u;
|
||||
stream_flags = 0;
|
||||
hr = IMFSourceReader_ReadSample(reader, MF_SOURCE_READER_FIRST_AUDIO_STREAM, 0, &actual_index, &stream_flags,
|
||||
×tamp, &sample);
|
||||
ok(hr == E_NOTIMPL, "Unexpected ReadSample result, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected index %u.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#x.\n", stream_flags);
|
||||
ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#lx.\n", stream_flags);
|
||||
|
||||
actual_index = ~0u;
|
||||
stream_flags = 0;
|
||||
hr = IMFSourceReader_ReadSample(reader, 0, 0, &actual_index, &stream_flags, ×tamp, &sample);
|
||||
ok(hr == E_NOTIMPL, "Unexpected ReadSample result, hr %#x.\n", hr);
|
||||
ok(actual_index == 0, "Unexpected index %u.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#x.\n", stream_flags);
|
||||
ok(hr == E_NOTIMPL, "Unexpected hr %#lx.\n", hr);
|
||||
ok(!actual_index, "Unexpected index %lu.\n", actual_index);
|
||||
ok(stream_flags == MF_SOURCE_READERF_ERROR, "Unexpected flags %#lx.\n", stream_flags);
|
||||
|
||||
IMFSourceReader_Release(reader);
|
||||
IMFMediaSource_Release(source);
|
||||
|
@ -1196,22 +1196,22 @@ static void test_reader_d3d9(void)
|
|||
}
|
||||
|
||||
hr = DXVA2CreateDirect3DDeviceManager9(&token, &d3d9_manager);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IDirect3DDeviceManager9_ResetDevice(d3d9_manager, d3d9_device, token);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
source = create_test_source(3);
|
||||
ok(!!source, "Failed to create test source.\n");
|
||||
|
||||
hr = MFCreateAttributes(&attributes, 1);
|
||||
ok(hr == S_OK, "Failed to create attributes object, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IMFAttributes_SetUnknown(attributes, &MF_SOURCE_READER_D3D_MANAGER, (IUnknown *)d3d9_manager);
|
||||
ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = MFCreateSourceReaderFromMediaSource(source, attributes, &reader);
|
||||
ok(hr == S_OK, "Failed to create source reader, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
IMFAttributes_Release(attributes);
|
||||
|
||||
|
@ -1230,7 +1230,7 @@ START_TEST(mfplat)
|
|||
HRESULT hr;
|
||||
|
||||
hr = MFStartup(MF_VERSION, MFSTARTUP_FULL);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
init_functions();
|
||||
|
||||
|
@ -1240,5 +1240,5 @@ START_TEST(mfplat)
|
|||
test_reader_d3d9();
|
||||
|
||||
hr = MFShutdown();
|
||||
ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue