mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 02:30:35 +00:00
audiotestsrc: add support for unlimited number of channels
Raise the channel limit and set the channel-mask for > 2 channels.
This commit is contained in:
parent
b0bf294a62
commit
c688eb0d88
1 changed files with 8 additions and 0 deletions
|
@ -267,6 +267,7 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
|
|||
{
|
||||
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (bsrc);
|
||||
GstStructure *structure;
|
||||
gint channels;
|
||||
|
||||
caps = gst_caps_make_writable (caps);
|
||||
|
||||
|
@ -282,6 +283,13 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
|
|||
/* fixate to mono unless downstream requires stereo, for backwards compat */
|
||||
gst_structure_fixate_field_nearest_int (structure, "channels", 1);
|
||||
|
||||
if (gst_structure_get_int (structure, "channels", &channels) && channels > 2) {
|
||||
if (!gst_structure_has_field_typed (structure, "channel-mask",
|
||||
GST_TYPE_BITMASK))
|
||||
gst_structure_set (structure, "channel-mask", GST_TYPE_BITMASK, 0ULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps);
|
||||
|
||||
return caps;
|
||||
|
|
Loading…
Reference in a new issue