Zebediah Figura : winegstreamer: Add IWMMediaProps to the stream config object.

Alexandre Julliard julliard at winehq.org
Fri Nov 12 16:16:03 CST 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Thu Nov 11 23:43:22 2021 -0600

winegstreamer: Add IWMMediaProps to the stream config object.

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

---

 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 bb77ecc5ff3..afebf2a3617 100644
--- a/dlls/winegstreamer/wm_reader.c
+++ b/dlls/winegstreamer/wm_reader.c
@@ -292,6 +292,7 @@ static const INSSBufferVtbl buffer_vtbl =
 struct stream_config
 {
     IWMStreamConfig IWMStreamConfig_iface;
+    IWMMediaProps IWMMediaProps_iface;
     LONG refcount;
 
     const struct wm_stream *stream;
@@ -310,6 +311,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;
@@ -453,6 +456,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;
@@ -687,6 +741,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);
 




More information about the wine-cvs mailing list