amstream: Implement IDirectDrawStreamSample::GetMediaStream().

Signed-off-by: Gijs Vermeulen <gijsvrm@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gijs Vermeulen 2020-06-23 11:18:02 -05:00 committed by Alexandre Julliard
parent 1bdfa9ca79
commit 69c69143be
2 changed files with 14 additions and 6 deletions

View File

@ -1023,9 +1023,17 @@ static ULONG WINAPI ddraw_sample_Release(IDirectDrawStreamSample *iface)
/*** IStreamSample methods ***/
static HRESULT WINAPI ddraw_sample_GetMediaStream(IDirectDrawStreamSample *iface, IMediaStream **media_stream)
{
FIXME("(%p)->(%p): stub\n", iface, media_stream);
struct ddraw_sample *sample = impl_from_IDirectDrawStreamSample(iface);
return E_NOTIMPL;
TRACE("sample %p, media_stream %p.\n", sample, media_stream);
if (!media_stream)
return E_POINTER;
IAMMediaStream_AddRef(&sample->parent->IAMMediaStream_iface);
*media_stream = (IMediaStream *)&sample->parent->IAMMediaStream_iface;
return S_OK;
}
static HRESULT WINAPI ddraw_sample_GetSampleTimes(IDirectDrawStreamSample *iface, STREAM_TIME *start_time,

View File

@ -2050,13 +2050,13 @@ static void test_IDirectDrawStreamSample(void)
if (0)
{
hr = IDirectDrawStreamSample_GetMediaStream(sample, NULL);
ok(hr == E_POINTER, "got 0x%08x\n", hr);
ok(hr == E_POINTER, "Got hr %#x.\n", hr);
}
hr = IDirectDrawStreamSample_GetMediaStream(sample, &stream2);
todo_wine ok(hr == S_OK, "got 0x%08x\n", hr);
todo_wine ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2);
if (hr == S_OK) IMediaStream_Release(stream2);
ok(hr == S_OK, "Got hr %#x.\n", hr);
ok(stream2 == stream, "Expected stream %p, got %p.\n", stream, stream2);
IMediaStream_Release(stream2);
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface7, (void **)&surface7);
ok(hr == S_OK, "got 0x%08x\n", hr);