Giovanni Mascellani : winegstreamer: Expose the MF_MT_VIDEO_ROTATION attribute.

Alexandre Julliard julliard at winehq.org
Thu Jun 17 15:38:06 CDT 2021


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

Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date:   Thu Jun 17 13:30:36 2021 +0200

winegstreamer: Expose the MF_MT_VIDEO_ROTATION attribute.

The stricter checks imposed by commit
ac39b313b618ab8d1613302c3604ba505afff0df, while being valid in general,
require that media source attaches to media types the attributes that
application can request.

This patch exposes the MF_MT_VIDEO_ROTATION attribute, which is for
example requested by Legend of Keepers.

Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfplat/tests/mfplat.c  | 7 +++++++
 dlls/winegstreamer/mfplat.c | 1 +
 include/mfapi.h             | 8 ++++++++
 3 files changed, 16 insertions(+)

diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c
index ff24c2c0ec0..f1c041b7eb4 100644
--- a/dlls/mfplat/tests/mfplat.c
+++ b/dlls/mfplat/tests/mfplat.c
@@ -664,6 +664,7 @@ static void test_source_resolver(void)
     HRESULT hr;
     GUID guid;
     float rate;
+    UINT32 rotation;
 
     if (!pMFCreateSourceResolver)
     {
@@ -849,6 +850,12 @@ static void test_source_resolver(void)
     ok(hr == S_OK, "Failed to get media sub type, hr %#x.\n", hr);
 todo_wine
     ok(IsEqualGUID(&guid, &MFVideoFormat_M4S2), "Unexpected sub type %s.\n", debugstr_guid(&guid));
+
+    hr = IMFMediaType_GetUINT32(media_type, &MF_MT_VIDEO_ROTATION, &rotation);
+    ok(hr == S_OK || broken(hr == MF_E_ATTRIBUTENOTFOUND) /* Win7 */, "Failed to get rotation, hr %#x.\n", hr);
+    if (hr == S_OK)
+        ok(rotation == MFVideoRotationFormat_0, "Got wrong rotation %u.\n", rotation);
+
     IMFMediaType_Release(media_type);
 
     hr = IMFPresentationDescriptor_SelectStream(descriptor, 0);
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c
index bb632c2cc2c..dfa448afcfe 100644
--- a/dlls/winegstreamer/mfplat.c
+++ b/dlls/winegstreamer/mfplat.c
@@ -596,6 +596,7 @@ static IMFMediaType *mf_media_type_from_wg_format_video(const struct wg_format *
                     make_uint64(format->u.video.fps_n, format->u.video.fps_d));
             IMFMediaType_SetUINT32(type, &MF_MT_COMPRESSED, FALSE);
             IMFMediaType_SetUINT32(type, &MF_MT_ALL_SAMPLES_INDEPENDENT, TRUE);
+            IMFMediaType_SetUINT32(type, &MF_MT_VIDEO_ROTATION, MFVideoRotationFormat_0);
 
             return type;
         }
diff --git a/include/mfapi.h b/include/mfapi.h
index e4a1f6a3dc0..382210ad9e2 100644
--- a/include/mfapi.h
+++ b/include/mfapi.h
@@ -449,6 +449,14 @@ typedef enum _MFWaveFormatExConvertFlags
     MFWaveFormatExConvertFlag_ForceExtensible = 1,
 } MFWaveFormatExConvertFlags;
 
+typedef enum _MFVideoRotationFormat
+{
+    MFVideoRotationFormat_0 = 0,
+    MFVideoRotationFormat_90 = 90,
+    MFVideoRotationFormat_180 = 180,
+    MFVideoRotationFormat_270 = 270
+} MFVideoRotationFormat;
+
 enum _MFT_ENUM_FLAG
 {
     MFT_ENUM_FLAG_SYNCMFT                         = 0x00000001,




More information about the wine-cvs mailing list