mp3dmod: Implement IMediaObject::GetOutputSizeInfo().
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e89ab44068
commit
6d55954b46
|
@ -325,9 +325,16 @@ static HRESULT WINAPI MediaObject_GetInputSizeInfo(IMediaObject *iface,
|
|||
|
||||
static HRESULT WINAPI MediaObject_GetOutputSizeInfo(IMediaObject *iface, DWORD index, DWORD *size, DWORD *alignment)
|
||||
{
|
||||
FIXME("(%p)->(%d, %p, %p) stub!\n", iface, index, size, alignment);
|
||||
struct mp3_decoder *dmo = impl_from_IMediaObject(iface);
|
||||
|
||||
return E_NOTIMPL;
|
||||
TRACE("iface %p, index %u, size %p, alignment %p.\n", iface, index, size, alignment);
|
||||
|
||||
if (!dmo->intype_set || !dmo->outtype_set)
|
||||
return DMO_E_TYPE_NOT_SET;
|
||||
|
||||
*size = 2 * 1152 * ((WAVEFORMATEX *)dmo->outtype.pbFormat)->wBitsPerSample / 8;
|
||||
*alignment = 1;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI MediaObject_GetInputMaxLatency(IMediaObject *iface, DWORD index, REFERENCE_TIME *latency)
|
||||
|
|
|
@ -342,12 +342,16 @@ static void test_stream_info(void)
|
|||
|
||||
hr = IMediaObject_GetInputSizeInfo(dmo, 0, &size, &lookahead, &alignment);
|
||||
ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#x.\n", hr);
|
||||
hr = IMediaObject_GetOutputSizeInfo(dmo, 0, &size, &alignment);
|
||||
ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IMediaObject_SetInputType(dmo, 0, &input_mt, 0);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IMediaObject_GetInputSizeInfo(dmo, 0, &size, &lookahead, &alignment);
|
||||
ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#x.\n", hr);
|
||||
hr = IMediaObject_GetOutputSizeInfo(dmo, 0, &size, &alignment);
|
||||
ok(hr == DMO_E_TYPE_NOT_SET, "Got hr %#x.\n", hr);
|
||||
|
||||
hr = IMediaObject_SetOutputType(dmo, 0, &output_mt, 0);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
|
@ -359,6 +363,12 @@ static void test_stream_info(void)
|
|||
ok(lookahead == 0xdeadbeef, "Got lookahead %u.\n", lookahead);
|
||||
ok(alignment == 1, "Got alignment %u.\n", alignment);
|
||||
|
||||
size = alignment = 0xdeadbeef;
|
||||
hr = IMediaObject_GetOutputSizeInfo(dmo, 0, &size, &alignment);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(size == 1152 * 4, "Got size %u.\n", size);
|
||||
ok(alignment == 1, "Got alignment %u.\n", alignment);
|
||||
|
||||
IMediaObject_Release(dmo);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue