linux-pipewire: camera-portal: Support enumerated sizes #12509
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description + Motivation and Context
A node might choose to use an enumerated choice pod to report the set of
supported sizes. Currently that is not supported. And what's worse, since
SPA_POD_OPT_Rectangle()
is used, if the node uses an enum choice, then{,this_}resolution
stays uninitialized butspa_pod_parse_object()
willnot report errors because the field is considered optional.
Fix this by using
spa_pod_get_values()
, which can be used for concretevalues, and both
SPA_CHOICE_{None,Enum}
.Since the resolutions are parsed in two separate places, and since the
frame rates require essentially the same treatment a new function is
introduced to handle the common parts.
How Has This Been Tested?
With the current pipewire master branch, with a video node that uses enumerated choice for size, as well as nodes that don't use enumerated choices.
Types of changes
Checklist: