winegstreamer: Allow wg_transform size changes with an explicit attribute.
This commit is contained in:
parent
98b8ab9b88
commit
6979a9f059
3 changed files with 6 additions and 12 deletions
|
@ -89,6 +89,7 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder)
|
|||
{
|
||||
.output_plane_align = 15,
|
||||
.input_queue_length = 15,
|
||||
.allow_size_change = TRUE,
|
||||
};
|
||||
struct wg_format input_format;
|
||||
struct wg_format output_format;
|
||||
|
@ -106,12 +107,6 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder)
|
|||
if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN)
|
||||
return MF_E_INVALIDMEDIATYPE;
|
||||
|
||||
/* Don't force any specific size, H264 streams already have the metadata for it
|
||||
* and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later.
|
||||
*/
|
||||
output_format.u.video.width = 0;
|
||||
output_format.u.video.height = 0;
|
||||
|
||||
if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency)))
|
||||
attrs.low_latency = !!low_latency;
|
||||
|
||||
|
@ -545,12 +540,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
|
|||
struct wg_format output_format;
|
||||
mf_media_type_to_wg_format(decoder->output_type, &output_format);
|
||||
|
||||
/* Don't force any specific size, H264 streams already have the metadata for it
|
||||
* and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later.
|
||||
*/
|
||||
output_format.u.video.width = 0;
|
||||
output_format.u.video.height = 0;
|
||||
|
||||
if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN
|
||||
|| !wg_transform_set_output_format(decoder->wg_transform, &output_format))
|
||||
{
|
||||
|
|
|
@ -336,6 +336,7 @@ struct wg_transform_attrs
|
|||
{
|
||||
UINT32 output_plane_align;
|
||||
UINT32 input_queue_length;
|
||||
BOOL allow_size_change;
|
||||
BOOL low_latency;
|
||||
};
|
||||
|
||||
|
|
|
@ -193,7 +193,11 @@ static GstCaps *transform_format_to_caps(struct wg_transform *transform, const s
|
|||
struct wg_format copy = *format;
|
||||
|
||||
if (format->major_type == WG_MAJOR_TYPE_VIDEO)
|
||||
{
|
||||
if (transform->attrs.allow_size_change)
|
||||
copy.u.video.width = copy.u.video.height = 0;
|
||||
copy.u.video.fps_n = copy.u.video.fps_d = 0;
|
||||
}
|
||||
|
||||
return wg_format_to_caps(©);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue