mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
sbc: Add SBC encoder and decoder skeletons for GStreamer
This commit is contained in:
commit
974757b2f7
4 changed files with 234 additions and 0 deletions
62
ext/sbc/gstsbcdec.c
Normal file
62
ext/sbc/gstsbcdec.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
|
||||
*
|
||||
*
|
||||
* 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 <config.h>
|
||||
#endif
|
||||
|
||||
#include "sbc.h"
|
||||
|
||||
#include "gstsbcdec.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (sbc_dec_debug);
|
||||
#define GST_CAT_DEFAULT sbc_dec_debug
|
||||
|
||||
GST_BOILERPLATE (GstSbcDec, gst_sbc_dec, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
static const GstElementDetails sbc_dec_details =
|
||||
GST_ELEMENT_DETAILS ("Bluetooth SBC decoder",
|
||||
"Codec/Decoder/Audio",
|
||||
"Decode a SBC audio stream",
|
||||
"Marcel Holtmann <marcel@holtmann.org>");
|
||||
|
||||
static void
|
||||
gst_sbc_dec_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &sbc_dec_details);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_sbc_dec_class_init (GstSbcDecClass * klass)
|
||||
{
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (sbc_dec_debug, "sbcdec", 0, "SBC decoding element");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_sbc_dec_init (GstSbcDec * sbcdec, GstSbcDecClass * klass)
|
||||
{
|
||||
}
|
55
ext/sbc/gstsbcdec.h
Normal file
55
ext/sbc/gstsbcdec.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_SBC_DEC \
|
||||
(gst_sbc_dec_get_type())
|
||||
#define GST_SBC_DEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SBC_DEC,GstSbcDec))
|
||||
#define GST_SBC_DEC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SBC_DEC,GstSbcDecClass))
|
||||
#define GST_IS_SBC_DEC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SBC_DEC))
|
||||
#define GST_IS_SBC_DEC_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SBC_DEC))
|
||||
|
||||
typedef struct _GstSbcDec GstSbcDec;
|
||||
typedef struct _GstSbcDecClass GstSbcDecClass;
|
||||
|
||||
struct _GstSbcDec {
|
||||
GstElement element;
|
||||
|
||||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
};
|
||||
|
||||
struct _GstSbcDecClass {
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_sbc_dec_get_type(void);
|
||||
|
||||
G_END_DECLS
|
62
ext/sbc/gstsbcenc.c
Normal file
62
ext/sbc/gstsbcenc.c
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
|
||||
*
|
||||
*
|
||||
* 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 <config.h>
|
||||
#endif
|
||||
|
||||
#include "sbc.h"
|
||||
|
||||
#include "gstsbcenc.h"
|
||||
|
||||
GST_DEBUG_CATEGORY_STATIC (sbc_enc_debug);
|
||||
#define GST_CAT_DEFAULT sbc_enc_debug
|
||||
|
||||
GST_BOILERPLATE (GstSbcEnc, gst_sbc_enc, GstElement, GST_TYPE_ELEMENT);
|
||||
|
||||
static const GstElementDetails sbc_enc_details =
|
||||
GST_ELEMENT_DETAILS ("Bluetooth SBC encoder",
|
||||
"Codec/Encoder/Audio",
|
||||
"Encode a SBC audio stream",
|
||||
"Marcel Holtmann <marcel@holtmann.org>");
|
||||
|
||||
static void
|
||||
gst_sbc_enc_base_init (gpointer g_class)
|
||||
{
|
||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||
|
||||
gst_element_class_set_details (element_class, &sbc_enc_details);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_sbc_enc_class_init (GstSbcEncClass * klass)
|
||||
{
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (sbc_enc_debug, "sbcenc", 0, "SBC encoding element");
|
||||
}
|
||||
|
||||
static void
|
||||
gst_sbc_enc_init (GstSbcEnc * sbcenc, GstSbcEncClass * klass)
|
||||
{
|
||||
}
|
55
ext/sbc/gstsbcenc.h
Normal file
55
ext/sbc/gstsbcenc.h
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
*
|
||||
* BlueZ - Bluetooth protocol stack for Linux
|
||||
*
|
||||
* Copyright (C) 2004-2007 Marcel Holtmann <marcel@holtmann.org>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
|
||||
#include <gst/gst.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GST_TYPE_SBC_ENC \
|
||||
(gst_sbc_enc_get_type())
|
||||
#define GST_SBC_ENC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SBC_ENC,GstSbcEnc))
|
||||
#define GST_SBC_ENC_CLASS(klass) \
|
||||
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SBC_ENC,GstSbcEncClass))
|
||||
#define GST_IS_SBC_ENC(obj) \
|
||||
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SBC_ENC))
|
||||
#define GST_IS_SBC_ENC_CLASS(obj) \
|
||||
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SBC_ENC))
|
||||
|
||||
typedef struct _GstSbcEnc GstSbcEnc;
|
||||
typedef struct _GstSbcEncClass GstSbcEncClass;
|
||||
|
||||
struct _GstSbcEnc {
|
||||
GstElement element;
|
||||
|
||||
GstPad *sinkpad;
|
||||
GstPad *srcpad;
|
||||
};
|
||||
|
||||
struct _GstSbcEncClass {
|
||||
GstElementClass parent_class;
|
||||
};
|
||||
|
||||
GType gst_sbc_enc_get_type(void);
|
||||
|
||||
G_END_DECLS
|
Loading…
Reference in a new issue