[PATCH 3/4] mp3dmod: Implement IMediaObject::GetOutputSizeInfo().
Zebediah Figura
z.figura12 at gmail.com
Mon Feb 24 23:36:14 CST 2020
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
dlls/mp3dmod/mp3dmod.c | 11 +++++++++--
dlls/mp3dmod/tests/mp3dmod.c | 10 ++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/dlls/mp3dmod/mp3dmod.c b/dlls/mp3dmod/mp3dmod.c
index 5e232f0443f..6a904716bc1 100644
--- a/dlls/mp3dmod/mp3dmod.c
+++ b/dlls/mp3dmod/mp3dmod.c
@@ -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)
diff --git a/dlls/mp3dmod/tests/mp3dmod.c b/dlls/mp3dmod/tests/mp3dmod.c
index 78471c42bcb..285b76023b0 100644
--- a/dlls/mp3dmod/tests/mp3dmod.c
+++ b/dlls/mp3dmod/tests/mp3dmod.c
@@ -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);
}
--
2.25.0
More information about the wine-devel
mailing list