Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/winegstreamer/mfplat.c | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 2ac0f7fd13..a56ec1d6e6 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -552,6 +552,48 @@ IMFMediaType* media_type_from_caps(GstCaps *caps) gst_structure_remove_field(structure, "codec_data"); } } + else if (!(strcmp(mime_type, "video/x-wmv"))) + { + gint wmv_version; + const char *format; + const GValue *codec_data; + + if (gst_structure_get_int(info, "wmvversion", &wmv_version)) + { + switch (wmv_version) + { + case 1: + IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_WMV1); + break; + case 2: + IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_WMV2); + break; + case 3: + IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_WMV3); + break; + default: + ERR("Unrecognized wmvversion %d\n", wmv_version); + } + } + + if ((format = gst_structure_get_string(info, "format"))) + { + if (!(strcmp(format, "WVC1"))) + IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFVideoFormat_WVC1); + } + + if ((codec_data = gst_structure_get_value(info, "codec_data"))) + { + GstBuffer *codec_data_buffer = gst_value_get_buffer(codec_data); + if (codec_data_buffer) + { + gsize codec_data_size = gst_buffer_get_size(codec_data_buffer); + gpointer codec_data_raw = heap_alloc(codec_data_size); + gst_buffer_extract(codec_data_buffer, 0, codec_data_raw, codec_data_size); + IMFMediaType_SetBlob(media_type, &MF_MT_USER_DATA, codec_data_raw, codec_data_size); + } + } + } else ERR("Unrecognized video format %s\n", mime_type); }