3 * BlueZ - Bluetooth protocol stack for Linux
5 * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
32 #include "gstsbcutil.h"
35 #include "gstsbcenc.h"
36 #include "gstsbcdec.h"
37 #include "gstsbcparse.h"
38 #include "gstavdtpsink.h"
39 #include "gsta2dpsink.h"
40 #include "gstrtpsbcpay.h"
42 static GstStaticCaps sbc_caps = GST_STATIC_CAPS("audio/x-sbc");
44 #define SBC_CAPS (gst_static_caps_get(&sbc_caps))
46 static void sbc_typefind(GstTypeFind *tf, gpointer ignore)
51 guint8 *data = gst_type_find_peek(tf, 0, 32);
56 if (sbc_init(&sbc, 0) < 0)
59 aux = g_new(guint8, 32);
60 memcpy(aux, data, 32);
61 if (sbc_parse(&sbc, aux, 32) < 0)
64 caps = gst_sbc_parse_caps_from_sbc(&sbc);
65 gst_type_find_suggest(tf, GST_TYPE_FIND_POSSIBLE, caps);
73 static gchar *sbc_exts[] = { "sbc", NULL };
75 static gboolean plugin_init(GstPlugin *plugin)
77 GST_INFO("Bluetooth plugin %s", VERSION);
79 if (gst_type_find_register(plugin, "sbc",
80 GST_RANK_PRIMARY, sbc_typefind, sbc_exts,
81 SBC_CAPS, NULL, NULL) == FALSE)
84 if (!gst_sbc_enc_plugin_init(plugin))
87 if (!gst_sbc_dec_plugin_init(plugin))
90 if (!gst_sbc_parse_plugin_init(plugin))
93 if (!gst_avdtp_sink_plugin_init(plugin))
96 if (!gst_a2dp_sink_plugin_init(plugin))
99 if (!gst_rtp_sbc_pay_plugin_init(plugin))
105 extern GstPluginDesc gst_plugin_desc __attribute__ ((visibility("default")));
107 GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,
108 "bluetooth", "Bluetooth plugin library",
109 plugin_init, VERSION, "LGPL", "BlueZ", "http://www.bluez.org/")