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@codeweavers.com --- The same attribute is also set by Windows for media sources obtained from the standard source resolver.
Currently MFVideoRotationFormat_0 is always set, because I couldn't find anyway to query this property in GStreamer. The obvious place for this metadata item would probably be GstVideoInfo, but I cannot see anything related there. Can some GStreamer wizard help?
dlls/winegstreamer/mfplat.c | 1 + include/mfapi.h | 7 +++++++ 2 files changed, 8 insertions(+)
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..788b267845e 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -449,6 +449,13 @@ typedef enum _MFWaveFormatExConvertFlags MFWaveFormatExConvertFlag_ForceExtensible = 1, } MFWaveFormatExConvertFlags;
+typedef enum _MFVideoRotationFormat { + MFVideoRotationFormat_0, + MFVideoRotationFormat_90, + MFVideoRotationFormat_180, + MFVideoRotationFormat_270 +} MFVideoRotationFormat; + enum _MFT_ENUM_FLAG { MFT_ENUM_FLAG_SYNCMFT = 0x00000001,
On 6/15/21 12:46 PM, Giovanni Mascellani wrote:
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; }
If it's common on Windows, please add a test for it, for our test.mp4.
diff --git a/include/mfapi.h b/include/mfapi.h index e4a1f6a3dc0..788b267845e 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -449,6 +449,13 @@ typedef enum _MFWaveFormatExConvertFlags MFWaveFormatExConvertFlag_ForceExtensible = 1, } MFWaveFormatExConvertFlags;
+typedef enum _MFVideoRotationFormat {
- MFVideoRotationFormat_0,
- MFVideoRotationFormat_90,
- MFVideoRotationFormat_180,
- MFVideoRotationFormat_270
+} MFVideoRotationFormat;
Definition is incorrect.
enum _MFT_ENUM_FLAG { MFT_ENUM_FLAG_SYNCMFT = 0x00000001,