mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: set MANDATORY flag when building video format with modifier
Proper negotiation requires that formats with modifiers are not matched with those without. This is ensured by using SPA_POD_PROP_FLAG_MANDATORY.
This commit is contained in:
parent
96bb44e290
commit
6d59ad21c2
2 changed files with 10 additions and 6 deletions
|
|
@ -49,9 +49,11 @@ spa_format_video_dsp_build(struct spa_pod_builder *builder, uint32_t id,
|
|||
if (info->format != SPA_VIDEO_FORMAT_UNKNOWN)
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_FORMAT_VIDEO_format, SPA_POD_Id(info->format), 0);
|
||||
if (info->modifier != 0 || info->flags & SPA_VIDEO_FLAG_MODIFIER)
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
||||
if (info->modifier != 0 || info->flags & SPA_VIDEO_FLAG_MODIFIER) {
|
||||
spa_pod_builder_prop(builder,
|
||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY);
|
||||
spa_pod_builder_long(builder, info->modifier);
|
||||
}
|
||||
return (struct spa_pod*)spa_pod_builder_pop(builder, &f);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -68,9 +68,11 @@ spa_format_video_raw_build(struct spa_pod_builder *builder, uint32_t id,
|
|||
if (info->framerate.denom != 0)
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_FORMAT_VIDEO_framerate, SPA_POD_Fraction(&info->framerate), 0);
|
||||
if (info->modifier != 0 || info->flags & SPA_VIDEO_FLAG_MODIFIER)
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_Long(info->modifier), 0);
|
||||
if (info->modifier != 0 || info->flags & SPA_VIDEO_FLAG_MODIFIER) {
|
||||
spa_pod_builder_prop(builder,
|
||||
SPA_FORMAT_VIDEO_modifier, SPA_POD_PROP_FLAG_MANDATORY);
|
||||
spa_pod_builder_long(builder, info->modifier);
|
||||
}
|
||||
if (info->max_framerate.denom != 0)
|
||||
spa_pod_builder_add(builder,
|
||||
SPA_FORMAT_VIDEO_maxFramerate, SPA_POD_Fraction(info->max_framerate), 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue