From 7e8ae7f5bd23a425674180df138d3dcc3b21afb6 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sun, 26 Aug 2007 13:59:05 +0000 Subject: Implement full parsing support --- audio/gstsbcparse.c | 194 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 audio/gstsbcparse.c (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c new file mode 100644 index 00000000..5097a85f --- /dev/null +++ b/audio/gstsbcparse.c @@ -0,0 +1,194 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2007 Marcel Holtmann + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include + +#include "gstsbcparse.h" + +GST_DEBUG_CATEGORY_STATIC(sbc_parse_debug); +#define GST_CAT_DEFAULT sbc_parse_debug + +GST_BOILERPLATE(GstSbcParse, gst_sbc_parse, GstElement, GST_TYPE_ELEMENT); + +static const GstElementDetails sbc_parse_details = + GST_ELEMENT_DETAILS("Bluetooth SBC parser", + "Codec/Parser/Audio", + "Parse a SBC audio stream", + "Marcel Holtmann "); + +static GstStaticPadTemplate sbc_parse_sink_factory = + GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-sbc")); + +static GstStaticPadTemplate sbc_parse_src_factory = + GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, + GST_STATIC_CAPS("audio/x-sbc, " + "rate = (int) { 16000, 32000, 44100, 48000 }, " + "channels = (int) [ 1, 2 ], " + "mode = (string) { mono, dual, stereo, joint }, " + "blocks = (int) { 4, 8, 12, 16 }, " + "subbands = (int) { 4, 8 }, " + "allocation = (string) { snr, loudness }")); + +static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) +{ + GstSbcParse *parse = GST_SBC_PARSE(gst_pad_get_parent(pad)); + GstFlowReturn res = GST_FLOW_OK; + guint size, offset = 0; + guint8 *data; + GstClockTime timestamp; + + timestamp = GST_BUFFER_TIMESTAMP(buffer); + + if (parse->buffer) { + GstBuffer *temp = buffer; + buffer = gst_buffer_span(parse->buffer, 0, buffer, + GST_BUFFER_SIZE(parse->buffer) + GST_BUFFER_SIZE(buffer)); + gst_buffer_unref(temp); + gst_buffer_unref(parse->buffer); + parse->buffer = NULL; + } + + data = GST_BUFFER_DATA(buffer); + size = GST_BUFFER_SIZE(buffer); + + while (offset < size) { + GstBuffer *output; + GstPadTemplate *template; + GstCaps *caps, *temp; + int consumed; + + consumed = sbc_parse(&parse->sbc, data + offset, size - offset); + if (consumed <= 0) + break; + + caps = gst_caps_new_simple("audio/x-sbc", + "rate", G_TYPE_INT, parse->sbc.rate, + "channels", G_TYPE_INT, parse->sbc.channels, + NULL); + + template = gst_static_pad_template_get(&sbc_parse_src_factory); + + temp = gst_caps_intersect(caps, + gst_pad_template_get_caps(template)); + + gst_caps_unref(caps); + + res = gst_pad_alloc_buffer_and_set_caps(parse->srcpad, + GST_BUFFER_OFFSET_NONE, + consumed, temp, &output); + + gst_caps_unref(temp); + + if (res != GST_FLOW_OK) + goto done; + + memcpy(GST_BUFFER_DATA(output), data + offset, consumed); + + res = gst_pad_push(parse->srcpad, output); + if (res != GST_FLOW_OK) + goto done; + + offset += consumed; + } + + if (offset < size) + parse->buffer = gst_buffer_create_sub(buffer, + offset, size - offset); + +done: + gst_buffer_unref(buffer); + gst_object_unref(parse); + + return res; +} + +static GstStateChangeReturn sbc_parse_change_state(GstElement *element, + GstStateChange transition) +{ + GstSbcParse *parse = GST_SBC_PARSE(element); + + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: + GST_DEBUG("Setup subband codec"); + if (parse->buffer) { + gst_buffer_unref(parse->buffer); + parse->buffer = NULL; + } + sbc_init(&parse->sbc, 0); + break; + + case GST_STATE_CHANGE_PAUSED_TO_READY: + GST_DEBUG("Finish subband codec"); + if (parse->buffer) { + gst_buffer_unref(parse->buffer); + parse->buffer = NULL; + } + sbc_finish(&parse->sbc); + break; + + default: + break; + } + + return parent_class->change_state(element, transition); +} + +static void gst_sbc_parse_base_init(gpointer g_class) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(g_class); + + gst_element_class_add_pad_template(element_class, + gst_static_pad_template_get(&sbc_parse_sink_factory)); + + gst_element_class_add_pad_template(element_class, + gst_static_pad_template_get(&sbc_parse_src_factory)); + + gst_element_class_set_details(element_class, &sbc_parse_details); +} + +static void gst_sbc_parse_class_init(GstSbcParseClass *klass) +{ + GstElementClass *element_class = GST_ELEMENT_CLASS(klass); + + parent_class = g_type_class_peek_parent(klass); + + element_class->change_state = GST_DEBUG_FUNCPTR(sbc_parse_change_state); + + GST_DEBUG_CATEGORY_INIT(sbc_parse_debug, "sbcparse", 0, + "SBC parsing element"); +} + +static void gst_sbc_parse_init(GstSbcParse *self, GstSbcParseClass *klass) +{ + self->sinkpad = gst_pad_new_from_static_template(&sbc_parse_sink_factory, "sink"); + gst_pad_set_chain_function(self->sinkpad, GST_DEBUG_FUNCPTR(sbc_parse_chain)); + gst_element_add_pad(GST_ELEMENT(self), self->sinkpad); + + self->srcpad = gst_pad_new_from_static_template(&sbc_parse_src_factory, "src"); + gst_element_add_pad(GST_ELEMENT(self), self->srcpad); +} -- cgit From cee061308a8d4730b13d308b1ee8fbf3e4a22578 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 18 Oct 2007 21:47:53 +0000 Subject: Fixes sbcparser element. --- audio/gstsbcparse.c | 186 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 170 insertions(+), 16 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 5097a85f..e204870b 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -28,6 +28,7 @@ #include #include "gstsbcparse.h" +#include "gstsbcutil.h" GST_DEBUG_CATEGORY_STATIC(sbc_parse_debug); #define GST_CAT_DEFAULT sbc_parse_debug @@ -54,6 +55,170 @@ static GstStaticPadTemplate sbc_parse_src_factory = "subbands = (int) { 4, 8 }, " "allocation = (string) { snr, loudness }")); +/* + Creates a fixed caps from the caps given. + +*/ +static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) +{ + GstCaps *result; + GstStructure *structure; + const GValue *value; + gboolean error = FALSE; + gint temp, rate, channels, blocks, subbands; + const gchar* allocation = NULL; + const gchar* mode = NULL; + const gchar* error_message = NULL; + + structure = gst_caps_get_structure(caps, 0); + + /* rate */ + if (!gst_structure_has_field(structure, "rate")) { + error = TRUE; + error_message = "no rate."; + goto error; + } else { + value = gst_structure_get_value(structure, "rate"); + if (GST_VALUE_HOLDS_LIST(value)) { + temp = gst_sbc_select_rate_from_list(value); + } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { + temp = gst_sbc_select_rate_from_range(value); + } else { + temp = g_value_get_int(value); + } + rate = temp; + } + + /* channels */ + if (!gst_structure_has_field(structure, "channels")) { + error = TRUE; + error_message = "no channels."; + goto error; + } else { + value = gst_structure_get_value(structure, "channels"); + if (GST_VALUE_HOLDS_LIST(value)) { + temp = gst_sbc_select_channels_from_list(value); + } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { + temp = gst_sbc_select_channels_from_range(value); + } else { + temp = g_value_get_int(value); + } + channels = temp; + } + + /* blocks */ + if (!gst_structure_has_field(structure, "blocks")) { + error = TRUE; + error_message = "no blocks."; + goto error; + } else { + value = gst_structure_get_value(structure, "blocks"); + if (GST_VALUE_HOLDS_LIST(value)) { + temp = gst_sbc_select_blocks_from_list(value); + } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { + temp = gst_sbc_select_blocks_from_range(value); + } else { + temp = g_value_get_int(value); + } + blocks = temp; + } + + /* subbands */ + if (!gst_structure_has_field(structure, "subbands")) { + error = TRUE; + error_message = "no subbands."; + goto error; + } else { + value = gst_structure_get_value(structure, "subbands"); + if (GST_VALUE_HOLDS_LIST(value)) { + temp = gst_sbc_select_subbands_from_list(value); + } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { + temp = gst_sbc_select_subbands_from_range(value); + } else { + temp = g_value_get_int(value); + } + subbands = temp; + } + + /* allocation */ + if (!gst_structure_has_field(structure, "allocation")) { + error = TRUE; + error_message = "no allocation."; + goto error; + } else { + value = gst_structure_get_value(structure, "allocation"); + if (GST_VALUE_HOLDS_LIST(value)) { + allocation = gst_sbc_get_allocation_from_list(value); + } else { + allocation = g_value_get_string(value); + } + } + + /* mode */ + if (!gst_structure_has_field(structure, "mode")) { + error = TRUE; + error_message = "no mode."; + goto error; + } else { + value = gst_structure_get_value(structure, "mode"); + if (GST_VALUE_HOLDS_LIST(value)) { + mode = gst_sbc_get_mode_from_list(value); + } else { + mode = g_value_get_string(value); + } + } + +error: + if (error) { + GST_ERROR_OBJECT (parse, "Invalid input caps: %s", + error_message); + return NULL; + } + + + result = gst_caps_new_simple("audio/x-sbc", + "rate", G_TYPE_INT, rate, + "channels", G_TYPE_INT, channels, + "mode", G_TYPE_STRING, mode, + "blocks", G_TYPE_INT, blocks, + "subbands", G_TYPE_INT, subbands, + "allocation", G_TYPE_STRING, allocation, + NULL); + parse->sbc.rate = rate; + parse->sbc.channels = channels; + parse->sbc.blocks = blocks; + parse->sbc.subbands = subbands; + parse->sbc.joint = gst_sbc_get_mode_int(mode); + parse->sbc.allocation = gst_sbc_get_allocation_mode_int(allocation); + + return result; +} + +static gboolean sbc_parse_sink_setcaps(GstPad * pad, GstCaps * caps) +{ + GstSbcParse *parse; + GstCaps *inter, *other, *srccaps; + + parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); + + other = gst_pad_peer_get_caps(parse->srcpad); + if (other == NULL) + other = gst_caps_new_any(); + + inter = gst_caps_intersect(caps, other); + srccaps = sbc_parse_select_caps(parse, inter); + if (srccaps == NULL) + return FALSE; + + gst_pad_set_caps(parse->srcpad, srccaps); + + gst_caps_unref(inter); + gst_caps_unref(other); + gst_caps_unref(srccaps); + + return TRUE; +} + static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) { GstSbcParse *parse = GST_SBC_PARSE(gst_pad_get_parent(pad)); @@ -78,31 +243,20 @@ static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) while (offset < size) { GstBuffer *output; - GstPadTemplate *template; - GstCaps *caps, *temp; + GstCaps *temp; int consumed; consumed = sbc_parse(&parse->sbc, data + offset, size - offset); if (consumed <= 0) break; - caps = gst_caps_new_simple("audio/x-sbc", - "rate", G_TYPE_INT, parse->sbc.rate, - "channels", G_TYPE_INT, parse->sbc.channels, - NULL); - template = gst_static_pad_template_get(&sbc_parse_src_factory); - - temp = gst_caps_intersect(caps, - gst_pad_template_get_caps(template)); - - gst_caps_unref(caps); + temp = GST_PAD_CAPS(parse->srcpad); res = gst_pad_alloc_buffer_and_set_caps(parse->srcpad, GST_BUFFER_OFFSET_NONE, consumed, temp, &output); - gst_caps_unref(temp); if (res != GST_FLOW_OK) goto done; @@ -141,7 +295,6 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, } sbc_init(&parse->sbc, 0); break; - case GST_STATE_CHANGE_PAUSED_TO_READY: GST_DEBUG("Finish subband codec"); if (parse->buffer) { @@ -150,7 +303,6 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, } sbc_finish(&parse->sbc); break; - default: break; } @@ -180,13 +332,15 @@ static void gst_sbc_parse_class_init(GstSbcParseClass *klass) element_class->change_state = GST_DEBUG_FUNCPTR(sbc_parse_change_state); GST_DEBUG_CATEGORY_INIT(sbc_parse_debug, "sbcparse", 0, - "SBC parsing element"); + "SBC parsing element"); } static void gst_sbc_parse_init(GstSbcParse *self, GstSbcParseClass *klass) { self->sinkpad = gst_pad_new_from_static_template(&sbc_parse_sink_factory, "sink"); gst_pad_set_chain_function(self->sinkpad, GST_DEBUG_FUNCPTR(sbc_parse_chain)); + gst_pad_set_setcaps_function (self->sinkpad, + GST_DEBUG_FUNCPTR (sbc_parse_sink_setcaps)); gst_element_add_pad(GST_ELEMENT(self), self->sinkpad); self->srcpad = gst_pad_new_from_static_template(&sbc_parse_src_factory, "src"); -- cgit From 2dda76438063672e2bdccf1709db3615d453ad5b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 18 Oct 2007 22:46:12 +0000 Subject: Fix coding style issues. --- audio/gstsbcparse.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index e204870b..9f0c4d81 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -295,6 +295,7 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, } sbc_init(&parse->sbc, 0); break; + case GST_STATE_CHANGE_PAUSED_TO_READY: GST_DEBUG("Finish subband codec"); if (parse->buffer) { @@ -303,6 +304,7 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, } sbc_finish(&parse->sbc); break; + default: break; } -- cgit From dda179a302219fd1b48711edb7d388a331ab3e2e Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 24 Oct 2007 21:51:37 +0000 Subject: Some more coding style changes --- audio/gstsbcparse.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 9f0c4d81..a15a75fb 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -55,10 +55,7 @@ static GstStaticPadTemplate sbc_parse_src_factory = "subbands = (int) { 4, 8 }, " "allocation = (string) { snr, loudness }")); -/* - Creates a fixed caps from the caps given. - -*/ +/* reates a fixed caps from the caps given. */ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) { GstCaps *result; @@ -72,7 +69,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) structure = gst_caps_get_structure(caps, 0); - /* rate */ if (!gst_structure_has_field(structure, "rate")) { error = TRUE; error_message = "no rate."; @@ -89,7 +85,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) rate = temp; } - /* channels */ if (!gst_structure_has_field(structure, "channels")) { error = TRUE; error_message = "no channels."; @@ -106,7 +101,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) channels = temp; } - /* blocks */ if (!gst_structure_has_field(structure, "blocks")) { error = TRUE; error_message = "no blocks."; @@ -123,7 +117,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) blocks = temp; } - /* subbands */ if (!gst_structure_has_field(structure, "subbands")) { error = TRUE; error_message = "no subbands."; @@ -140,7 +133,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) subbands = temp; } - /* allocation */ if (!gst_structure_has_field(structure, "allocation")) { error = TRUE; error_message = "no allocation."; @@ -154,7 +146,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) } } - /* mode */ if (!gst_structure_has_field(structure, "mode")) { error = TRUE; error_message = "no mode."; @@ -175,7 +166,6 @@ error: return NULL; } - result = gst_caps_new_simple("audio/x-sbc", "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, channels, @@ -250,14 +240,12 @@ static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) if (consumed <= 0) break; - temp = GST_PAD_CAPS(parse->srcpad); res = gst_pad_alloc_buffer_and_set_caps(parse->srcpad, GST_BUFFER_OFFSET_NONE, consumed, temp, &output); - if (res != GST_FLOW_OK) goto done; -- cgit From ea39736b353ba409d03e8f86b7ca6ca1e746fecd Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 29 Oct 2007 15:02:26 +0000 Subject: Add bitpool capability. --- audio/gstsbcparse.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index a15a75fb..42ae9550 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -53,16 +53,17 @@ static GstStaticPadTemplate sbc_parse_src_factory = "mode = (string) { mono, dual, stereo, joint }, " "blocks = (int) { 4, 8, 12, 16 }, " "subbands = (int) { 4, 8 }, " - "allocation = (string) { snr, loudness }")); + "allocation = (string) { snr, loudness }," + "bitpool = (int) [ 2, 64 ]")); -/* reates a fixed caps from the caps given. */ +/* Creates a fixed caps from the caps given. */ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) { GstCaps *result; GstStructure *structure; const GValue *value; gboolean error = FALSE; - gint temp, rate, channels, blocks, subbands; + gint temp, rate, channels, blocks, subbands, bitpool; const gchar* allocation = NULL; const gchar* mode = NULL; const gchar* error_message = NULL; @@ -133,6 +134,20 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) subbands = temp; } + if (!gst_structure_has_field(structure, "bitpool")) { + error = TRUE; + error_message = "no bitpool"; + goto error; + } else { + value = gst_structure_get_value(structure, "bitpool"); + if (GST_VALUE_HOLDS_INT_RANGE(value)) { + temp = gst_sbc_select_bitpool_from_range(value); + } else { + temp = g_value_get_int(value); + } + bitpool = temp; + } + if (!gst_structure_has_field(structure, "allocation")) { error = TRUE; error_message = "no allocation."; @@ -173,11 +188,13 @@ error: "blocks", G_TYPE_INT, blocks, "subbands", G_TYPE_INT, subbands, "allocation", G_TYPE_STRING, allocation, + "bitpool", G_TYPE_INT, bitpool, NULL); parse->sbc.rate = rate; parse->sbc.channels = channels; parse->sbc.blocks = blocks; parse->sbc.subbands = subbands; + parse->sbc.bitpool = bitpool; parse->sbc.joint = gst_sbc_get_mode_int(mode); parse->sbc.allocation = gst_sbc_get_allocation_mode_int(allocation); -- cgit From 96d6078ada20a76f885ea04893aac5f0ca5fe48d Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Thu, 1 Nov 2007 19:45:00 +0000 Subject: Fix sbc negotiation and improves buffer handling by using GstAdapter. --- audio/gstsbcparse.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 42ae9550..185cda03 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -78,8 +78,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) value = gst_structure_get_value(structure, "rate"); if (GST_VALUE_HOLDS_LIST(value)) { temp = gst_sbc_select_rate_from_list(value); - } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { - temp = gst_sbc_select_rate_from_range(value); } else { temp = g_value_get_int(value); } @@ -92,9 +90,7 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "channels"); - if (GST_VALUE_HOLDS_LIST(value)) { - temp = gst_sbc_select_channels_from_list(value); - } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { + if (GST_VALUE_HOLDS_INT_RANGE(value)) { temp = gst_sbc_select_channels_from_range(value); } else { temp = g_value_get_int(value); @@ -110,8 +106,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) value = gst_structure_get_value(structure, "blocks"); if (GST_VALUE_HOLDS_LIST(value)) { temp = gst_sbc_select_blocks_from_list(value); - } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { - temp = gst_sbc_select_blocks_from_range(value); } else { temp = g_value_get_int(value); } @@ -126,8 +120,6 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) value = gst_structure_get_value(structure, "subbands"); if (GST_VALUE_HOLDS_LIST(value)) { temp = gst_sbc_select_subbands_from_list(value); - } else if (GST_VALUE_HOLDS_INT_RANGE(value)) { - temp = gst_sbc_select_subbands_from_range(value); } else { temp = g_value_get_int(value); } -- cgit From d4e24bf6a3d8af6479abce92fbbf1869a59669aa Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 21 Nov 2007 20:24:11 +0000 Subject: Integrate new ipc API implementation. --- audio/gstsbcparse.c | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 185cda03..bae7d623 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -57,6 +57,7 @@ static GstStaticPadTemplate sbc_parse_src_factory = "bitpool = (int) [ 2, 64 ]")); /* Creates a fixed caps from the caps given. */ +/* FIXME use gstsbcutil caps fixating function */ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) { GstCaps *result; @@ -67,6 +68,11 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) const gchar* allocation = NULL; const gchar* mode = NULL; const gchar* error_message = NULL; + gchar* str; + + str = gst_caps_to_string(caps); + GST_DEBUG_OBJECT(parse, "Parsing caps: %s", str); + g_free(str); structure = gst_caps_get_structure(caps, 0); @@ -76,11 +82,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "rate"); - if (GST_VALUE_HOLDS_LIST(value)) { + if (GST_VALUE_HOLDS_LIST(value)) temp = gst_sbc_select_rate_from_list(value); - } else { + else temp = g_value_get_int(value); - } rate = temp; } @@ -90,11 +95,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "channels"); - if (GST_VALUE_HOLDS_INT_RANGE(value)) { + if (GST_VALUE_HOLDS_INT_RANGE(value)) temp = gst_sbc_select_channels_from_range(value); - } else { + else temp = g_value_get_int(value); - } channels = temp; } @@ -104,11 +108,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "blocks"); - if (GST_VALUE_HOLDS_LIST(value)) { + if (GST_VALUE_HOLDS_LIST(value)) temp = gst_sbc_select_blocks_from_list(value); - } else { + else temp = g_value_get_int(value); - } blocks = temp; } @@ -118,11 +121,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "subbands"); - if (GST_VALUE_HOLDS_LIST(value)) { + if (GST_VALUE_HOLDS_LIST(value)) temp = gst_sbc_select_subbands_from_list(value); - } else { + else temp = g_value_get_int(value); - } subbands = temp; } @@ -132,11 +134,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "bitpool"); - if (GST_VALUE_HOLDS_INT_RANGE(value)) { + if (GST_VALUE_HOLDS_INT_RANGE(value)) temp = gst_sbc_select_bitpool_from_range(value); - } else { + else temp = g_value_get_int(value); - } bitpool = temp; } @@ -146,11 +147,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "allocation"); - if (GST_VALUE_HOLDS_LIST(value)) { + if (GST_VALUE_HOLDS_LIST(value)) allocation = gst_sbc_get_allocation_from_list(value); - } else { + else allocation = g_value_get_string(value); - } } if (!gst_structure_has_field(structure, "mode")) { @@ -159,11 +159,10 @@ static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) goto error; } else { value = gst_structure_get_value(structure, "mode"); - if (GST_VALUE_HOLDS_LIST(value)) { + if (GST_VALUE_HOLDS_LIST(value)) mode = gst_sbc_get_mode_from_list(value); - } else { + else mode = g_value_get_string(value); - } } error: @@ -205,9 +204,15 @@ static gboolean sbc_parse_sink_setcaps(GstPad * pad, GstCaps * caps) other = gst_caps_new_any(); inter = gst_caps_intersect(caps, other); + if (gst_caps_is_empty(inter)) { + gst_caps_unref(inter); + return FALSE; + } srccaps = sbc_parse_select_caps(parse, inter); - if (srccaps == NULL) + if (srccaps == NULL) { + gst_caps_unref(inter); return FALSE; + } gst_pad_set_caps(parse->srcpad, srccaps); -- cgit From a0af7ee44534dad8f35a4142c6a22177e54ffc57 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 23 Jan 2008 13:14:02 +0000 Subject: Make a2dpsink to act like a bin and split the payloader. --- audio/gstsbcparse.c | 223 ++++++++++++++++++---------------------------------- 1 file changed, 77 insertions(+), 146 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index bae7d623..49d0bb6e 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -56,171 +56,83 @@ static GstStaticPadTemplate sbc_parse_src_factory = "allocation = (string) { snr, loudness }," "bitpool = (int) [ 2, 64 ]")); -/* Creates a fixed caps from the caps given. */ -/* FIXME use gstsbcutil caps fixating function */ -static GstCaps* sbc_parse_select_caps(GstSbcParse *parse, GstCaps *caps) +static gboolean sbc_parse_sink_setcaps(GstPad * pad, GstCaps * caps) { - GstCaps *result; + GstSbcParse *parse; GstStructure *structure; - const GValue *value; - gboolean error = FALSE; - gint temp, rate, channels, blocks, subbands, bitpool; - const gchar* allocation = NULL; - const gchar* mode = NULL; - const gchar* error_message = NULL; - gchar* str; - - str = gst_caps_to_string(caps); - GST_DEBUG_OBJECT(parse, "Parsing caps: %s", str); - g_free(str); + gint rate, channels; + + parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); structure = gst_caps_get_structure(caps, 0); - if (!gst_structure_has_field(structure, "rate")) { - error = TRUE; - error_message = "no rate."; - goto error; - } else { - value = gst_structure_get_value(structure, "rate"); - if (GST_VALUE_HOLDS_LIST(value)) - temp = gst_sbc_select_rate_from_list(value); - else - temp = g_value_get_int(value); - rate = temp; - } + if (!gst_structure_get_int(structure, "rate", &rate)) + return FALSE; - if (!gst_structure_has_field(structure, "channels")) { - error = TRUE; - error_message = "no channels."; - goto error; - } else { - value = gst_structure_get_value(structure, "channels"); - if (GST_VALUE_HOLDS_INT_RANGE(value)) - temp = gst_sbc_select_channels_from_range(value); - else - temp = g_value_get_int(value); - channels = temp; - } + if (!gst_structure_get_int(structure, "channels", &channels)) + return FALSE; - if (!gst_structure_has_field(structure, "blocks")) { - error = TRUE; - error_message = "no blocks."; - goto error; - } else { - value = gst_structure_get_value(structure, "blocks"); - if (GST_VALUE_HOLDS_LIST(value)) - temp = gst_sbc_select_blocks_from_list(value); - else - temp = g_value_get_int(value); - blocks = temp; - } + if (!(parse->rate == 0 || rate == parse->rate)) + return FALSE; - if (!gst_structure_has_field(structure, "subbands")) { - error = TRUE; - error_message = "no subbands."; - goto error; - } else { - value = gst_structure_get_value(structure, "subbands"); - if (GST_VALUE_HOLDS_LIST(value)) - temp = gst_sbc_select_subbands_from_list(value); - else - temp = g_value_get_int(value); - subbands = temp; - } + if (!(parse->channels == 0 || channels == parse->channels)) + return FALSE; - if (!gst_structure_has_field(structure, "bitpool")) { - error = TRUE; - error_message = "no bitpool"; - goto error; - } else { - value = gst_structure_get_value(structure, "bitpool"); - if (GST_VALUE_HOLDS_INT_RANGE(value)) - temp = gst_sbc_select_bitpool_from_range(value); - else - temp = g_value_get_int(value); - bitpool = temp; - } + parse->rate = rate; + parse->channels = channels; - if (!gst_structure_has_field(structure, "allocation")) { - error = TRUE; - error_message = "no allocation."; - goto error; - } else { - value = gst_structure_get_value(structure, "allocation"); - if (GST_VALUE_HOLDS_LIST(value)) - allocation = gst_sbc_get_allocation_from_list(value); - else - allocation = g_value_get_string(value); - } + return gst_sbc_util_fill_sbc_params(&parse->sbc, caps); +} - if (!gst_structure_has_field(structure, "mode")) { - error = TRUE; - error_message = "no mode."; - goto error; - } else { - value = gst_structure_get_value(structure, "mode"); - if (GST_VALUE_HOLDS_LIST(value)) - mode = gst_sbc_get_mode_from_list(value); - else - mode = g_value_get_string(value); - } +static GstCaps* sbc_parse_src_getcaps(GstPad *pad) +{ + GstCaps *caps; + const GstCaps *allowed_caps; + GstStructure *structure; + GValue *value; + GstSbcParse *parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); -error: - if (error) { - GST_ERROR_OBJECT (parse, "Invalid input caps: %s", - error_message); - return NULL; - } + allowed_caps = gst_pad_get_allowed_caps(pad); + if (allowed_caps == NULL) + allowed_caps = gst_pad_get_pad_template_caps(pad); + caps = gst_caps_copy(allowed_caps); - result = gst_caps_new_simple("audio/x-sbc", - "rate", G_TYPE_INT, rate, - "channels", G_TYPE_INT, channels, - "mode", G_TYPE_STRING, mode, - "blocks", G_TYPE_INT, blocks, - "subbands", G_TYPE_INT, subbands, - "allocation", G_TYPE_STRING, allocation, - "bitpool", G_TYPE_INT, bitpool, - NULL); - parse->sbc.rate = rate; - parse->sbc.channels = channels; - parse->sbc.blocks = blocks; - parse->sbc.subbands = subbands; - parse->sbc.bitpool = bitpool; - parse->sbc.joint = gst_sbc_get_mode_int(mode); - parse->sbc.allocation = gst_sbc_get_allocation_mode_int(allocation); - - return result; + value = g_new0(GValue, 1); + + structure = gst_caps_get_structure(caps, 0); + + if (parse->rate != 0) + gst_sbc_util_set_structure_int_param(structure, "rate", + parse->rate, value); + if (parse->channels != 0) + gst_sbc_util_set_structure_int_param(structure, "channels", + parse->channels, value); + + g_free(value); + + return caps; } -static gboolean sbc_parse_sink_setcaps(GstPad * pad, GstCaps * caps) +static gboolean sbc_parse_src_acceptcaps(GstPad *pad, GstCaps *caps) { + GstStructure *structure; GstSbcParse *parse; - GstCaps *inter, *other, *srccaps; + gint rate, channels; parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); - other = gst_pad_peer_get_caps(parse->srcpad); - if (other == NULL) - other = gst_caps_new_any(); + structure = gst_caps_get_structure(caps, 0); - inter = gst_caps_intersect(caps, other); - if (gst_caps_is_empty(inter)) { - gst_caps_unref(inter); + if (!gst_structure_get_int(structure, "rate", &rate)) return FALSE; - } - srccaps = sbc_parse_select_caps(parse, inter); - if (srccaps == NULL) { - gst_caps_unref(inter); + if (!gst_structure_get_int(structure, "channels", &channels)) return FALSE; - } - gst_pad_set_caps(parse->srcpad, srccaps); + if ((parse->rate == 0 || parse->rate == rate) + && (parse->channels == 0 || parse->channels == channels)) + return TRUE; - gst_caps_unref(inter); - gst_caps_unref(other); - gst_caps_unref(srccaps); - - return TRUE; + return FALSE; } static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) @@ -234,11 +146,13 @@ static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) timestamp = GST_BUFFER_TIMESTAMP(buffer); if (parse->buffer) { - GstBuffer *temp = buffer; + GstBuffer *temp; + temp = buffer; buffer = gst_buffer_span(parse->buffer, 0, buffer, - GST_BUFFER_SIZE(parse->buffer) + GST_BUFFER_SIZE(buffer)); - gst_buffer_unref(temp); + GST_BUFFER_SIZE(parse->buffer) + + GST_BUFFER_SIZE(buffer)); gst_buffer_unref(parse->buffer); + gst_buffer_unref(temp); parse->buffer = NULL; } @@ -300,11 +214,13 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, case GST_STATE_CHANGE_PAUSED_TO_READY: GST_DEBUG("Finish subband codec"); + if (parse->buffer) { gst_buffer_unref(parse->buffer); parse->buffer = NULL; } sbc_finish(&parse->sbc); + break; default: @@ -341,12 +257,27 @@ static void gst_sbc_parse_class_init(GstSbcParseClass *klass) static void gst_sbc_parse_init(GstSbcParse *self, GstSbcParseClass *klass) { - self->sinkpad = gst_pad_new_from_static_template(&sbc_parse_sink_factory, "sink"); - gst_pad_set_chain_function(self->sinkpad, GST_DEBUG_FUNCPTR(sbc_parse_chain)); + self->sinkpad = gst_pad_new_from_static_template( + &sbc_parse_sink_factory, "sink"); + gst_pad_set_chain_function(self->sinkpad, + GST_DEBUG_FUNCPTR(sbc_parse_chain)); gst_pad_set_setcaps_function (self->sinkpad, GST_DEBUG_FUNCPTR (sbc_parse_sink_setcaps)); gst_element_add_pad(GST_ELEMENT(self), self->sinkpad); - self->srcpad = gst_pad_new_from_static_template(&sbc_parse_src_factory, "src"); + self->srcpad = gst_pad_new_from_static_template( + &sbc_parse_src_factory, "src"); + gst_pad_set_getcaps_function (self->srcpad, + GST_DEBUG_FUNCPTR (sbc_parse_src_getcaps)); + gst_pad_set_acceptcaps_function (self->srcpad, + GST_DEBUG_FUNCPTR (sbc_parse_src_acceptcaps)); + /* FIXME get encoding parameters on set caps */ gst_element_add_pad(GST_ELEMENT(self), self->srcpad); } + +gboolean gst_sbc_parse_plugin_init (GstPlugin * plugin) +{ + return gst_element_register (plugin, "sbcparse", + GST_RANK_NONE, GST_TYPE_SBC_PARSE); +} + -- cgit From 3ad6867c8c7251c3192378a1a0e2ed937ee47d1b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 30 Jan 2008 14:21:43 +0000 Subject: Fixes gstreamer caps and code cleanup. --- audio/gstsbcparse.c | 92 +++-------------------------------------------------- 1 file changed, 4 insertions(+), 88 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 49d0bb6e..1f699620 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -43,7 +43,8 @@ static const GstElementDetails sbc_parse_details = static GstStaticPadTemplate sbc_parse_sink_factory = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS("audio/x-sbc")); + GST_STATIC_CAPS("audio/x-sbc," + "parsed = (boolean) false")); static GstStaticPadTemplate sbc_parse_src_factory = GST_STATIC_PAD_TEMPLATE("src", GST_PAD_SRC, GST_PAD_ALWAYS, @@ -54,86 +55,8 @@ static GstStaticPadTemplate sbc_parse_src_factory = "blocks = (int) { 4, 8, 12, 16 }, " "subbands = (int) { 4, 8 }, " "allocation = (string) { snr, loudness }," - "bitpool = (int) [ 2, 64 ]")); - -static gboolean sbc_parse_sink_setcaps(GstPad * pad, GstCaps * caps) -{ - GstSbcParse *parse; - GstStructure *structure; - gint rate, channels; - - parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); - - structure = gst_caps_get_structure(caps, 0); - - if (!gst_structure_get_int(structure, "rate", &rate)) - return FALSE; - - if (!gst_structure_get_int(structure, "channels", &channels)) - return FALSE; - - if (!(parse->rate == 0 || rate == parse->rate)) - return FALSE; - - if (!(parse->channels == 0 || channels == parse->channels)) - return FALSE; - - parse->rate = rate; - parse->channels = channels; - - return gst_sbc_util_fill_sbc_params(&parse->sbc, caps); -} - -static GstCaps* sbc_parse_src_getcaps(GstPad *pad) -{ - GstCaps *caps; - const GstCaps *allowed_caps; - GstStructure *structure; - GValue *value; - GstSbcParse *parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); - - allowed_caps = gst_pad_get_allowed_caps(pad); - if (allowed_caps == NULL) - allowed_caps = gst_pad_get_pad_template_caps(pad); - caps = gst_caps_copy(allowed_caps); - - value = g_new0(GValue, 1); - - structure = gst_caps_get_structure(caps, 0); - - if (parse->rate != 0) - gst_sbc_util_set_structure_int_param(structure, "rate", - parse->rate, value); - if (parse->channels != 0) - gst_sbc_util_set_structure_int_param(structure, "channels", - parse->channels, value); - - g_free(value); - - return caps; -} - -static gboolean sbc_parse_src_acceptcaps(GstPad *pad, GstCaps *caps) -{ - GstStructure *structure; - GstSbcParse *parse; - gint rate, channels; - - parse = GST_SBC_PARSE(GST_PAD_PARENT(pad)); - - structure = gst_caps_get_structure(caps, 0); - - if (!gst_structure_get_int(structure, "rate", &rate)) - return FALSE; - if (!gst_structure_get_int(structure, "channels", &channels)) - return FALSE; - - if ((parse->rate == 0 || parse->rate == rate) - && (parse->channels == 0 || parse->channels == channels)) - return TRUE; - - return FALSE; -} + "bitpool = (int) [ 2, 64 ]," + "parsed = (boolean) true")); static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) { @@ -261,17 +184,10 @@ static void gst_sbc_parse_init(GstSbcParse *self, GstSbcParseClass *klass) &sbc_parse_sink_factory, "sink"); gst_pad_set_chain_function(self->sinkpad, GST_DEBUG_FUNCPTR(sbc_parse_chain)); - gst_pad_set_setcaps_function (self->sinkpad, - GST_DEBUG_FUNCPTR (sbc_parse_sink_setcaps)); gst_element_add_pad(GST_ELEMENT(self), self->sinkpad); self->srcpad = gst_pad_new_from_static_template( &sbc_parse_src_factory, "src"); - gst_pad_set_getcaps_function (self->srcpad, - GST_DEBUG_FUNCPTR (sbc_parse_src_getcaps)); - gst_pad_set_acceptcaps_function (self->srcpad, - GST_DEBUG_FUNCPTR (sbc_parse_src_acceptcaps)); - /* FIXME get encoding parameters on set caps */ gst_element_add_pad(GST_ELEMENT(self), self->srcpad); } -- cgit From 6c4268df1dff13f3b1a7b778eb2e993648bff519 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 30 Jan 2008 17:30:27 +0000 Subject: Enable gstreamer plugin to use autoconnect flag. --- audio/gstsbcparse.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 1f699620..80bf23a2 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -68,6 +68,7 @@ static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) timestamp = GST_BUFFER_TIMESTAMP(buffer); + /* FIXME use a gstadpter */ if (parse->buffer) { GstBuffer *temp; temp = buffer; @@ -84,18 +85,29 @@ static GstFlowReturn sbc_parse_chain(GstPad *pad, GstBuffer *buffer) while (offset < size) { GstBuffer *output; - GstCaps *temp; int consumed; - consumed = sbc_parse(&parse->sbc, data + offset, size - offset); + consumed = sbc_parse(&parse->new_sbc, data + offset, + size - offset); if (consumed <= 0) break; - temp = GST_PAD_CAPS(parse->srcpad); + if (parse->first_parsing || (memcmp(&parse->sbc, + &parse->new_sbc, sizeof(sbc_t)) != 0)) { + + memcpy(&parse->sbc, &parse->new_sbc, sizeof(sbc_t)); + if (parse->outcaps != NULL) + gst_caps_unref(parse->outcaps); + + parse->outcaps = gst_sbc_parse_caps_from_sbc( + &parse->sbc); + + parse->first_parsing = FALSE; + } res = gst_pad_alloc_buffer_and_set_caps(parse->srcpad, GST_BUFFER_OFFSET_NONE, - consumed, temp, &output); + consumed, parse->outcaps, &output); if (res != GST_FLOW_OK) goto done; @@ -128,10 +140,11 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: GST_DEBUG("Setup subband codec"); - if (parse->buffer) { - gst_buffer_unref(parse->buffer); - parse->buffer = NULL; - } + + parse->channels = -1; + parse->rate = -1; + parse->first_parsing = TRUE; + sbc_init(&parse->sbc, 0); break; @@ -142,8 +155,12 @@ static GstStateChangeReturn sbc_parse_change_state(GstElement *element, gst_buffer_unref(parse->buffer); parse->buffer = NULL; } - sbc_finish(&parse->sbc); + if (parse->outcaps != NULL) { + gst_caps_unref(parse->outcaps); + parse->outcaps = NULL; + } + sbc_finish(&parse->sbc); break; default: @@ -189,6 +206,12 @@ static void gst_sbc_parse_init(GstSbcParse *self, GstSbcParseClass *klass) self->srcpad = gst_pad_new_from_static_template( &sbc_parse_src_factory, "src"); gst_element_add_pad(GST_ELEMENT(self), self->srcpad); + + self->outcaps = NULL; + self->buffer = NULL; + self->channels = -1; + self->rate = -1; + self->first_parsing = TRUE; } gboolean gst_sbc_parse_plugin_init (GstPlugin * plugin) -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- audio/gstsbcparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 80bf23a2..7b30dd2d 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -2,7 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * - * Copyright (C) 2004-2007 Marcel Holtmann + * Copyright (C) 2004-2008 Marcel Holtmann * * * This library is free software; you can redistribute it and/or -- cgit From 41387ca1ae954c4b8ea99e8e4e1646198af254a7 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 20 Feb 2008 13:37:00 +0000 Subject: Fix runtime warnings of gstreamer plugin. --- audio/gstsbcparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'audio/gstsbcparse.c') diff --git a/audio/gstsbcparse.c b/audio/gstsbcparse.c index 7b30dd2d..4521c563 100644 --- a/audio/gstsbcparse.c +++ b/audio/gstsbcparse.c @@ -51,10 +51,10 @@ static GstStaticPadTemplate sbc_parse_src_factory = GST_STATIC_CAPS("audio/x-sbc, " "rate = (int) { 16000, 32000, 44100, 48000 }, " "channels = (int) [ 1, 2 ], " - "mode = (string) { mono, dual, stereo, joint }, " + "mode = (string) { \"mono\", \"dual\", \"stereo\", \"joint\" }, " "blocks = (int) { 4, 8, 12, 16 }, " "subbands = (int) { 4, 8 }, " - "allocation = (string) { snr, loudness }," + "allocation = (string) { \"snr\", \"loudness\" }," "bitpool = (int) [ 2, 64 ]," "parsed = (boolean) true")); -- cgit