amstream: Implement IAMMultiMediaStreamImpl_AddMediaStream + add tests.
This commit is contained in:
parent
aae32fd4fd
commit
6db90e0e9e
|
@ -310,10 +310,19 @@ static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilterGraph(IAMMultiMediaStream
|
|||
static HRESULT WINAPI IAMMultiMediaStreamImpl_GetFilter(IAMMultiMediaStream* iface, IMediaStreamFilter** ppFilter)
|
||||
{
|
||||
IAMMultiMediaStreamImpl *This = impl_from_IAMMultiMediaStream(iface);
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
FIXME("(%p/%p)->(%p) stub!\n", This, iface, ppFilter);
|
||||
TRACE("(%p/%p)->(%p)\n", This, iface, ppFilter);
|
||||
|
||||
return E_NOTIMPL;
|
||||
if (!ppFilter)
|
||||
return E_POINTER;
|
||||
|
||||
*ppFilter = NULL;
|
||||
|
||||
if (This->media_stream_filter)
|
||||
hr = IBaseFilter_QueryInterface(This->media_stream_filter, &IID_IMediaStreamFilter, (LPVOID*)ppFilter);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI IAMMultiMediaStreamImpl_AddMediaStream(IAMMultiMediaStream* iface, IUnknown* pStreamObject, const MSPID* PurposeId,
|
||||
|
|
|
@ -172,6 +172,7 @@ static void test_media_streams(void)
|
|||
IMediaStream *dummy_stream;
|
||||
IDirectDrawMediaStream *ddraw_stream = NULL;
|
||||
IDirectDrawStreamSample *ddraw_sample = NULL;
|
||||
IMediaStreamFilter* media_stream_filter = NULL;
|
||||
|
||||
if (!create_ammultimediastream())
|
||||
return;
|
||||
|
@ -184,6 +185,12 @@ static void test_media_streams(void)
|
|||
hr = IAMMultiMediaStream_Initialize(pams, STREAMTYPE_READ, 0, NULL);
|
||||
ok(hr == S_OK, "IAMMultiMediaStream_Initialize returned: %x\n", hr);
|
||||
|
||||
/* Retreive media stream filter */
|
||||
hr = IAMMultiMediaStream_GetFilter(pams, NULL);
|
||||
ok(hr == E_POINTER, "IAMMultiMediaStream_GetFilter returned: %x\n", hr);
|
||||
hr = IAMMultiMediaStream_GetFilter(pams, &media_stream_filter);
|
||||
ok(hr == S_OK, "IAMMultiMediaStream_GetFilter returned: %x\n", hr);
|
||||
|
||||
/* Verify there is no video media stream */
|
||||
hr = IAMMultiMediaStream_GetMediaStream(pams, &MSPID_PrimaryVideo, &video_stream);
|
||||
ok(hr == MS_E_NOSTREAM, "IAMMultiMediaStream_GetMediaStream returned: %x\n", hr);
|
||||
|
@ -246,6 +253,8 @@ static void test_media_streams(void)
|
|||
IMediaStream_Release(video_stream);
|
||||
if (audio_stream)
|
||||
IMediaStream_Release(audio_stream);
|
||||
if (media_stream_filter)
|
||||
IMediaStreamFilter_Release(media_stream_filter);
|
||||
|
||||
release_directdraw();
|
||||
release_ammultimediastream();
|
||||
|
|
Loading…
Reference in New Issue