Commit 5d836622 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

evr/mixer: Set aperture attributes for output type candidates.

parent e91b05bb
...@@ -664,6 +664,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const ...@@ -664,6 +664,7 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
unsigned int i, j, format_count, count; unsigned int i, j, format_count, count;
struct rt_format *rt_formats = NULL, *ptr; struct rt_format *rt_formats = NULL, *ptr;
HRESULT hr = MF_E_INVALIDMEDIATYPE; HRESULT hr = MF_E_INVALIDMEDIATYPE;
MFVideoArea aperture;
D3DFORMAT *formats; D3DFORMAT *formats;
GUID subtype; GUID subtype;
...@@ -691,9 +692,16 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const ...@@ -691,9 +692,16 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
if (count && !(flags & MFT_SET_TYPE_TEST_ONLY)) if (count && !(flags & MFT_SET_TYPE_TEST_ONLY))
{ {
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype)); if (!(mixer->output.rt_formats = calloc(count, sizeof(*mixer->output.rt_formats))))
if ((mixer->output.rt_formats = calloc(count, sizeof(*mixer->output.rt_formats))))
{ {
free(rt_formats);
return E_OUTOFMEMORY;
}
memcpy(&subtype, &MFVideoFormat_Base, sizeof(subtype));
memset(&aperture, 0, sizeof(aperture));
aperture.Area.cx = video_desc->SampleWidth;
aperture.Area.cy = video_desc->SampleHeight;
for (i = 0; i < count; ++i) for (i = 0; i < count; ++i)
{ {
IMFMediaType *rt_media_type; IMFMediaType *rt_media_type;
...@@ -704,17 +712,13 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const ...@@ -704,17 +712,13 @@ static HRESULT video_mixer_collect_output_types(struct video_mixer *mixer, const
MFCreateMediaType(&rt_media_type); MFCreateMediaType(&rt_media_type);
IMFMediaType_CopyAllItems(media_type, (IMFAttributes *)rt_media_type); IMFMediaType_CopyAllItems(media_type, (IMFAttributes *)rt_media_type);
IMFMediaType_SetGUID(rt_media_type, &MF_MT_SUBTYPE, &subtype); IMFMediaType_SetGUID(rt_media_type, &MF_MT_SUBTYPE, &subtype);
IMFMediaType_SetBlob(rt_media_type, &MF_MT_GEOMETRIC_APERTURE, (const UINT8 *)&aperture, sizeof(aperture));
IMFMediaType_SetBlob(rt_media_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (const UINT8 *)&aperture, sizeof(aperture));
mixer->output.rt_formats[i].media_type = rt_media_type; mixer->output.rt_formats[i].media_type = rt_media_type;
} }
mixer->output.rt_formats_count = count; mixer->output.rt_formats_count = count;
} }
else
{
hr = E_OUTOFMEMORY;
count = 0;
}
}
free(rt_formats); free(rt_formats);
......
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