Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/winegstreamer/mfplat.c | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index b7aef27645..ffef9d4c08 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -785,6 +785,54 @@ GstCaps *caps_from_media_type(IMFMediaType *type) output = gst_caps_new_empty_simple("video/x-raw"); gst_caps_set_simple(output, "format", G_TYPE_STRING, fourcc_str(subtype.Data1), NULL); } + else if (IsEqualGUID(&subtype, &MFVideoFormat_H264)) + { + enum eAVEncH264VProfile h264_profile; + enum eAVEncH264VLevel h264_level; + output = gst_caps_new_empty_simple("video/x-h264"); + gst_caps_set_simple(output, "stream-format", G_TYPE_STRING, "byte-stream", NULL); + gst_caps_set_simple(output, "alignment", G_TYPE_STRING, "au", NULL); + + if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_MPEG2_PROFILE, &h264_profile))) + { + const char *profile = NULL; + switch (h264_profile) + { + case eAVEncH264VProfile_Main: profile = "main"; break; + case eAVEncH264VProfile_High: profile = "high"; break; + case eAVEncH264VProfile_444: profile = "high-4:4:4"; break; + default: ERR("Unknown profile %u\n", h264_profile); + } + if (profile) + gst_caps_set_simple(output, "profile", G_TYPE_STRING, profile, NULL); + } + if (SUCCEEDED(IMFMediaType_GetUINT32(type, &MF_MT_MPEG2_LEVEL, &h264_level))) + { + const char *level = NULL; + switch (h264_level) + { + case eAVEncH264VLevel1: level = "1"; break; + case eAVEncH264VLevel1_1: level = "1.1"; break; + case eAVEncH264VLevel1_2: level = "1.2"; break; + case eAVEncH264VLevel1_3: level = "1.3"; break; + case eAVEncH264VLevel2: level = "2"; break; + case eAVEncH264VLevel2_1: level = "2.1"; break; + case eAVEncH264VLevel2_2: level = "2.2"; break; + case eAVEncH264VLevel3: level = "3"; break; + case eAVEncH264VLevel3_1: level = "3.1"; break; + case eAVEncH264VLevel3_2: level = "3.2"; break; + case eAVEncH264VLevel4: level = "4"; break; + case eAVEncH264VLevel4_1: level = "4.1"; break; + case eAVEncH264VLevel4_2: level = "4.2"; break; + case eAVEncH264VLevel5: level = "5"; break; + case eAVEncH264VLevel5_1: level = "5.1"; break; + case eAVEncH264VLevel5_2: level = "5.2"; break; + default: ERR("Unknown level %u\n", h264_level); + } + if (level) + gst_caps_set_simple(output, "level", G_TYPE_STRING, level, NULL); + } + } else { ERR("Unrecognized subtype %s\n", debugstr_guid(&subtype)); return NULL;