Anton Baskanov : amstream: Implement GetMediaType for AMDirectDrawStream based on code from mediastreamfilter.c.

Alexandre Julliard julliard at winehq.org
Thu Mar 1 13:34:45 CST 2018


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

Author: Anton Baskanov <baskanov at gmail.com>
Date:   Fri Feb 16 23:43:35 2018 +0700

amstream: Implement GetMediaType for AMDirectDrawStream based on code from mediastreamfilter.c.

Signed-off-by: Anton Baskanov <baskanov at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/amstream/mediastream.c | 36 ++++++++++++++++++++++++++++++++++--
 1 file changed, 34 insertions(+), 2 deletions(-)

diff --git a/dlls/amstream/mediastream.c b/dlls/amstream/mediastream.c
index f8ce58b..d6f5eaf 100644
--- a/dlls/amstream/mediastream.c
+++ b/dlls/amstream/mediastream.c
@@ -525,9 +525,41 @@ static HRESULT WINAPI DirectDrawMediaStreamInputPin_GetMediaType(BasePin *base,
 {
     DirectDrawMediaStreamInputPin *This = impl_from_DirectDrawMediaStreamInputPin_IPin(&base->IPin_iface);
 
-    FIXME("(%p)->(%d,%p) stub!\n", This, index, media_type);
+    TRACE("(%p)->(%d,%p)\n", This, index, media_type);
 
-    return E_NOTIMPL;
+    /* FIXME: Reset structure as we only fill majortype and minortype for now */
+    ZeroMemory(media_type, sizeof(*media_type));
+
+    media_type->majortype = MEDIATYPE_Video;
+
+    switch (index)
+    {
+        case 0:
+            media_type->subtype = MEDIASUBTYPE_RGB1;
+            break;
+        case 1:
+            media_type->subtype = MEDIASUBTYPE_RGB4;
+            break;
+        case 2:
+            media_type->subtype = MEDIASUBTYPE_RGB8;
+            break;
+        case 3:
+            media_type->subtype = MEDIASUBTYPE_RGB565;
+            break;
+        case 4:
+            media_type->subtype = MEDIASUBTYPE_RGB555;
+            break;
+        case 5:
+            media_type->subtype = MEDIASUBTYPE_RGB24;
+            break;
+        case 6:
+            media_type->subtype = MEDIASUBTYPE_RGB32;
+            break;
+        default:
+            return S_FALSE;
+    }
+
+    return S_OK;
 }
 
 static HRESULT WINAPI DirectDrawMediaStreamInputPin_Receive(BaseInputPin *base, IMediaSample *sample)




More information about the wine-cvs mailing list