decklink fbdev linsys vcd \
apexsink cdaudio cog dc1394 dirac directfb \
gsettings jasper ladspa \
- musepack musicbrainz nas neon ofa openal opensles rsvg sdl sndfile timidity \
+ musepack musicbrainz nas neon ofa openal rsvg sdl sndfile timidity \
directdraw direct3d9 acm wininet \
wildmidi xvid lv2 teletextdec sndio uvch264"
AC_SUBST(GST_PLUGINS_NONPORTED)
libgstopensles_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) \
-Wno-deprecated-declarations
libgstopensles_la_LIBADD = \
- -lgstinterfaces-@GST_MAJORMINOR@ \
- -lgstaudio-@GST_MAJORMINOR@ \
+ -lgstaudio-@GST_API_VERSION@ \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_BASE_LIBS) \
$(GST_LIBS)
libgstopensles_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -lOpenSLES
-libgstopensles_la_LIBTOOLFLAGS = --tag=disable-static --tag=CC
+libgstopensles_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS)
noinst_HEADERS = openslesringbuffer.h \
openslessink.h \
return TRUE;
}
-GST_PLUGIN_DEFINE2 (GST_VERSION_MAJOR,
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
opensles,
"OpenSL ES support for GStreamer",
GST_DEBUG_CATEGORY_STATIC (opensles_ringbuffer_debug);
#define GST_CAT_DEFAULT opensles_ringbuffer_debug
-static GstRingBufferClass *ring_parent_class = NULL;
-
-static void
-_do_init (GType type)
-{
- GST_DEBUG_CATEGORY_INIT (opensles_ringbuffer_debug,
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (opensles_ringbuffer_debug, \
"opensles_ringbuffer", 0, "OpenSL ES ringbuffer");
-}
-GST_BOILERPLATE_FULL (GstOpenSLESRingBuffer, gst_opensles_ringbuffer,
- GstRingBuffer, GST_TYPE_RING_BUFFER, _do_init);
+#define parent_class gst_opensles_ringbuffer_parent_class
+G_DEFINE_TYPE_WITH_CODE (GstOpenSLESRingBuffer, gst_opensles_ringbuffer,
+ GST_TYPE_AUDIO_RING_BUFFER, _do_init);
/*
* Some generic helper functions
}
static inline SLuint32
-_opensles_channel_mask (GstRingBufferSpec * spec)
+_opensles_channel_mask (GstAudioRingBufferSpec * spec)
{
- switch (spec->channels) {
+ switch (spec->info.channels) {
case 1:
return (SL_SPEAKER_FRONT_CENTER);
case 2:
}
static inline void
-_opensles_format (GstRingBufferSpec * spec, SLDataFormat_PCM * format)
+_opensles_format (GstAudioRingBufferSpec * spec, SLDataFormat_PCM * format)
{
format->formatType = SL_DATAFORMAT_PCM;
- format->numChannels = spec->channels;
- format->samplesPerSec = _opensles_sample_rate (spec->rate);
- format->bitsPerSample = spec->depth;
- format->containerSize = spec->width;
+ format->numChannels = spec->info.channels;
+ format->samplesPerSec = _opensles_sample_rate (spec->info.rate);
+ format->bitsPerSample = spec->info.finfo->depth;
+ format->containerSize = spec->info.finfo->width;
format->channelMask = _opensles_channel_mask (spec);
format->endianness =
- (spec->bigend ? SL_BYTEORDER_BIGENDIAN : SL_BYTEORDER_LITTLEENDIAN);
+ ((spec->info.finfo->endianness ==
+ G_BIG_ENDIAN) ? SL_BYTEORDER_BIGENDIAN : SL_BYTEORDER_LITTLEENDIAN);
}
/*
*/
static gboolean
-_opensles_recorder_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
+_opensles_recorder_acquire (GstAudioRingBuffer * rb,
+ GstAudioRingBufferSpec * spec)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
static void
_opensles_recorder_cb (SLAndroidSimpleBufferQueueItf bufferQueue, void *context)
{
- GstRingBuffer *rb = GST_RING_BUFFER_CAST (context);
+ GstAudioRingBuffer *rb = GST_AUDIO_RING_BUFFER_CAST (context);
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
guint8 *ptr;
/* Advance only when we are called by the callback function */
if (bufferQueue) {
- gst_ring_buffer_advance (rb, 1);
+ gst_audio_ring_buffer_advance (rb, 1);
}
/* Get a segment form the GStreamer ringbuffer to write in */
- if (!gst_ring_buffer_prepare_read (rb, &seg, &ptr, &len)) {
+ if (!gst_audio_ring_buffer_prepare_read (rb, &seg, &ptr, &len)) {
GST_WARNING_OBJECT (rb, "No segment available");
return;
}
}
static gboolean
-_opensles_recorder_start (GstRingBuffer * rb)
+_opensles_recorder_start (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
}
static gboolean
-_opensles_recorder_stop (GstRingBuffer * rb)
+_opensles_recorder_stop (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
*/
static gboolean
-_opensles_player_change_volume (GstRingBuffer * rb)
+_opensles_player_change_volume (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
SLresult result;
}
static gboolean
-_opensles_player_change_mute (GstRingBuffer * rb)
+_opensles_player_change_mute (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
SLresult result;
}
static gboolean
-_opensles_player_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
+_opensles_player_acquire (GstAudioRingBuffer * rb,
+ GstAudioRingBufferSpec * spec)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
static void
_opensles_player_cb (SLAndroidSimpleBufferQueueItf bufferQueue, void *context)
{
- GstRingBuffer *rb = GST_RING_BUFFER_CAST (context);
+ GstAudioRingBuffer *rb = GST_AUDIO_RING_BUFFER_CAST (context);
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
guint8 *ptr, *cur;
gint len;
/* Get a segment form the GStreamer ringbuffer to read some samples */
- if (!gst_ring_buffer_prepare_read (rb, &seg, &ptr, &len)) {
+ if (!gst_audio_ring_buffer_prepare_read (rb, &seg, &ptr, &len)) {
GST_WARNING_OBJECT (rb, "No segment available");
return;
}
}
/* Fill with silence samples the segment of the GStreamer ringbuffer */
- gst_ring_buffer_clear (rb, seg);
+ gst_audio_ring_buffer_clear (rb, seg);
/* Make the segment reusable */
- gst_ring_buffer_advance (rb, 1);
+ gst_audio_ring_buffer_advance (rb, 1);
}
static gboolean
-_opensles_player_start (GstRingBuffer * rb)
+_opensles_player_start (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
}
static gboolean
-_opensles_player_pause (GstRingBuffer * rb)
+_opensles_player_pause (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
}
static gboolean
-_opensles_player_stop (GstRingBuffer * rb)
+_opensles_player_stop (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz = GST_OPENSLES_RING_BUFFER_CAST (rb);
SLresult result;
* OpenSL ES ringbuffer wrapper
*/
-GstRingBuffer *
+GstAudioRingBuffer *
gst_opensles_ringbuffer_new (RingBufferMode mode)
{
GstOpenSLESRingBuffer *thiz;
GST_DEBUG_OBJECT (thiz, "ringbuffer created");
- return GST_RING_BUFFER (thiz);
+ return GST_AUDIO_RING_BUFFER (thiz);
}
void
-gst_opensles_ringbuffer_set_volume (GstRingBuffer * rb, gfloat volume)
+gst_opensles_ringbuffer_set_volume (GstAudioRingBuffer * rb, gfloat volume)
{
GstOpenSLESRingBuffer *thiz;
}
void
-gst_opensles_ringbuffer_set_mute (GstRingBuffer * rb, gboolean mute)
+gst_opensles_ringbuffer_set_mute (GstAudioRingBuffer * rb, gboolean mute)
{
GstOpenSLESRingBuffer *thiz;
}
static gboolean
-gst_opensles_ringbuffer_open_device (GstRingBuffer * rb)
+gst_opensles_ringbuffer_open_device (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
SLresult result;
}
static gboolean
-gst_opensles_ringbuffer_close_device (GstRingBuffer * rb)
+gst_opensles_ringbuffer_close_device (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
}
static gboolean
-gst_opensles_ringbuffer_acquire (GstRingBuffer * rb, GstRingBufferSpec * spec)
+gst_opensles_ringbuffer_acquire (GstAudioRingBuffer * rb,
+ GstAudioRingBufferSpec * spec)
{
GstOpenSLESRingBuffer *thiz;
}
/* Initialize our ringbuffer memory region */
- rb->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize);
- memset (GST_BUFFER_DATA (rb->data), 0, GST_BUFFER_SIZE (rb->data));
+ rb->size = spec->segtotal * spec->segsize;
+ rb->memory = g_malloc0 (rb->size);
GST_DEBUG_OBJECT (thiz, "ringbuffer acquired");
return TRUE;
}
static gboolean
-gst_opensles_ringbuffer_release (GstRingBuffer * rb)
+gst_opensles_ringbuffer_release (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
thiz->data = NULL;
}
- if (rb->data) {
- gst_buffer_unref (rb->data);
- rb->data = NULL;
+ if (rb->memory) {
+ g_free (rb->memory);
+ rb->memory = NULL;
+ rb->size = 0;
}
GST_DEBUG_OBJECT (thiz, "ringbuffer released");
}
static gboolean
-gst_opensles_ringbuffer_start (GstRingBuffer * rb)
+gst_opensles_ringbuffer_start (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
gboolean res;
}
static gboolean
-gst_opensles_ringbuffer_pause (GstRingBuffer * rb)
+gst_opensles_ringbuffer_pause (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
gboolean res;
}
static gboolean
-gst_opensles_ringbuffer_stop (GstRingBuffer * rb)
+gst_opensles_ringbuffer_stop (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
gboolean res;
}
static guint
-gst_opensles_ringbuffer_delay (GstRingBuffer * rb)
+gst_opensles_ringbuffer_delay (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
guint res = 0;
(*thiz->playerPlay)->GetPlayState (thiz->playerPlay, &state);
if (state == SL_PLAYSTATE_PLAYING) {
(*thiz->playerPlay)->GetPosition (thiz->playerPlay, &position);
- playedpos = gst_util_uint64_scale_round (position, rb->spec.rate, 1000);
+ playedpos =
+ gst_util_uint64_scale_round (position, rb->spec.info.rate, 1000);
queuedpos = g_atomic_int_get (&thiz->segqueued) * rb->samples_per_seg;
res = queuedpos - playedpos;
}
}
static void
-gst_opensles_ringbuffer_clear_all (GstRingBuffer * rb)
+gst_opensles_ringbuffer_clear_all (GstAudioRingBuffer * rb)
{
GstOpenSLESRingBuffer *thiz;
g_atomic_int_set (&thiz->is_prerolled, 0);
}
- GST_CALL_PARENT (GST_RING_BUFFER_CLASS, clear_all, (rb));
+ GST_CALL_PARENT (GST_AUDIO_RING_BUFFER_CLASS, clear_all, (rb));
}
static void
gst_opensles_ringbuffer_dispose (GObject * object)
{
- G_OBJECT_CLASS (ring_parent_class)->dispose (object);
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gst_opensles_ringbuffer_finalize (GObject * object)
{
- G_OBJECT_CLASS (ring_parent_class)->finalize (object);
-}
-
-static void
-gst_opensles_ringbuffer_base_init (gpointer g_class)
-{
- /* Nothing to do right now */
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gst_opensles_ringbuffer_class_init (GstOpenSLESRingBufferClass * klass)
{
GObjectClass *gobject_class;
- GstRingBufferClass *gstringbuffer_class;
+ GstAudioRingBufferClass *gstringbuffer_class;
gobject_class = (GObjectClass *) klass;
- gstringbuffer_class = (GstRingBufferClass *) klass;
-
- ring_parent_class = g_type_class_peek_parent (klass);
+ gstringbuffer_class = (GstAudioRingBufferClass *) klass;
gobject_class->dispose = gst_opensles_ringbuffer_dispose;
gobject_class->finalize = gst_opensles_ringbuffer_finalize;
}
static void
-gst_opensles_ringbuffer_init (GstOpenSLESRingBuffer * thiz,
- GstOpenSLESRingBufferClass * g_class)
+gst_opensles_ringbuffer_init (GstOpenSLESRingBuffer * thiz)
{
thiz->mode = RB_MODE_NONE;
thiz->engineObject = NULL;
#define __OPENSLESRINGBUFFER_H__
#include <gst/gst.h>
-#include <gst/audio/gstringbuffer.h>
+#include <gst/audio/gstaudioringbuffer.h>
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
RB_MODE_LAST
} RingBufferMode;
-typedef gboolean (*AcquireFunc) (GstRingBuffer * rb, GstRingBufferSpec * spec);
-typedef gboolean (*StateFunc) (GstRingBuffer * rb);
+typedef gboolean (*AcquireFunc) (GstAudioRingBuffer * rb, GstAudioRingBufferSpec * spec);
+typedef gboolean (*StateFunc) (GstAudioRingBuffer * rb);
typedef struct _GstOpenSLESRingBuffer GstOpenSLESRingBuffer;
typedef struct _GstOpenSLESRingBufferClass GstOpenSLESRingBufferClass;
struct _GstOpenSLESRingBuffer
{
- GstRingBuffer object;
+ GstAudioRingBuffer object;
RingBufferMode mode;
struct _GstOpenSLESRingBufferClass
{
- GstRingBufferClass parent_class;
+ GstAudioRingBufferClass parent_class;
};
GType gst_opensles_ringbuffer_get_type (void);
-GstRingBuffer *gst_opensles_ringbuffer_new (RingBufferMode mode);
-void gst_opensles_ringbuffer_set_volume (GstRingBuffer * rb, gfloat volume);
-void gst_opensles_ringbuffer_set_mute (GstRingBuffer * rb, gboolean mute);
+GstAudioRingBuffer *gst_opensles_ringbuffer_new (RingBufferMode mode);
+void gst_opensles_ringbuffer_set_volume (GstAudioRingBuffer * rb, gfloat volume);
+void gst_opensles_ringbuffer_set_mute (GstAudioRingBuffer * rb, gboolean mute);
G_END_DECLS
#endif /* __OPENSLESRINGBUFFER_H__ */
static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) {" G_STRINGIFY (G_BYTE_ORDER) " }, "
- "signed = (boolean) { TRUE }, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "rate = (int) { " RATES "}, "
- "channels = (int) [1, 2];"
- "audio/x-raw-int, "
- "endianness = (int) {" G_STRINGIFY (G_BYTE_ORDER) " }, "
- "signed = (boolean) { FALSE }, "
- "width = (int) 8, "
- "depth = (int) 8, "
+ GST_STATIC_CAPS ("audio/x-raw, "
+ "format = (string) { " GST_AUDIO_NE (S16) ", " GST_AUDIO_NE (U8) "}, "
"rate = (int) { " RATES "}, " "channels = (int) [1, 2]")
);
-static void
-_do_init (GType type)
-{
- GST_DEBUG_CATEGORY_INIT (opensles_sink_debug, "opensles_sink", 0,
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (opensles_sink_debug, "opensles_sink", 0, \
"OpenSL ES Sink");
-}
+#define parent_class gst_opensles_sink_parent_class
+G_DEFINE_TYPE_WITH_CODE (GstOpenSLESSink, gst_opensles_sink,
+ GST_TYPE_AUDIO_BASE_SINK, _do_init);
-GST_BOILERPLATE_FULL (GstOpenSLESSink, gst_opensles_sink, GstBaseAudioSink,
- GST_TYPE_BASE_AUDIO_SINK, _do_init);
-
-static void
-gst_opensles_sink_base_init (gpointer g_class)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
- gst_element_class_add_static_pad_template (element_class, &sink_factory);
-
- gst_element_class_set_details_simple (element_class, "OpenSL ES Sink",
- "Sink/Audio",
- "Output sound using the OpenSL ES APIs",
- "Josep Torra <support@fluendo.com>");
-}
-
-static GstRingBuffer *
-gst_opensles_sink_create_ringbuffer (GstBaseAudioSink * base)
+static GstAudioRingBuffer *
+gst_opensles_sink_create_ringbuffer (GstAudioBaseSink * base)
{
GstOpenSLESSink *sink = GST_OPENSLES_SINK (base);
- GstRingBuffer *rb;
+ GstAudioRingBuffer *rb;
rb = gst_opensles_ringbuffer_new (RB_MODE_SINK_PCM);
gst_opensles_ringbuffer_set_volume (rb, sink->volume);
const GValue * value, GParamSpec * pspec)
{
GstOpenSLESSink *sink = GST_OPENSLES_SINK (object);
- GstRingBuffer *rb = GST_BASE_AUDIO_SINK (sink)->ringbuffer;
+ GstAudioRingBuffer *rb = GST_AUDIO_BASE_SINK (sink)->ringbuffer;
switch (prop_id) {
case PROP_VOLUME:
gst_opensles_sink_class_init (GstOpenSLESSinkClass * klass)
{
GObjectClass *gobject_class;
- GstBaseAudioSinkClass *gstbaseaudiosink_class;
+ GstElementClass *gstelement_class;
+ GstAudioBaseSinkClass *gstbaseaudiosink_class;
gobject_class = (GObjectClass *) klass;
- gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
-
- parent_class = g_type_class_peek_parent (klass);
+ gstelement_class = (GstElementClass *) klass;
+ gstbaseaudiosink_class = (GstAudioBaseSinkClass *) klass;
gobject_class->set_property = gst_opensles_sink_set_property;
gobject_class->get_property = gst_opensles_sink_get_property;
g_param_spec_boolean ("mute", "Mute", "Mute state of this stream",
DEFAULT_MUTE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&sink_factory));
+
+ gst_element_class_set_static_metadata (gstelement_class, "OpenSL ES Sink",
+ "Sink/Audio",
+ "Output sound using the OpenSL ES APIs",
+ "Josep Torra <support@fluendo.com>");
+
gstbaseaudiosink_class->create_ringbuffer =
GST_DEBUG_FUNCPTR (gst_opensles_sink_create_ringbuffer);
}
static void
-gst_opensles_sink_init (GstOpenSLESSink * sink, GstOpenSLESSinkClass * gclass)
+gst_opensles_sink_init (GstOpenSLESSink * sink)
{
sink->volume = DEFAULT_VOLUME;
sink->mute = DEFAULT_MUTE;
_opensles_query_capabilities (sink);
- gst_base_audio_sink_set_provide_clock (GST_BASE_AUDIO_SINK (sink), TRUE);
+ gst_audio_base_sink_set_provide_clock (GST_AUDIO_BASE_SINK (sink), TRUE);
/* Override some default values to fit on the AudioFlinger behaviour of
* processing 20ms buffers as minimum buffer size. */
- GST_BASE_AUDIO_SINK (sink)->buffer_time = 400000;
- GST_BASE_AUDIO_SINK (sink)->latency_time = 20000;
+ GST_AUDIO_BASE_SINK (sink)->buffer_time = 400000;
+ GST_AUDIO_BASE_SINK (sink)->latency_time = 20000;
}
#define __OPENSLESSINK_H__
#include <gst/gst.h>
-#include <gst/audio/gstbaseaudiosink.h>
+#include <gst/audio/gstaudiobasesink.h>
#include "openslesringbuffer.h"
G_BEGIN_DECLS
struct _GstOpenSLESSink
{
- GstBaseAudioSink sink;
+ GstAudioBaseSink sink;
gfloat volume;
gboolean mute;
struct _GstOpenSLESSinkClass
{
- GstBaseAudioSinkClass parent_class;
+ GstAudioBaseSinkClass parent_class;
};
GType gst_opensles_sink_get_type (void);
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) {" G_STRINGIFY (G_BYTE_ORDER) " }, "
- "signed = (boolean) { TRUE }, "
- "width = (int) 16, "
- "depth = (int) 16, "
- "rate = (int) 16000, "
+ GST_STATIC_CAPS ("audio/x-raw, "
+ "format = (string) " GST_AUDIO_NE (S16) ", "
+ "rate = (int) { 16000 }, "
"channels = (int) 1")
);
/* *INDENT-ON* */
-static void
-_do_init (GType type)
-{
- GST_DEBUG_CATEGORY_INIT (opensles_src_debug, "opensles_src", 0,
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (opensles_src_debug, "opensles_src", 0, \
"OpenSL ES Src");
-}
+#define parent_class gst_opensles_src_parent_class
+G_DEFINE_TYPE_WITH_CODE (GstOpenSLESSrc, gst_opensles_src,
+ GST_TYPE_AUDIO_BASE_SRC, _do_init);
-GST_BOILERPLATE_FULL (GstOpenSLESSrc, gst_opensles_src, GstBaseAudioSrc,
- GST_TYPE_BASE_AUDIO_SRC, _do_init);
-
-static void
-gst_opensles_src_base_init (gpointer g_class)
+static GstAudioRingBuffer *
+gst_opensles_src_create_ringbuffer (GstAudioBaseSrc * base)
{
- GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
-
- gst_element_class_add_static_pad_template (element_class, &src_factory);
-
- gst_element_class_set_details_simple (element_class, "OpenSL ES Src",
- "Src/Audio",
- "Input sound using the OpenSL ES APIs",
- "Josep Torra <support@fluendo.com>");
-}
-
-static GstRingBuffer *
-gst_opensles_src_create_ringbuffer (GstBaseAudioSrc * base)
-{
- GstRingBuffer *rb;
+ GstAudioRingBuffer *rb;
rb = gst_opensles_ringbuffer_new (RB_MODE_SRC);
static void
gst_opensles_src_class_init (GstOpenSLESSrcClass * klass)
{
- GstBaseAudioSrcClass *gstbaseaudiosrc_class;
+ GstElementClass *gstelement_class;
+ GstAudioBaseSrcClass *gstaudiobasesrc_class;
- gstbaseaudiosrc_class = (GstBaseAudioSrcClass *) klass;
+ gstelement_class = (GstElementClass *) klass;
+ gstaudiobasesrc_class = (GstAudioBaseSrcClass *) klass;
- parent_class = g_type_class_peek_parent (klass);
+ gst_element_class_add_pad_template (gstelement_class,
+ gst_static_pad_template_get (&src_factory));
+
+ gst_element_class_set_static_metadata (gstelement_class, "OpenSL ES Src",
+ "Src/Audio",
+ "Input sound using the OpenSL ES APIs",
+ "Josep Torra <support@fluendo.com>");
- gstbaseaudiosrc_class->create_ringbuffer =
+ gstaudiobasesrc_class->create_ringbuffer =
GST_DEBUG_FUNCPTR (gst_opensles_src_create_ringbuffer);
}
static void
-gst_opensles_src_init (GstOpenSLESSrc * src, GstOpenSLESSrcClass * gclass)
+gst_opensles_src_init (GstOpenSLESSrc * src)
{
/* Override some default values to fit on the AudioFlinger behaviour of
* processing 20ms buffers as minimum buffer size. */
- GST_BASE_AUDIO_SRC (src)->buffer_time = 400000;
- GST_BASE_AUDIO_SRC (src)->latency_time = 20000;
+ GST_AUDIO_BASE_SRC (src)->buffer_time = 400000;
+ GST_AUDIO_BASE_SRC (src)->latency_time = 20000;
}
#define __OPENSLESSRC_H__
#include <gst/gst.h>
-#include <gst/audio/gstbaseaudiosrc.h>
+#include <gst/audio/gstaudiobasesrc.h>
#include "openslesringbuffer.h"
G_BEGIN_DECLS
struct _GstOpenSLESSrc
{
- GstBaseAudioSrc src;
+ GstAudioBaseSrc src;
};
struct _GstOpenSLESSrcClass
{
- GstBaseAudioSrcClass parent_class;
+ GstAudioBaseSrcClass parent_class;
};
GType gst_opensles_src_get_type (void);