Commit 0567f993 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winegstreamer: Always set aperture attributes on video decoder output types.

parent 73b6049c
...@@ -122,9 +122,9 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI ...@@ -122,9 +122,9 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI
IMFMediaType *output_type, IMFMediaType **media_type) IMFMediaType *output_type, IMFMediaType **media_type)
{ {
IMFMediaType *default_type = decoder->output_type, *stream_type = output_type ? output_type : decoder->stream_type; IMFMediaType *default_type = decoder->output_type, *stream_type = output_type ? output_type : decoder->stream_type;
MFVideoArea default_aperture = {{0}}, aperture;
IMFVideoMediaType *video_type; IMFVideoMediaType *video_type;
UINT32 value, width, height; UINT32 value, width, height;
MFVideoArea aperture;
UINT64 ratio; UINT64 ratio;
HRESULT hr; HRESULT hr;
...@@ -138,6 +138,9 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI ...@@ -138,6 +138,9 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI
width = ratio >> 32; width = ratio >> 32;
height = ratio; height = ratio;
default_aperture.Area.cx = width;
default_aperture.Area.cy = height;
if (FAILED(IMFMediaType_GetUINT64(stream_type, &MF_MT_FRAME_RATE, &ratio))) if (FAILED(IMFMediaType_GetUINT64(stream_type, &MF_MT_FRAME_RATE, &ratio)))
ratio = (UINT64)30000 << 32 | 1001; ratio = (UINT64)30000 << 32 | 1001;
if (FAILED(hr = IMFVideoMediaType_SetUINT64(video_type, &MF_MT_FRAME_RATE, ratio))) if (FAILED(hr = IMFVideoMediaType_SetUINT64(video_type, &MF_MT_FRAME_RATE, ratio)))
...@@ -178,29 +181,20 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI ...@@ -178,29 +181,20 @@ static HRESULT create_output_media_type(struct video_decoder *decoder, const GUI
if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_FIXED_SIZE_SAMPLES, value))) if (FAILED(hr = IMFVideoMediaType_SetUINT32(video_type, &MF_MT_FIXED_SIZE_SAMPLES, value)))
goto done; goto done;
if (SUCCEEDED(IMFMediaType_GetBlob(stream_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, if (FAILED(IMFMediaType_GetBlob(stream_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (BYTE *)&aperture, sizeof(aperture), &value)))
(BYTE *)&aperture, sizeof(aperture), &value))) aperture = default_aperture;
{ if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, (BYTE *)&aperture, sizeof(aperture))))
if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_MINIMUM_DISPLAY_APERTURE, goto done;
(BYTE *)&aperture, sizeof(aperture))))
goto done;
}
if (SUCCEEDED(IMFMediaType_GetBlob(stream_type, &MF_MT_GEOMETRIC_APERTURE, if (FAILED(IMFMediaType_GetBlob(stream_type, &MF_MT_GEOMETRIC_APERTURE, (BYTE *)&aperture, sizeof(aperture), &value)))
(BYTE *)&aperture, sizeof(aperture), &value))) aperture = default_aperture;
{ if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_GEOMETRIC_APERTURE, (BYTE *)&aperture, sizeof(aperture))))
if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_GEOMETRIC_APERTURE, goto done;
(BYTE *)&aperture, sizeof(aperture))))
goto done;
}
if (SUCCEEDED(IMFMediaType_GetBlob(stream_type, &MF_MT_PAN_SCAN_APERTURE, if (FAILED(IMFMediaType_GetBlob(stream_type, &MF_MT_PAN_SCAN_APERTURE, (BYTE *)&aperture, sizeof(aperture), &value)))
(BYTE *)&aperture, sizeof(aperture), &value))) aperture = default_aperture;
{ if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_PAN_SCAN_APERTURE, (BYTE *)&aperture, sizeof(aperture))))
if (FAILED(hr = IMFVideoMediaType_SetBlob(video_type, &MF_MT_PAN_SCAN_APERTURE, goto done;
(BYTE *)&aperture, sizeof(aperture))))
goto done;
}
done: done:
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
......
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