wasapi2clinet: Simplify set caps
Don't need to iterate all structure to set identical values Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2177>
This commit is contained in:
parent
6b7e08df90
commit
f0ac468fb4
@ -1040,7 +1040,6 @@ gst_wasapi2_util_parse_waveformatex (WAVEFORMATEXTENSIBLE * format,
|
|||||||
GstCaps * template_caps, GstCaps ** out_caps,
|
GstCaps * template_caps, GstCaps ** out_caps,
|
||||||
GstAudioChannelPosition ** out_positions)
|
GstAudioChannelPosition ** out_positions)
|
||||||
{
|
{
|
||||||
int ii;
|
|
||||||
const gchar *afmt;
|
const gchar *afmt;
|
||||||
guint64 channel_mask;
|
guint64 channel_mask;
|
||||||
|
|
||||||
@ -1069,18 +1068,14 @@ gst_wasapi2_util_parse_waveformatex (WAVEFORMATEXTENSIBLE * format,
|
|||||||
channel_mask =
|
channel_mask =
|
||||||
gst_wasapi_util_waveformatex_to_channel_mask (format, out_positions);
|
gst_wasapi_util_waveformatex_to_channel_mask (format, out_positions);
|
||||||
|
|
||||||
for (ii = 0; ii < gst_caps_get_size (*out_caps); ii++) {
|
gst_caps_set_simple (*out_caps,
|
||||||
GstStructure *s = gst_caps_get_structure (*out_caps, ii);
|
"format", G_TYPE_STRING, afmt,
|
||||||
|
"channels", G_TYPE_INT, format->Format.nChannels,
|
||||||
|
"rate", G_TYPE_INT, format->Format.nSamplesPerSec, NULL);
|
||||||
|
|
||||||
gst_structure_set (s,
|
if (channel_mask) {
|
||||||
"format", G_TYPE_STRING, afmt,
|
gst_caps_set_simple (*out_caps,
|
||||||
"channels", G_TYPE_INT, format->Format.nChannels,
|
"channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
|
||||||
"rate", G_TYPE_INT, format->Format.nSamplesPerSec, NULL);
|
|
||||||
|
|
||||||
if (channel_mask) {
|
|
||||||
gst_structure_set (s,
|
|
||||||
"channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user