pitch: Specify layout as required for negotiation

There are cases where it might negotiate 'non-interleaved' while it
is wrong.

```
gst-launch-1.0 audiotestsrc !  "audio/x-raw, format=(string)F32LE, layout=(string)non-interleaved" ! audioconvert ! audioresample ! pitch tempo=1.2 ! audioconvert ! "audio/x-raw,format=S16LE" ! fakesink

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
(gst-launch-1.0:3029628): GStreamer-Audio-CRITICAL **: 11:42:22.477: gst_audio_buffer_map: assertion '(!meta && info->layout == GST_AUDIO_LAYOUT_INTERLEAVED) || (meta && info->layout == meta->info.layout)' failed
ERROR: from element /GstPipeline:pipeline0/GstAudioConvert:audioconvert1: The stream is in the wrong format.
Additional debug info:
../subprojects/gst-plugins-base/gst/audioconvert/gstaudioconvert.c(876): gst_audio_convert_transform (): /GstPipeline:pipeline0/GstAudioConvert:audioconvert1:
failed to map input buffer
ERROR: pipeline doesn't want to preroll.
ERROR: from element /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0: Internal data stream error.
Setting pipeline to NULL ...
Additional debug info:
../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Freeing pipeline ...
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1441>
This commit is contained in:
Thibault Saunier 2021-12-11 11:33:39 -03:00
parent f9668b0697
commit d82efb47aa
2 changed files with 8 additions and 6 deletions

View file

@ -222797,12 +222797,12 @@
"long-name": "Pitch controller",
"pad-templates": {
"sink": {
"caps": "audio/x-raw:\n format: F32LE\n rate: [ 8000, 2147483647 ]\n channels: [ 1, 2147483647 ]\n",
"caps": "audio/x-raw:\n format: F32LE\n rate: [ 8000, 2147483647 ]\n channels: [ 1, 2147483647 ]\n layout: interleaved\n",
"direction": "sink",
"presence": "always"
},
"src": {
"caps": "audio/x-raw:\n format: F32LE\n rate: [ 8000, 2147483647 ]\n channels: [ 1, 2147483647 ]\n",
"caps": "audio/x-raw:\n format: F32LE\n rate: [ 8000, 2147483647 ]\n channels: [ 1, 2147483647 ]\n layout: interleaved\n",
"direction": "src",
"presence": "always"
}

View file

@ -73,13 +73,15 @@ enum
"audio/x-raw, " \
"format = (string) " GST_AUDIO_NE (F32) ", " \
"rate = (int) [ 8000, MAX ], " \
"channels = (int) [ 1, MAX ]"
"channels = (int) [ 1, MAX ], " \
"layout = (string) interleaved"
#elif defined(SOUNDTOUCH_INTEGER_SAMPLES)
#define SUPPORTED_CAPS \
"audio/x-raw, " \
"format = (string) " GST_AUDIO_NE (S16) ", " \
"rate = (int) [ 8000, MAX ], " \
"channels = (int) [ 1, MAX ]"
"channels = (int) [ 1, MAX ]", \
"layout = (string) interleaved"
#else
#error "Only integer or float samples are supported"
#endif
@ -461,8 +463,8 @@ gst_pitch_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
return res;
}
/* generic convert function based on caps, no rate
* used here
/* generic convert function based on caps, no rate
* used here
*/
static gboolean
gst_pitch_convert (GstPitch * pitch,