mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
speex: Update for the new raw audio caps
This commit is contained in:
parent
42bdbbcb29
commit
4b6a410be0
2 changed files with 16 additions and 1 deletions
|
@ -67,6 +67,7 @@ GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-raw, "
|
GST_STATIC_CAPS ("audio/x-raw, "
|
||||||
"format = (string) " FORMAT_STR ", "
|
"format = (string) " FORMAT_STR ", "
|
||||||
|
"layout = (string) interleaved, "
|
||||||
"rate = (int) [ 6000, 48000 ], " "channels = (int) [ 1, 2 ]")
|
"rate = (int) [ 6000, 48000 ], " "channels = (int) [ 1, 2 ]")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -231,9 +232,16 @@ gst_speex_dec_parse_header (GstSpeexDec * dec, GstBuffer * buf)
|
||||||
/* set caps */
|
/* set caps */
|
||||||
caps = gst_caps_new_simple ("audio/x-raw",
|
caps = gst_caps_new_simple ("audio/x-raw",
|
||||||
"format", G_TYPE_STRING, FORMAT_STR,
|
"format", G_TYPE_STRING, FORMAT_STR,
|
||||||
|
"layout", G_TYPE_STRING, "interleaved",
|
||||||
"rate", G_TYPE_INT, dec->header->rate,
|
"rate", G_TYPE_INT, dec->header->rate,
|
||||||
"channels", G_TYPE_INT, dec->header->nb_channels, NULL);
|
"channels", G_TYPE_INT, dec->header->nb_channels, NULL);
|
||||||
|
|
||||||
|
if (dec->header->nb_channels == 2) {
|
||||||
|
gst_caps_set_simple (caps, "channel-mask", GST_TYPE_BITMASK,
|
||||||
|
GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_LEFT) |
|
||||||
|
GST_AUDIO_CHANNEL_POSITION_MASK (FRONT_RIGHT), NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (!gst_pad_set_caps (GST_AUDIO_DECODER_SRC_PAD (dec), caps))
|
if (!gst_pad_set_caps (GST_AUDIO_DECODER_SRC_PAD (dec), caps))
|
||||||
goto nego_failed;
|
goto nego_failed;
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,14 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_ALWAYS,
|
GST_PAD_ALWAYS,
|
||||||
GST_STATIC_CAPS ("audio/x-raw, "
|
GST_STATIC_CAPS ("audio/x-raw, "
|
||||||
"format = (string) " FORMAT_STR ", "
|
"format = (string) " FORMAT_STR ", "
|
||||||
"rate = (int) [ 6000, 48000 ], " "channels = (int) [ 1, 2 ]")
|
"layout = (string) interleaved, "
|
||||||
|
"rate = (int) [ 6000, 48000 ], "
|
||||||
|
"channels = (int) 1; "
|
||||||
|
"audio/x-raw, "
|
||||||
|
"format = (string) " FORMAT_STR ", "
|
||||||
|
"layout = (string) interleaved, "
|
||||||
|
"rate = (int) [ 6000, 48000 ], "
|
||||||
|
"channels = (int) 2, " "channel-mask = (bitmask) 0x3")
|
||||||
);
|
);
|
||||||
|
|
||||||
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
|
|
Loading…
Reference in a new issue