summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--audio/gstbluetooth.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/audio/gstbluetooth.c b/audio/gstbluetooth.c
index 58655573..8c07bae3 100644
--- a/audio/gstbluetooth.c
+++ b/audio/gstbluetooth.c
@@ -29,10 +29,31 @@
#include "gstsbcdec.h"
#include "gsta2dpsink.h"
+static GstStaticCaps sbc_caps = GST_STATIC_CAPS("audio/x-sbc");
+
+#define SBC_CAPS (gst_static_caps_get(&sbc_caps))
+
+static void sbc_typefind(GstTypeFind *tf, gpointer ignore)
+{
+ guint8 *data = gst_type_find_peek(tf, 0, 1);
+
+ if (*data != 0x9c) /* SBC syncword */
+ return;
+
+ gst_type_find_suggest(tf, GST_TYPE_FIND_POSSIBLE, SBC_CAPS);
+}
+
+static gchar *sbc_exts[] = { "sbc", NULL };
+
static gboolean plugin_init(GstPlugin *plugin)
{
GST_INFO("Bluetooth plugin %s", VERSION);
+ if (gst_type_find_register(plugin, "sbc",
+ GST_RANK_PRIMARY, sbc_typefind, sbc_exts,
+ SBC_CAPS, NULL, NULL) == FALSE)
+ return FALSE;
+
if (gst_element_register(plugin, "sbcenc",
GST_RANK_NONE, GST_TYPE_SBC_ENC) == FALSE)
return FALSE;