Zebediah Figura : mp3dmod: Implement IMediaObject::GetOutputSizeInfo().

Alexandre Julliard julliard at winehq.org
Tue Feb 25 17:23:07 CST 2020


Module: wine
Branch: master
Commit: 6d55954b4695a023c215a7a757073b6d7012ada2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=6d55954b4695a023c215a7a757073b6d7012ada2

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon Feb 24 23:36:14 2020 -0600

mp3dmod: Implement IMediaObject::GetOutputSizeInfo().

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 5e232f0443..6a904716bc 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 78471c42bc..285b76023b 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);
 }
 




More information about the wine-cvs mailing list