[PATCH 2/4] winegstreamer: Add IWMMediaProps to the stream config object.

Zebediah Figura zfigura at codeweavers.com
Thu Nov 11 23:43:22 CST 2021


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/winegstreamer/wm_reader.c | 55 ++++++++++++++++++++++++++++++++++
 dlls/wmvcore/tests/wmvcore.c   | 15 ++++++++++
 2 files changed, 70 insertions(+)

diff --git a/dlls/winegstreamer/wm_reader.c b/dlls/winegstreamer/wm_reader.c
index deef2031c96..6b5d9629389 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -293,6 +293,7 @@ static const INSSBufferVtbl buffer_vtbl =
 struct stream_config
 {
     IWMStreamConfig IWMStreamConfig_iface;
+    IWMMediaProps IWMMediaProps_iface;
     LONG refcount;
 
     const struct wm_stream *stream;
@@ -311,6 +312,8 @@ static HRESULT WINAPI stream_config_QueryInterface(IWMStreamConfig *iface, REFII
 
     if (IsEqualGUID(iid, &IID_IUnknown) || IsEqualGUID(iid, &IID_IWMStreamConfig))
         *out = &config->IWMStreamConfig_iface;
+    else if (IsEqualGUID(iid, &IID_IWMMediaProps))
+        *out = &config->IWMMediaProps_iface;
     else
     {
         *out = NULL;
@@ -454,6 +457,57 @@ static const IWMStreamConfigVtbl stream_config_vtbl =
     stream_config_SetBufferWindow,
 };
 
+static struct stream_config *impl_from_IWMMediaProps(IWMMediaProps *iface)
+{
+    return CONTAINING_RECORD(iface, struct stream_config, IWMMediaProps_iface);
+}
+
+static HRESULT WINAPI stream_props_QueryInterface(IWMMediaProps *iface, REFIID iid, void **out)
+{
+    struct stream_config *config = impl_from_IWMMediaProps(iface);
+    return IWMStreamConfig_QueryInterface(&config->IWMStreamConfig_iface, iid, out);
+}
+
+static ULONG WINAPI stream_props_AddRef(IWMMediaProps *iface)
+{
+    struct stream_config *config = impl_from_IWMMediaProps(iface);
+    return IWMStreamConfig_AddRef(&config->IWMStreamConfig_iface);
+}
+
+static ULONG WINAPI stream_props_Release(IWMMediaProps *iface)
+{
+    struct stream_config *config = impl_from_IWMMediaProps(iface);
+    return IWMStreamConfig_Release(&config->IWMStreamConfig_iface);
+}
+
+static HRESULT WINAPI stream_props_GetType(IWMMediaProps *iface, GUID *major_type)
+{
+    FIXME("iface %p, major_type %p, stub!\n", iface, major_type);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI stream_props_GetMediaType(IWMMediaProps *iface, WM_MEDIA_TYPE *mt, DWORD *size)
+{
+    FIXME("iface %p, mt %p, size %p, stub!\n", iface, mt, size);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI stream_props_SetMediaType(IWMMediaProps *iface, WM_MEDIA_TYPE *mt)
+{
+    FIXME("iface %p, mt %p, stub!\n", iface, mt);
+    return E_NOTIMPL;
+}
+
+static const IWMMediaPropsVtbl stream_props_vtbl =
+{
+    stream_props_QueryInterface,
+    stream_props_AddRef,
+    stream_props_Release,
+    stream_props_GetType,
+    stream_props_GetMediaType,
+    stream_props_SetMediaType,
+};
+
 static DWORD CALLBACK read_thread(void *arg)
 {
     struct wm_reader *reader = arg;
@@ -688,6 +742,7 @@ static HRESULT WINAPI profile_GetStream(IWMProfile3 *iface, DWORD index, IWMStre
     }
 
     object->IWMStreamConfig_iface.lpVtbl = &stream_config_vtbl;
+    object->IWMMediaProps_iface.lpVtbl = &stream_props_vtbl;
     object->refcount = 1;
     object->stream = &reader->streams[index];
     IWMProfile3_AddRef(&reader->IWMProfile3_iface);
diff --git a/dlls/wmvcore/tests/wmvcore.c b/dlls/wmvcore/tests/wmvcore.c
index c979a06fdb0..d6bd331ea91 100644
--- a/dlls/wmvcore/tests/wmvcore.c
+++ b/dlls/wmvcore/tests/wmvcore.c
@@ -1125,6 +1125,17 @@ static void check_audio_type(const WM_MEDIA_TYPE *mt)
     ok(wave_format->wFormatTag == WAVE_FORMAT_PCM, "Got tag %#x.\n", wave_format->wFormatTag);
 }
 
+static void test_stream_media_props(IWMStreamConfig *config)
+{
+    IWMMediaProps *props;
+    HRESULT hr;
+
+    hr = IWMStreamConfig_QueryInterface(config, &IID_IWMMediaProps, (void **)&props);
+    ok(hr == S_OK, "Got hr %#x.\n", hr);
+
+    IWMMediaProps_Release(props);
+}
+
 static void test_sync_reader_types(void)
 {
     char mt_buffer[2000], mt2_buffer[2000];
@@ -1177,6 +1188,8 @@ static void test_sync_reader_types(void)
         else
             ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype));
 
+        test_stream_media_props(config);
+
         ref = IWMStreamConfig_Release(config);
         ok(!ref, "Got outstanding refcount %d.\n", ref);
 
@@ -2267,6 +2280,8 @@ static void test_async_reader_types(void)
         else
             ok(IsEqualGUID(&majortype, &MEDIATYPE_Audio), "Got major type %s.\n", debugstr_guid(&majortype));
 
+        test_stream_media_props(config);
+
         ref = IWMStreamConfig_Release(config);
         ok(!ref, "Got outstanding refcount %d.\n", ref);
 
-- 
2.33.0




More information about the wine-devel mailing list