Commit 2803a220 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

winegstreamer: Separate a mf_video_format_to_wg() helper.

parent 98c266c0
......@@ -667,11 +667,23 @@ static void mf_media_type_to_wg_format_audio_mpeg4(IMFMediaType *type, struct wg
memcpy(format->u.audio_mpeg4.codec_data, user_data->pbAudioSpecificConfig, codec_data_size);
}
static enum wg_video_format mf_video_format_to_wg(const GUID *subtype)
{
unsigned int i;
for (i = 0; i < ARRAY_SIZE(video_formats); ++i)
{
if (IsEqualGUID(subtype, video_formats[i].subtype))
return video_formats[i].format;
}
FIXME("Unrecognized video subtype %s.\n", debugstr_guid(subtype));
return WG_VIDEO_FORMAT_UNKNOWN;
}
static void mf_media_type_to_wg_format_video(IMFMediaType *type, const GUID *subtype, struct wg_format *format)
{
UINT64 frame_rate, frame_size;
MFVideoArea aperture;
unsigned int i;
UINT32 size;
if (FAILED(IMFMediaType_GetUINT64(type, &MF_MT_FRAME_SIZE, &frame_size)))
......@@ -701,15 +713,7 @@ static void mf_media_type_to_wg_format_video(IMFMediaType *type, const GUID *sub
format->u.video.fps_d = (UINT32)frame_rate;
}
for (i = 0; i < ARRAY_SIZE(video_formats); ++i)
{
if (IsEqualGUID(subtype, video_formats[i].subtype))
{
format->u.video.format = video_formats[i].format;
return;
}
}
FIXME("Unrecognized video subtype %s.\n", debugstr_guid(subtype));
format->u.video.format = mf_video_format_to_wg(subtype);
}
static void mf_media_type_to_wg_format_audio_wma(IMFMediaType *type, const GUID *subtype, struct wg_format *format)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment