From 86e6343759e9d296a646c7d17cdc6228b2dd3eb4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 5 Sep 2011 15:01:09 +0100 Subject: [PATCH] audio: rename GstBaseAudioDecoder/Encoder to GstAudioDecoder/Encoder API: gst_gst_audio_decoder_finish_frame() API: gst_gst_audio_decoder_get_audio_info() API: gst_gst_audio_decoder_get_byte_time() API: gst_gst_audio_decoder_get_delay() API: gst_gst_audio_decoder_get_latency() API: gst_gst_audio_decoder_get_max_errors() API: gst_gst_audio_decoder_get_min_latenc()y API: gst_gst_audio_decoder_get_parse_state() API: gst_gst_audio_decoder_get_plc() API: gst_gst_audio_decoder_get_plc_aware() API: gst_gst_audio_decoder_get_tolerance() API: gst_gst_audio_decoder_get_type() API: gst_gst_audio_decoder_set_byte_time() API: gst_gst_audio_decoder_set_latency() API: gst_gst_audio_decoder_set_max_errors() API: gst_gst_audio_decoder_set_min_latency() API: gst_gst_audio_decoder_set_plc() API: gst_gst_audio_decoder_set_plc_aware() API: gst_gst_audio_decoder_set_tolerance() API: gst_gst_audio_encoder_finish_frame() API: gst_gst_audio_encoder_get_audio_info() API: gst_gst_audio_encoder_get_frame_max() API: gst_gst_audio_encoder_get_frame_samples() API: gst_gst_audio_encoder_get_hard_resync() API: gst_gst_audio_encoder_get_latency() API: gst_gst_audio_encoder_get_lookahead() API: gst_gst_audio_encoder_get_mark_granule() API: gst_gst_audio_encoder_get_perfect_timestamp() API: gst_gst_audio_encoder_get_tolerance() API: gst_gst_audio_encoder_get_type() API: gst_gst_audio_encoder_proxy_getcaps() API: gst_gst_audio_encoder_set_frame_max() API: gst_gst_audio_encoder_set_frame_samples() API: gst_gst_audio_encoder_set_hard_resync() API: gst_gst_audio_encoder_set_latency() API: gst_gst_audio_encoder_set_lookahead() API: gst_gst_audio_encoder_set_mark_granule() API: gst_gst_audio_encoder_set_perfect_timestamp() API: gst_gst_audio_encoder_set_tolerance() https://bugzilla.gnome.org/show_bug.cgi?id=642690 --- gst-libs/gst/audio/Makefile.am | 9 +- .../{gstbaseaudiodecoder.c => gstaudiodecoder.c} | 516 ++++++++++----------- .../{gstbaseaudiodecoder.h => gstaudiodecoder.h} | 166 +++---- .../{gstbaseaudioencoder.c => gstaudioencoder.c} | 455 +++++++++--------- gst-libs/gst/audio/gstaudioencoder.h | 244 ++++++++++ gst-libs/gst/audio/gstbaseaudioencoder.h | 235 ---------- win32/common/libgstaudio.def | 80 ++-- 7 files changed, 847 insertions(+), 858 deletions(-) rename gst-libs/gst/audio/{gstbaseaudiodecoder.c => gstaudiodecoder.c} (79%) rename gst-libs/gst/audio/{gstbaseaudiodecoder.h => gstaudiodecoder.h} (55%) rename gst-libs/gst/audio/{gstbaseaudioencoder.c => gstaudioencoder.c} (79%) create mode 100644 gst-libs/gst/audio/gstaudioencoder.h delete mode 100644 gst-libs/gst/audio/gstbaseaudioencoder.h diff --git a/gst-libs/gst/audio/Makefile.am b/gst-libs/gst/audio/Makefile.am index b710c20..e26ac5d 100644 --- a/gst-libs/gst/audio/Makefile.am +++ b/gst-libs/gst/audio/Makefile.am @@ -16,14 +16,15 @@ lib_LTLIBRARIES = \ CLEANFILES = $(BUILT_SOURCES) +# FIXME 0.11: rename GstBaseAudioSink to GstAudioBaseSink or merge with GstAudioSink libgstaudio_@GST_MAJORMINOR@_la_SOURCES = \ audio.c \ gstringbuffer.c \ gstaudioclock.c \ mixerutils.c \ multichannel.c \ - gstbaseaudiodecoder.c \ - gstbaseaudioencoder.c \ + gstaudiodecoder.c \ + gstaudioencoder.c \ gstbaseaudiosink.c \ gstbaseaudiosrc.c \ gstaudiofilter.c \ @@ -38,8 +39,8 @@ libgstaudio_@GST_MAJORMINOR@include_HEADERS = \ gstringbuffer.h \ gstaudioclock.h \ gstaudiofilter.h \ - gstbaseaudiodecoder.h \ - gstbaseaudioencoder.h \ + gstaudiodecoder.h \ + gstaudioencoder.h \ gstbaseaudiosink.h \ gstbaseaudiosrc.h \ gstaudiosink.h \ diff --git a/gst-libs/gst/audio/gstbaseaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c similarity index 79% rename from gst-libs/gst/audio/gstbaseaudiodecoder.c rename to gst-libs/gst/audio/gstaudiodecoder.c index 08441b9..087baac 100644 --- a/gst-libs/gst/audio/gstbaseaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@ -22,7 +22,7 @@ */ /** - * SECTION:gstbaseaudiodecoder + * SECTION:gstaudiodecoder * @short_description: Base class for audio decoders * @see_also: #GstBaseTransform * @since: 0.10.36 @@ -30,29 +30,29 @@ * This base class is for audio decoders turning encoded data into * raw audio samples. * - * GstBaseAudioDecoder and subclass should cooperate as follows. + * GstAudioDecoder and subclass should cooperate as follows. * * * Configuration * - * Initially, GstBaseAudioDecoder calls @start when the decoder element + * Initially, GstAudioDecoder calls @start when the decoder element * is activated, which allows subclass to perform any global setup. * Base class (context) parameters can already be set according to subclass * capabilities (or possibly upon receive more information in subsequent * @set_format). * * - * GstBaseAudioDecoder calls @set_format to inform subclass of the format + * GstAudioDecoder calls @set_format to inform subclass of the format * of input audio data that it is about to receive. * While unlikely, it might be called more than once, if changing input * parameters require reconfiguration. * * - * GstBaseAudioDecoder calls @stop at end of all processing. + * GstAudioDecoder calls @stop at end of all processing. * * * - * As of configuration stage, and throughout processing, GstBaseAudioDecoder + * As of configuration stage, and throughout processing, GstAudioDecoder * provides various (context) parameters, e.g. describing the format of * output audio data (valid when output caps have been caps) or current parsing state. * Conversely, subclass can and should configure context to inform @@ -71,7 +71,7 @@ * * * If codec processing results in decoded data, subclass should call - * @gst_base_audio_decoder_finish_frame to have decoded data pushed + * @gst_audio_decoder_finish_frame to have decoded data pushed * downstream. * * @@ -82,7 +82,7 @@ * setting src pad caps. * * - * During the parsing process GstBaseAudioDecoderClass will handle both + * During the parsing process GstAudioDecoderClass will handle both * srcpad and sinkpad events. Sink events will be passed to subclass * if @event callback has been provided. * @@ -91,7 +91,7 @@ * * Shutdown phase * - * GstBaseAudioDecoder class calls @stop to inform the subclass that data + * GstAudioDecoder class calls @stop to inform the subclass that data * parsing will be stopped. * * @@ -102,7 +102,7 @@ * source and sink pads. The pads need to be named "sink" and "src". It also * needs to set the fixed caps on srcpad, when the format is ensured. This * is typically when base class calls subclass' @set_format function, though - * it might be delayed until calling @gst_base_audio_decoder_finish_frame. + * it might be delayed until calling @gst_audio_decoder_finish_frame. * * In summary, above process should have subclass concentrating on * codec data processing while leaving other matters to base class, @@ -112,7 +112,7 @@ * In particular, base class will try to arrange for perfect output timestamps * as much as possible while tracking upstream timestamps. * To this end, if deviation between the next ideal expected perfect timestamp - * and upstream exceeds #GstBaseAudioDecoder:tolerance, then resync to upstream + * and upstream exceeds #GstAudioDecoder:tolerance, then resync to upstream * occurs (which would happen always if the tolerance mechanism is disabled). * * In non-live pipelines, baseclass can also (configurably) arrange for @@ -138,7 +138,7 @@ * * * Accept data in @handle_frame and provide encoded results to - * @gst_base_audio_decoder_finish_frame. If it is prepared to perform + * @gst_audio_decoder_finish_frame. If it is prepared to perform * PLC, it should also accept NULL data in @handle_frame and provide for * data for indicated duration. * @@ -150,17 +150,17 @@ #endif #define GST_USE_UNSTABLE_API -#include "gstbaseaudiodecoder.h" +#include "gstaudiodecoder.h" #include #include -GST_DEBUG_CATEGORY (baseaudiodecoder_debug); -#define GST_CAT_DEFAULT baseaudiodecoder_debug +GST_DEBUG_CATEGORY (audiodecoder_debug); +#define GST_CAT_DEFAULT audiodecoder_debug -#define GST_BASE_AUDIO_DECODER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_AUDIO_DECODER, \ - GstBaseAudioDecoderPrivate)) +#define GST_AUDIO_DECODER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_AUDIO_DECODER, \ + GstAudioDecoderPrivate)) enum { @@ -179,7 +179,7 @@ enum #define DEFAULT_TOLERANCE 0 #define DEFAULT_PLC FALSE -typedef struct _GstBaseAudioDecoderContext +typedef struct _GstAudioDecoderContext { /* input */ /* (output) audio format */ @@ -199,9 +199,9 @@ typedef struct _GstBaseAudioDecoderContext /* MT-protected (with LOCK) */ GstClockTime min_latency; GstClockTime max_latency; -} GstBaseAudioDecoderContext; +} GstAudioDecoderContext; -struct _GstBaseAudioDecoderPrivate +struct _GstAudioDecoderPrivate { /* activation status */ gboolean active; @@ -253,7 +253,7 @@ struct _GstBaseAudioDecoderPrivate GList *queued; /* context storage */ - GstBaseAudioDecoderContext ctx; + GstAudioDecoderContext ctx; /* properties */ GstClockTime latency; @@ -263,48 +263,39 @@ struct _GstBaseAudioDecoderPrivate }; -static void gst_base_audio_decoder_finalize (GObject * object); -static void gst_base_audio_decoder_set_property (GObject * object, +static void gst_audio_decoder_finalize (GObject * object); +static void gst_audio_decoder_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_base_audio_decoder_get_property (GObject * object, +static void gst_audio_decoder_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_base_audio_decoder_clear_queues (GstBaseAudioDecoder * dec); -static GstFlowReturn gst_base_audio_decoder_chain_reverse (GstBaseAudioDecoder * +static void gst_audio_decoder_clear_queues (GstAudioDecoder * dec); +static GstFlowReturn gst_audio_decoder_chain_reverse (GstAudioDecoder * dec, GstBuffer * buf); -static GstStateChangeReturn gst_base_audio_decoder_change_state (GstElement * +static GstStateChangeReturn gst_audio_decoder_change_state (GstElement * element, GstStateChange transition); -static gboolean gst_base_audio_decoder_sink_event (GstPad * pad, - GstEvent * event); -static gboolean gst_base_audio_decoder_src_event (GstPad * pad, - GstEvent * event); -static gboolean gst_base_audio_decoder_sink_setcaps (GstPad * pad, - GstCaps * caps); -static gboolean gst_base_audio_decoder_src_setcaps (GstPad * pad, - GstCaps * caps); -static GstFlowReturn gst_base_audio_decoder_chain (GstPad * pad, - GstBuffer * buf); -static gboolean gst_base_audio_decoder_src_query (GstPad * pad, - GstQuery * query); -static gboolean gst_base_audio_decoder_sink_query (GstPad * pad, - GstQuery * query); -static const GstQueryType *gst_base_audio_decoder_get_query_types (GstPad * - pad); -static void gst_base_audio_decoder_reset (GstBaseAudioDecoder * dec, - gboolean full); - - -GST_BOILERPLATE (GstBaseAudioDecoder, gst_base_audio_decoder, GstElement, +static gboolean gst_audio_decoder_sink_event (GstPad * pad, GstEvent * event); +static gboolean gst_audio_decoder_src_event (GstPad * pad, GstEvent * event); +static gboolean gst_audio_decoder_sink_setcaps (GstPad * pad, GstCaps * caps); +static gboolean gst_audio_decoder_src_setcaps (GstPad * pad, GstCaps * caps); +static GstFlowReturn gst_audio_decoder_chain (GstPad * pad, GstBuffer * buf); +static gboolean gst_audio_decoder_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_audio_decoder_sink_query (GstPad * pad, GstQuery * query); +static const GstQueryType *gst_audio_decoder_get_query_types (GstPad * pad); +static void gst_audio_decoder_reset (GstAudioDecoder * dec, gboolean full); + + +GST_BOILERPLATE (GstAudioDecoder, gst_audio_decoder, GstElement, GST_TYPE_ELEMENT); static void -gst_base_audio_decoder_base_init (gpointer g_class) +gst_audio_decoder_base_init (gpointer g_class) { } static void -gst_base_audio_decoder_class_init (GstBaseAudioDecoderClass * klass) +gst_audio_decoder_class_init (GstAudioDecoderClass * klass) { GObjectClass *gobject_class; GstElementClass *element_class; @@ -314,16 +305,16 @@ gst_base_audio_decoder_class_init (GstBaseAudioDecoderClass * klass) parent_class = g_type_class_peek_parent (klass); - g_type_class_add_private (klass, sizeof (GstBaseAudioDecoderPrivate)); + g_type_class_add_private (klass, sizeof (GstAudioDecoderPrivate)); - GST_DEBUG_CATEGORY_INIT (baseaudiodecoder_debug, "baseaudiodecoder", 0, - "baseaudiodecoder element"); + GST_DEBUG_CATEGORY_INIT (audiodecoder_debug, "audiodecoder", 0, + "audio decoder base class"); - gobject_class->set_property = gst_base_audio_decoder_set_property; - gobject_class->get_property = gst_base_audio_decoder_get_property; - gobject_class->finalize = gst_base_audio_decoder_finalize; + gobject_class->set_property = gst_audio_decoder_set_property; + gobject_class->get_property = gst_audio_decoder_get_property; + gobject_class->finalize = gst_audio_decoder_finalize; - element_class->change_state = gst_base_audio_decoder_change_state; + element_class->change_state = gst_audio_decoder_change_state; /* Properties */ g_object_class_install_property (gobject_class, PROP_LATENCY, @@ -345,14 +336,13 @@ gst_base_audio_decoder_class_init (GstBaseAudioDecoderClass * klass) } static void -gst_base_audio_decoder_init (GstBaseAudioDecoder * dec, - GstBaseAudioDecoderClass * klass) +gst_audio_decoder_init (GstAudioDecoder * dec, GstAudioDecoderClass * klass) { GstPadTemplate *pad_template; - GST_DEBUG_OBJECT (dec, "gst_base_audio_decoder_init"); + GST_DEBUG_OBJECT (dec, "gst_audio_decoder_init"); - dec->priv = GST_BASE_AUDIO_DECODER_GET_PRIVATE (dec); + dec->priv = GST_AUDIO_DECODER_GET_PRIVATE (dec); /* Setup sink pad */ pad_template = @@ -361,13 +351,13 @@ gst_base_audio_decoder_init (GstBaseAudioDecoder * dec, dec->sinkpad = gst_pad_new_from_template (pad_template, "sink"); gst_pad_set_event_function (dec->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_sink_event)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_event)); gst_pad_set_setcaps_function (dec->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_sink_setcaps)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_setcaps)); gst_pad_set_chain_function (dec->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_chain)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_chain)); gst_pad_set_query_function (dec->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_sink_query)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_sink_query)); gst_element_add_pad (GST_ELEMENT (dec), dec->sinkpad); GST_DEBUG_OBJECT (dec, "sinkpad created"); @@ -378,13 +368,13 @@ gst_base_audio_decoder_init (GstBaseAudioDecoder * dec, dec->srcpad = gst_pad_new_from_template (pad_template, "src"); gst_pad_set_setcaps_function (dec->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_src_setcaps)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_src_setcaps)); gst_pad_set_event_function (dec->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_src_event)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_src_event)); gst_pad_set_query_function (dec->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_src_query)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_src_query)); gst_pad_set_query_type_function (dec->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_decoder_get_query_types)); + GST_DEBUG_FUNCPTR (gst_audio_decoder_get_query_types)); gst_pad_use_fixed_caps (dec->srcpad); gst_element_add_pad (GST_ELEMENT (dec), dec->srcpad); GST_DEBUG_OBJECT (dec, "srcpad created"); @@ -399,14 +389,14 @@ gst_base_audio_decoder_init (GstBaseAudioDecoder * dec, dec->priv->plc = DEFAULT_PLC; /* init state */ - gst_base_audio_decoder_reset (dec, TRUE); + gst_audio_decoder_reset (dec, TRUE); GST_DEBUG_OBJECT (dec, "init ok"); } static void -gst_base_audio_decoder_reset (GstBaseAudioDecoder * dec, gboolean full) +gst_audio_decoder_reset (GstAudioDecoder * dec, gboolean full) { - GST_DEBUG_OBJECT (dec, "gst_base_audio_decoder_reset"); + GST_DEBUG_OBJECT (dec, "gst_audio_decoder_reset"); GST_OBJECT_LOCK (dec); @@ -416,7 +406,7 @@ gst_base_audio_decoder_reset (GstBaseAudioDecoder * dec, gboolean full) dec->priv->samples_out = 0; dec->priv->agg = -1; dec->priv->error_count = 0; - gst_base_audio_decoder_clear_queues (dec); + gst_audio_decoder_clear_queues (dec); gst_audio_info_clear (&dec->priv->ctx.info); memset (&dec->priv->ctx, 0, sizeof (dec->priv->ctx)); @@ -446,12 +436,12 @@ gst_base_audio_decoder_reset (GstBaseAudioDecoder * dec, gboolean full) } static void -gst_base_audio_decoder_finalize (GObject * object) +gst_audio_decoder_finalize (GObject * object) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (object)); - dec = GST_BASE_AUDIO_DECODER (object); + g_return_if_fail (GST_IS_AUDIO_DECODER (object)); + dec = GST_AUDIO_DECODER (object); if (dec->priv->adapter) { g_object_unref (dec->priv->adapter); @@ -466,13 +456,13 @@ gst_base_audio_decoder_finalize (GObject * object) /* automagically perform sanity checking of src caps; * also extracts output data format */ static gboolean -gst_base_audio_decoder_src_setcaps (GstPad * pad, GstCaps * caps) +gst_audio_decoder_src_setcaps (GstPad * pad, GstCaps * caps) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; gboolean res = TRUE; guint old_rate; - dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad)); + dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (dec, "setting src caps %" GST_PTR_FORMAT, caps); @@ -505,14 +495,14 @@ refuse_caps: } static gboolean -gst_base_audio_decoder_sink_setcaps (GstPad * pad, GstCaps * caps) +gst_audio_decoder_sink_setcaps (GstPad * pad, GstCaps * caps) { - GstBaseAudioDecoder *dec; - GstBaseAudioDecoderClass *klass; + GstAudioDecoder *dec; + GstAudioDecoderClass *klass; gboolean res = TRUE; - dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad)); - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); GST_DEBUG_OBJECT (dec, "caps: %" GST_PTR_FORMAT, caps); @@ -532,7 +522,7 @@ gst_base_audio_decoder_sink_setcaps (GstPad * pad, GstCaps * caps) } static void -gst_base_audio_decoder_setup (GstBaseAudioDecoder * dec) +gst_audio_decoder_setup (GstAudioDecoder * dec) { GstQuery *query; gboolean res; @@ -553,20 +543,20 @@ gst_base_audio_decoder_setup (GstBaseAudioDecoder * dec) /* mini aggregator combining output buffers into fewer larger ones, * if so allowed/configured */ static GstFlowReturn -gst_base_audio_decoder_output (GstBaseAudioDecoder * dec, GstBuffer * buf) +gst_audio_decoder_output (GstAudioDecoder * dec, GstBuffer * buf) { - GstBaseAudioDecoderClass *klass; - GstBaseAudioDecoderPrivate *priv; - GstBaseAudioDecoderContext *ctx; + GstAudioDecoderClass *klass; + GstAudioDecoderPrivate *priv; + GstAudioDecoderContext *ctx; GstFlowReturn ret = GST_FLOW_OK; GstBuffer *inbuf = NULL; - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); priv = dec->priv; ctx = &dec->priv->ctx; if (G_UNLIKELY (priv->agg < 0)) - gst_base_audio_decoder_setup (dec); + gst_audio_decoder_setup (dec); if (G_LIKELY (buf)) { g_return_val_if_fail (ctx->info.bpf != 0, GST_FLOW_ERROR); @@ -693,11 +683,11 @@ again: } GstFlowReturn -gst_base_audio_decoder_finish_frame (GstBaseAudioDecoder * dec, GstBuffer * buf, +gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf, gint frames) { - GstBaseAudioDecoderPrivate *priv; - GstBaseAudioDecoderContext *ctx; + GstAudioDecoderPrivate *priv; + GstAudioDecoderContext *ctx; gint samples = 0; GstClockTime ts, next_ts; @@ -823,7 +813,7 @@ gst_base_audio_decoder_finish_frame (GstBaseAudioDecoder * dec, GstBuffer * buf, dec->priv->error_count--; exit: - return gst_base_audio_decoder_output (dec, buf); + return gst_audio_decoder_output (dec, buf); /* ERRORS */ wrong_buffer: @@ -846,8 +836,8 @@ overflow: } static GstFlowReturn -gst_base_audio_decoder_handle_frame (GstBaseAudioDecoder * dec, - GstBaseAudioDecoderClass * klass, GstBuffer * buffer) +gst_audio_decoder_handle_frame (GstAudioDecoder * dec, + GstAudioDecoderClass * klass, GstBuffer * buffer) { if (G_LIKELY (buffer)) { /* keep around for admin */ @@ -866,19 +856,19 @@ gst_base_audio_decoder_handle_frame (GstBaseAudioDecoder * dec, /* maybe subclass configurable instead, but this allows for a whole lot of * raw samples, so at least quite some encoded ... */ -#define GST_BASE_AUDIO_DECODER_MAX_SYNC 10 * 8 * 2 * 1024 +#define GST_AUDIO_DECODER_MAX_SYNC 10 * 8 * 2 * 1024 static GstFlowReturn -gst_base_audio_decoder_push_buffers (GstBaseAudioDecoder * dec, gboolean force) +gst_audio_decoder_push_buffers (GstAudioDecoder * dec, gboolean force) { - GstBaseAudioDecoderClass *klass; - GstBaseAudioDecoderPrivate *priv; - GstBaseAudioDecoderContext *ctx; + GstAudioDecoderClass *klass; + GstAudioDecoderPrivate *priv; + GstAudioDecoderContext *ctx; GstFlowReturn ret = GST_FLOW_OK; GstBuffer *buffer; gint av, flush; - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); priv = dec->priv; ctx = &dec->priv->ctx; @@ -914,7 +904,7 @@ gst_base_audio_decoder_push_buffers (GstBaseAudioDecoder * dec, gboolean force) flush = offset; /* avoid parsing indefinitely */ priv->sync_flush += offset; - if (priv->sync_flush > GST_BASE_AUDIO_DECODER_MAX_SYNC) + if (priv->sync_flush > GST_AUDIO_DECODER_MAX_SYNC) goto parse_failed; } @@ -950,7 +940,7 @@ gst_base_audio_decoder_push_buffers (GstBaseAudioDecoder * dec, gboolean force) buffer = NULL; } - ret = gst_base_audio_decoder_handle_frame (dec, klass, buffer); + ret = gst_audio_decoder_handle_frame (dec, klass, buffer); /* do not keep pushing it ... */ if (G_UNLIKELY (!av)) { @@ -974,7 +964,7 @@ parse_failed: } static GstFlowReturn -gst_base_audio_decoder_drain (GstBaseAudioDecoder * dec) +gst_audio_decoder_drain (GstAudioDecoder * dec) { GstFlowReturn ret; @@ -985,11 +975,11 @@ gst_base_audio_decoder_drain (GstBaseAudioDecoder * dec) /* chain eventually calls upon drain as well, but by that time * gather list should be clear, so ok ... */ if (dec->segment.rate < 0.0 && dec->priv->gather) - gst_base_audio_decoder_chain_reverse (dec, NULL); + gst_audio_decoder_chain_reverse (dec, NULL); /* have subclass give all it can */ - ret = gst_base_audio_decoder_push_buffers (dec, TRUE); + ret = gst_audio_decoder_push_buffers (dec, TRUE); /* ensure all output sent */ - ret = gst_base_audio_decoder_output (dec, NULL); + ret = gst_audio_decoder_output (dec, NULL); /* everything should be away now */ if (dec->priv->frames.length) { /* not fatal/impossible though if subclass/codec eats stuff */ @@ -1007,19 +997,19 @@ gst_base_audio_decoder_drain (GstBaseAudioDecoder * dec) /* hard == FLUSH, otherwise discont */ static GstFlowReturn -gst_base_audio_decoder_flush (GstBaseAudioDecoder * dec, gboolean hard) +gst_audio_decoder_flush (GstAudioDecoder * dec, gboolean hard) { - GstBaseAudioDecoderClass *klass; + GstAudioDecoderClass *klass; GstFlowReturn ret = GST_FLOW_OK; - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); GST_LOG_OBJECT (dec, "flush hard %d", hard); if (!hard) { - ret = gst_base_audio_decoder_drain (dec); + ret = gst_audio_decoder_drain (dec); } else { - gst_base_audio_decoder_clear_queues (dec); + gst_audio_decoder_clear_queues (dec); gst_segment_init (&dec->segment, GST_FORMAT_TIME); dec->priv->error_count = 0; } @@ -1028,14 +1018,13 @@ gst_base_audio_decoder_flush (GstBaseAudioDecoder * dec, gboolean hard) if (klass->flush && dec->priv->samples_out > 0) klass->flush (dec, hard); /* and get (re)set for the sequel */ - gst_base_audio_decoder_reset (dec, FALSE); + gst_audio_decoder_reset (dec, FALSE); return ret; } static GstFlowReturn -gst_base_audio_decoder_chain_forward (GstBaseAudioDecoder * dec, - GstBuffer * buffer) +gst_audio_decoder_chain_forward (GstAudioDecoder * dec, GstBuffer * buffer) { GstFlowReturn ret; @@ -1046,16 +1035,16 @@ gst_base_audio_decoder_chain_forward (GstBaseAudioDecoder * dec, dec->priv->drained = FALSE; /* hand to subclass */ - ret = gst_base_audio_decoder_push_buffers (dec, FALSE); + ret = gst_audio_decoder_push_buffers (dec, FALSE); GST_LOG_OBJECT (dec, "chain-done"); return ret; } static void -gst_base_audio_decoder_clear_queues (GstBaseAudioDecoder * dec) +gst_audio_decoder_clear_queues (GstAudioDecoder * dec) { - GstBaseAudioDecoderPrivate *priv = dec->priv; + GstAudioDecoderPrivate *priv = dec->priv; g_list_foreach (priv->queued, (GFunc) gst_mini_object_unref, NULL); g_list_free (priv->queued); @@ -1132,9 +1121,9 @@ gst_base_audio_decoder_clear_queues (GstBaseAudioDecoder * dec) * Etc.. */ static GstFlowReturn -gst_base_audio_decoder_flush_decode (GstBaseAudioDecoder * dec) +gst_audio_decoder_flush_decode (GstAudioDecoder * dec) { - GstBaseAudioDecoderPrivate *priv = dec->priv; + GstAudioDecoderPrivate *priv = dec->priv; GstFlowReturn res = GST_FLOW_OK; GList *walk; @@ -1143,7 +1132,7 @@ gst_base_audio_decoder_flush_decode (GstBaseAudioDecoder * dec) GST_DEBUG_OBJECT (dec, "flushing buffers to decoder"); /* clear buffer and decoder state */ - gst_base_audio_decoder_flush (dec, FALSE); + gst_audio_decoder_flush (dec, FALSE); while (walk) { GList *next; @@ -1155,7 +1144,7 @@ gst_base_audio_decoder_flush_decode (GstBaseAudioDecoder * dec) next = g_list_next (walk); /* decode buffer, resulting data prepended to output queue */ gst_buffer_ref (buf); - res = gst_base_audio_decoder_chain_forward (dec, buf); + res = gst_audio_decoder_chain_forward (dec, buf); /* if we generated output, we can discard the buffer, else we * keep it in the queue */ @@ -1170,7 +1159,7 @@ gst_base_audio_decoder_flush_decode (GstBaseAudioDecoder * dec) } /* drain any aggregation (or otherwise) leftover */ - gst_base_audio_decoder_drain (dec); + gst_audio_decoder_drain (dec); /* now send queued data downstream */ while (priv->queued) { @@ -1198,10 +1187,9 @@ gst_base_audio_decoder_flush_decode (GstBaseAudioDecoder * dec) } static GstFlowReturn -gst_base_audio_decoder_chain_reverse (GstBaseAudioDecoder * dec, - GstBuffer * buf) +gst_audio_decoder_chain_reverse (GstAudioDecoder * dec, GstBuffer * buf) { - GstBaseAudioDecoderPrivate *priv = dec->priv; + GstAudioDecoderPrivate *priv = dec->priv; GstFlowReturn result = GST_FLOW_OK; /* if we have a discont, move buffers to the decode list */ @@ -1217,7 +1205,7 @@ gst_base_audio_decoder_chain_reverse (GstBaseAudioDecoder * dec, priv->decode = g_list_prepend (priv->decode, gbuf); } /* decode stuff in the decode queue */ - gst_base_audio_decoder_flush_decode (dec); + gst_audio_decoder_flush_decode (dec); } if (G_LIKELY (buf)) { @@ -1234,12 +1222,12 @@ gst_base_audio_decoder_chain_reverse (GstBaseAudioDecoder * dec, } static GstFlowReturn -gst_base_audio_decoder_chain (GstPad * pad, GstBuffer * buffer) +gst_audio_decoder_chain (GstPad * pad, GstBuffer * buffer) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; GstFlowReturn ret; - dec = GST_BASE_AUDIO_DECODER (GST_PAD_PARENT (pad)); + dec = GST_AUDIO_DECODER (GST_PAD_PARENT (pad)); GST_LOG_OBJECT (dec, "received buffer of size %d with ts %" GST_TIME_FORMAT @@ -1255,7 +1243,7 @@ gst_base_audio_decoder_chain (GstPad * pad, GstBuffer * buffer) samples = dec->priv->samples; GST_DEBUG_OBJECT (dec, "handling discont"); - gst_base_audio_decoder_flush (dec, FALSE); + gst_audio_decoder_flush (dec, FALSE); dec->priv->discont = TRUE; /* buffer may claim DISCONT loudly, if it can't tell us where we are now, @@ -1269,9 +1257,9 @@ gst_base_audio_decoder_chain (GstPad * pad, GstBuffer * buffer) } if (dec->segment.rate > 0.0) - ret = gst_base_audio_decoder_chain_forward (dec, buffer); + ret = gst_audio_decoder_chain_forward (dec, buffer); else - ret = gst_base_audio_decoder_chain_reverse (dec, buffer); + ret = gst_audio_decoder_chain_reverse (dec, buffer); return ret; } @@ -1279,15 +1267,14 @@ gst_base_audio_decoder_chain (GstPad * pad, GstBuffer * buffer) /* perform upstream byte <-> time conversion (duration, seeking) * if subclass allows and if enough data for moderately decent conversion */ static inline gboolean -gst_base_audio_decoder_do_byte (GstBaseAudioDecoder * dec) +gst_audio_decoder_do_byte (GstAudioDecoder * dec) { return dec->priv->ctx.do_byte_time && dec->priv->ctx.info.bpf && dec->priv->ctx.info.rate <= dec->priv->samples_out; } static gboolean -gst_base_audio_decoder_sink_eventfunc (GstBaseAudioDecoder * dec, - GstEvent * event) +gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) { gboolean handled = FALSE; @@ -1339,7 +1326,7 @@ gst_base_audio_decoder_sink_eventfunc (GstBaseAudioDecoder * dec, } /* finish current segment */ - gst_base_audio_decoder_drain (dec); + gst_audio_decoder_drain (dec); if (update) { /* time progressed without data, see if we can fill the gap with @@ -1350,19 +1337,19 @@ gst_base_audio_decoder_sink_eventfunc (GstBaseAudioDecoder * dec, GST_TIME_ARGS (dec->segment.last_stop)); if (dec->priv->plc && dec->priv->ctx.do_plc && dec->segment.rate > 0.0 && dec->segment.last_stop < start) { - GstBaseAudioDecoderClass *klass; + GstAudioDecoderClass *klass; GstBuffer *buf; - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); /* hand subclass empty frame with duration that needs covering */ buf = gst_buffer_new (); GST_BUFFER_DURATION (buf) = start - dec->segment.last_stop; /* best effort, not much error handling */ - gst_base_audio_decoder_handle_frame (dec, klass, buf); + gst_audio_decoder_handle_frame (dec, klass, buf); } } else { /* prepare for next one */ - gst_base_audio_decoder_flush (dec, FALSE); + gst_audio_decoder_flush (dec, FALSE); /* and that's where we time from, * in case upstream does not come up with anything better * (e.g. upstream BYTE) */ @@ -1386,11 +1373,11 @@ gst_base_audio_decoder_sink_eventfunc (GstBaseAudioDecoder * dec, case GST_EVENT_FLUSH_STOP: /* prepare for fresh start */ - gst_base_audio_decoder_flush (dec, TRUE); + gst_audio_decoder_flush (dec, TRUE); break; case GST_EVENT_EOS: - gst_base_audio_decoder_drain (dec); + gst_audio_decoder_drain (dec); break; default: @@ -1401,15 +1388,15 @@ gst_base_audio_decoder_sink_eventfunc (GstBaseAudioDecoder * dec, } static gboolean -gst_base_audio_decoder_sink_event (GstPad * pad, GstEvent * event) +gst_audio_decoder_sink_event (GstPad * pad, GstEvent * event) { - GstBaseAudioDecoder *dec; - GstBaseAudioDecoderClass *klass; + GstAudioDecoder *dec; + GstAudioDecoderClass *klass; gboolean handled = FALSE; gboolean ret = TRUE; - dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad)); - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); GST_DEBUG_OBJECT (dec, "received event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); @@ -1418,7 +1405,7 @@ gst_base_audio_decoder_sink_event (GstPad * pad, GstEvent * event) handled = klass->event (dec, event); if (!handled) - handled = gst_base_audio_decoder_sink_eventfunc (dec, event); + handled = gst_audio_decoder_sink_eventfunc (dec, event); if (!handled) ret = gst_pad_event_default (pad, event); @@ -1430,7 +1417,7 @@ gst_base_audio_decoder_sink_event (GstPad * pad, GstEvent * event) } static gboolean -gst_base_audio_decoder_do_seek (GstBaseAudioDecoder * dec, GstEvent * event) +gst_audio_decoder_do_seek (GstAudioDecoder * dec, GstEvent * event) { GstSeekFlags flags; GstSeekType start_type, end_type; @@ -1489,12 +1476,12 @@ gst_base_audio_decoder_do_seek (GstBaseAudioDecoder * dec, GstEvent * event) } static gboolean -gst_base_audio_decoder_src_event (GstPad * pad, GstEvent * event) +gst_audio_decoder_src_event (GstPad * pad, GstEvent * event) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; gboolean res = FALSE; - dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad)); + dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (dec, "received event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); @@ -1520,8 +1507,8 @@ gst_base_audio_decoder_src_event (GstPad * pad, GstEvent * event) /* if upstream fails for a time seek, maybe we can help if allowed */ if (format == GST_FORMAT_TIME) { - if (gst_base_audio_decoder_do_byte (dec)) - res = gst_base_audio_decoder_do_seek (dec, event); + if (gst_audio_decoder_do_byte (dec)) + res = gst_audio_decoder_do_seek (dec, event); break; } @@ -1559,7 +1546,7 @@ convert_error: } /* - * gst_base_audio_encoded_audio_convert: + * gst_audio_encoded_audio_convert: * @fmt: audio format of the encoded audio * @bytes: number of encoded bytes * @samples: number of encoded samples @@ -1573,9 +1560,9 @@ convert_error: * BYTE and TIME format by using estimated bitrate based on * @samples and @bytes (and @fmt). */ -/* FIXME: make gst_base_audio_encoded_audio_convert() public? */ +/* FIXME: make gst_audio_encoded_audio_convert() public? */ static gboolean -gst_base_audio_encoded_audio_convert (GstAudioInfo * fmt, +gst_audio_encoded_audio_convert (GstAudioInfo * fmt, gint64 bytes, gint64 samples, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value) { @@ -1630,12 +1617,12 @@ exit: } static gboolean -gst_base_audio_decoder_sink_query (GstPad * pad, GstQuery * query) +gst_audio_decoder_sink_query (GstPad * pad, GstQuery * query) { gboolean res = TRUE; - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; - dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad)); + dec = GST_AUDIO_DECODER (gst_pad_get_parent (pad)); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_FORMATS: @@ -1650,7 +1637,7 @@ gst_base_audio_decoder_sink_query (GstPad * pad, GstQuery * query) gint64 src_val, dest_val; gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val); - if (!(res = gst_base_audio_encoded_audio_convert (&dec->priv->ctx.info, + if (!(res = gst_audio_encoded_audio_convert (&dec->priv->ctx.info, dec->priv->bytes_in, dec->priv->samples_out, src_fmt, src_val, &dest_fmt, &dest_val))) goto error; @@ -1668,9 +1655,9 @@ error: } static const GstQueryType * -gst_base_audio_decoder_get_query_types (GstPad * pad) +gst_audio_decoder_get_query_types (GstPad * pad) { - static const GstQueryType gst_base_audio_decoder_src_query_types[] = { + static const GstQueryType gst_audio_decoder_src_query_types[] = { GST_QUERY_POSITION, GST_QUERY_DURATION, GST_QUERY_CONVERT, @@ -1678,7 +1665,7 @@ gst_base_audio_decoder_get_query_types (GstPad * pad) 0 }; - return gst_base_audio_decoder_src_query_types; + return gst_audio_decoder_src_query_types; } /* FIXME ? are any of these queries (other than latency) a decoder's business ?? @@ -1686,13 +1673,13 @@ gst_base_audio_decoder_get_query_types (GstPad * pad) * segment stuff etc at all * Supposedly that's backward compatibility ... */ static gboolean -gst_base_audio_decoder_src_query (GstPad * pad, GstQuery * query) +gst_audio_decoder_src_query (GstPad * pad, GstQuery * query) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; GstPad *peerpad; gboolean res = FALSE; - dec = GST_BASE_AUDIO_DECODER (GST_PAD_PARENT (pad)); + dec = GST_AUDIO_DECODER (GST_PAD_PARENT (pad)); peerpad = gst_pad_get_peer (GST_PAD (dec->sinkpad)); GST_LOG_OBJECT (dec, "handling query: %" GST_PTR_FORMAT, query); @@ -1708,7 +1695,7 @@ gst_base_audio_decoder_src_query (GstPad * pad, GstQuery * query) gst_query_parse_duration (query, &format, NULL); /* try answering TIME by converting from BYTE if subclass allows */ - if (format == GST_FORMAT_TIME && gst_base_audio_decoder_do_byte (dec)) { + if (format == GST_FORMAT_TIME && gst_audio_decoder_do_byte (dec)) { gint64 value; format = GST_FORMAT_BYTES; @@ -1807,21 +1794,21 @@ gst_base_audio_decoder_src_query (GstPad * pad, GstQuery * query) } static gboolean -gst_base_audio_decoder_stop (GstBaseAudioDecoder * dec) +gst_audio_decoder_stop (GstAudioDecoder * dec) { - GstBaseAudioDecoderClass *klass; + GstAudioDecoderClass *klass; gboolean ret = TRUE; - GST_DEBUG_OBJECT (dec, "gst_base_audio_decoder_stop"); + GST_DEBUG_OBJECT (dec, "gst_audio_decoder_stop"); - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); if (klass->stop) { ret = klass->stop (dec); } /* clean up */ - gst_base_audio_decoder_reset (dec, TRUE); + gst_audio_decoder_reset (dec, TRUE); if (ret) dec->priv->active = FALSE; @@ -1830,17 +1817,17 @@ gst_base_audio_decoder_stop (GstBaseAudioDecoder * dec) } static gboolean -gst_base_audio_decoder_start (GstBaseAudioDecoder * dec) +gst_audio_decoder_start (GstAudioDecoder * dec) { - GstBaseAudioDecoderClass *klass; + GstAudioDecoderClass *klass; gboolean ret = TRUE; - GST_DEBUG_OBJECT (dec, "gst_base_audio_decoder_start"); + GST_DEBUG_OBJECT (dec, "gst_audio_decoder_start"); - klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec); + klass = GST_AUDIO_DECODER_GET_CLASS (dec); /* arrange clean state */ - gst_base_audio_decoder_reset (dec, TRUE); + gst_audio_decoder_reset (dec, TRUE); if (klass->start) { ret = klass->start (dec); @@ -1853,12 +1840,12 @@ gst_base_audio_decoder_start (GstBaseAudioDecoder * dec) } static void -gst_base_audio_decoder_get_property (GObject * object, guint prop_id, +gst_audio_decoder_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; - dec = GST_BASE_AUDIO_DECODER (object); + dec = GST_AUDIO_DECODER (object); switch (prop_id) { case PROP_LATENCY: @@ -1877,12 +1864,12 @@ gst_base_audio_decoder_get_property (GObject * object, guint prop_id, } static void -gst_base_audio_decoder_set_property (GObject * object, guint prop_id, +gst_audio_decoder_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstBaseAudioDecoder *dec; + GstAudioDecoder *dec; - dec = GST_BASE_AUDIO_DECODER (object); + dec = GST_AUDIO_DECODER (object); switch (prop_id) { case PROP_LATENCY: @@ -1901,19 +1888,18 @@ gst_base_audio_decoder_set_property (GObject * object, guint prop_id, } static GstStateChangeReturn -gst_base_audio_decoder_change_state (GstElement * element, - GstStateChange transition) +gst_audio_decoder_change_state (GstElement * element, GstStateChange transition) { - GstBaseAudioDecoder *codec; + GstAudioDecoder *codec; GstStateChangeReturn ret; - codec = GST_BASE_AUDIO_DECODER (element); + codec = GST_AUDIO_DECODER (element); switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: break; case GST_STATE_CHANGE_READY_TO_PAUSED: - if (!gst_base_audio_decoder_start (codec)) { + if (!gst_audio_decoder_start (codec)) { goto start_failed; } break; @@ -1929,7 +1915,7 @@ gst_base_audio_decoder_change_state (GstElement * element, case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; case GST_STATE_CHANGE_PAUSED_TO_READY: - if (!gst_base_audio_decoder_stop (codec)) { + if (!gst_audio_decoder_stop (codec)) { goto stop_failed; } break; @@ -1954,7 +1940,7 @@ stop_failed: } GstFlowReturn -_gst_base_audio_decoder_error (GstBaseAudioDecoder * dec, gint weight, +_gst_audio_decoder_error (GstAudioDecoder * dec, gint weight, GQuark domain, gint code, gchar * txt, gchar * dbg, const gchar * file, const gchar * function, gint line) { @@ -1974,24 +1960,24 @@ _gst_base_audio_decoder_error (GstBaseAudioDecoder * dec, gint weight, } /** - * gst_base_audio_decoder_get_audio_info: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_audio_info: + * @dec: a #GstAudioDecoder * * Returns: a #GstAudioInfo describing the input audio format * * Since: 0.10.36 */ GstAudioInfo * -gst_base_audio_decoder_get_audio_info (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_audio_info (GstAudioDecoder * dec) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), NULL); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), NULL); return &dec->priv->ctx.info; } /** - * gst_base_audio_decoder_set_plc_aware: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_plc_aware: + * @dec: a #GstAudioDecoder * @plc: new plc state * * Indicates whether or not subclass handles packet loss concealment (plc). @@ -1999,32 +1985,32 @@ gst_base_audio_decoder_get_audio_info (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_plc_aware (GstBaseAudioDecoder * dec, gboolean plc) +gst_audio_decoder_set_plc_aware (GstAudioDecoder * dec, gboolean plc) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); dec->priv->ctx.do_plc = plc; } /** - * gst_base_audio_decoder_get_plc_aware: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_plc_aware: + * @dec: a #GstAudioDecoder * * Returns: currently configured plc handling * * Since: 0.10.36 */ gint -gst_base_audio_decoder_get_plc_aware (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_plc_aware (GstAudioDecoder * dec) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), 0); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), 0); return dec->priv->ctx.do_plc; } /** - * gst_base_audio_decoder_set_byte_time: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_byte_time: + * @dec: a #GstAudioDecoder * @enabled: whether to enable byte to time conversion * * Allows baseclass to perform byte to time estimated conversion. @@ -2032,49 +2018,48 @@ gst_base_audio_decoder_get_plc_aware (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_byte_time (GstBaseAudioDecoder * dec, - gboolean enabled) +gst_audio_decoder_set_byte_time (GstAudioDecoder * dec, gboolean enabled) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); dec->priv->ctx.do_byte_time = enabled; } /** - * gst_base_audio_decoder_get_byte_time: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_byte_time: + * @dec: a #GstAudioDecoder * * Returns: currently configured byte to time conversion setting * * Since: 0.10.36 */ gint -gst_base_audio_decoder_get_byte_time (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_byte_time (GstAudioDecoder * dec) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), 0); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), 0); return dec->priv->ctx.do_byte_time; } /** - * gst_base_audio_decoder_get_delay: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_delay: + * @dec: a #GstAudioDecoder * * Returns: currently configured decoder delay * * Since: 0.10.36 */ gint -gst_base_audio_decoder_get_delay (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_delay (GstAudioDecoder * dec) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), 0); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), 0); return dec->priv->ctx.delay; } /** - * gst_base_audio_decoder_set_max_errors: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_max_errors: + * @dec: a #GstAudioDecoder * @num: max tolerated errors * * Sets numbers of tolerated decoder errors, where a tolerated one is then only @@ -2083,32 +2068,32 @@ gst_base_audio_decoder_get_delay (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_max_errors (GstBaseAudioDecoder * enc, gint num) +gst_audio_decoder_set_max_errors (GstAudioDecoder * enc, gint num) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (enc)); + g_return_if_fail (GST_IS_AUDIO_DECODER (enc)); enc->priv->ctx.max_errors = num; } /** - * gst_base_audio_decoder_get_max_errors: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_max_errors: + * @dec: a #GstAudioDecoder * * Returns: currently configured decoder tolerated error count. * * Since: 0.10.36 */ gint -gst_base_audio_decoder_get_max_errors (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_max_errors (GstAudioDecoder * dec) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), 0); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), 0); return dec->priv->ctx.max_errors; } /** - * gst_base_audio_decoder_set_latency: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_latency: + * @dec: a #GstAudioDecoder * @min: minimum latency * @max: maximum latency * @@ -2117,10 +2102,10 @@ gst_base_audio_decoder_get_max_errors (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_latency (GstBaseAudioDecoder * dec, +gst_audio_decoder_set_latency (GstAudioDecoder * dec, GstClockTime min, GstClockTime max) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); GST_OBJECT_LOCK (dec); dec->priv->ctx.min_latency = min; @@ -2129,8 +2114,8 @@ gst_base_audio_decoder_set_latency (GstBaseAudioDecoder * dec, } /** - * gst_base_audio_decoder_get_latency: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_latency: + * @dec: a #GstAudioDecoder * @min: a pointer to storage to hold minimum latency * @max: a pointer to storage to hold maximum latency * @@ -2139,10 +2124,10 @@ gst_base_audio_decoder_set_latency (GstBaseAudioDecoder * dec, * Since: 0.10.36 */ void -gst_base_audio_decoder_get_latency (GstBaseAudioDecoder * dec, +gst_audio_decoder_get_latency (GstAudioDecoder * dec, GstClockTime * min, GstClockTime * max) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); GST_OBJECT_LOCK (dec); if (min) @@ -2153,8 +2138,8 @@ gst_base_audio_decoder_get_latency (GstBaseAudioDecoder * dec, } /** - * gst_base_audio_decoder_get_parse_state: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_parse_state: + * @dec: a #GstAudioDecoder * @min: a pointer to storage to hold current sync state * @max: a pointer to storage to hold current eos state * @@ -2163,10 +2148,10 @@ gst_base_audio_decoder_get_latency (GstBaseAudioDecoder * dec, * Since: 0.10.36 */ void -gst_base_audio_decoder_get_parse_state (GstBaseAudioDecoder * dec, +gst_audio_decoder_get_parse_state (GstAudioDecoder * dec, gboolean * sync, gboolean * eos) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); if (sync) *sync = dec->priv->ctx.sync; @@ -2175,8 +2160,8 @@ gst_base_audio_decoder_get_parse_state (GstBaseAudioDecoder * dec, } /** - * gst_base_audio_decoder_set_plc: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_plc: + * @dec: a #GstAudioDecoder * @enabled: new state * * Enable or disable decoder packet loss concealment, provided subclass @@ -2187,9 +2172,9 @@ gst_base_audio_decoder_get_parse_state (GstBaseAudioDecoder * dec, * Since: 0.10.36 */ void -gst_base_audio_decoder_set_plc (GstBaseAudioDecoder * dec, gboolean enabled) +gst_audio_decoder_set_plc (GstAudioDecoder * dec, gboolean enabled) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); GST_LOG_OBJECT (dec, "enabled: %d", enabled); @@ -2199,8 +2184,8 @@ gst_base_audio_decoder_set_plc (GstBaseAudioDecoder * dec, gboolean enabled) } /** - * gst_base_audio_decoder_get_plc: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_plc: + * @dec: a #GstAudioDecoder * * Queries decoder packet loss concealment handling. * @@ -2211,11 +2196,11 @@ gst_base_audio_decoder_set_plc (GstBaseAudioDecoder * dec, gboolean enabled) * Since: 0.10.36 */ gboolean -gst_base_audio_decoder_get_plc (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_plc (GstAudioDecoder * dec) { gboolean result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), FALSE); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), FALSE); GST_OBJECT_LOCK (dec); result = dec->priv->plc; @@ -2225,8 +2210,8 @@ gst_base_audio_decoder_get_plc (GstBaseAudioDecoder * dec) } /** - * gst_base_audio_decoder_set_min_latency: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_min_latency: + * @dec: a #GstAudioDecoder * @num: new minimum latency * * Sets decoder minimum aggregation latency. @@ -2236,9 +2221,9 @@ gst_base_audio_decoder_get_plc (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_min_latency (GstBaseAudioDecoder * dec, gint64 num) +gst_audio_decoder_set_min_latency (GstAudioDecoder * dec, gint64 num) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); GST_OBJECT_LOCK (dec); dec->priv->latency = num; @@ -2246,8 +2231,8 @@ gst_base_audio_decoder_set_min_latency (GstBaseAudioDecoder * dec, gint64 num) } /** - * gst_base_audio_decoder_get_min_latency: - * @enc: a #GstBaseAudioDecoder + * gst_audio_decoder_get_min_latency: + * @enc: a #GstAudioDecoder * * Queries decoder's latency aggregation. * @@ -2258,11 +2243,11 @@ gst_base_audio_decoder_set_min_latency (GstBaseAudioDecoder * dec, gint64 num) * Since: 0.10.36 */ gint64 -gst_base_audio_decoder_get_min_latency (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_min_latency (GstAudioDecoder * dec) { gint64 result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), FALSE); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), FALSE); GST_OBJECT_LOCK (dec); result = dec->priv->latency; @@ -2272,8 +2257,8 @@ gst_base_audio_decoder_get_min_latency (GstBaseAudioDecoder * dec) } /** - * gst_base_audio_decoder_set_tolerance: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_set_tolerance: + * @dec: a #GstAudioDecoder * @tolerance: new tolerance * * Configures decoder audio jitter tolerance threshold. @@ -2283,10 +2268,9 @@ gst_base_audio_decoder_get_min_latency (GstBaseAudioDecoder * dec) * Since: 0.10.36 */ void -gst_base_audio_decoder_set_tolerance (GstBaseAudioDecoder * dec, - gint64 tolerance) +gst_audio_decoder_set_tolerance (GstAudioDecoder * dec, gint64 tolerance) { - g_return_if_fail (GST_IS_BASE_AUDIO_DECODER (dec)); + g_return_if_fail (GST_IS_AUDIO_DECODER (dec)); GST_OBJECT_LOCK (dec); dec->priv->tolerance = tolerance; @@ -2294,8 +2278,8 @@ gst_base_audio_decoder_set_tolerance (GstBaseAudioDecoder * dec, } /** - * gst_base_audio_decoder_get_tolerance: - * @dec: a #GstBaseAudioDecoder + * gst_audio_decoder_get_tolerance: + * @dec: a #GstAudioDecoder * * Queries current audio jitter tolerance threshold. * @@ -2306,11 +2290,11 @@ gst_base_audio_decoder_set_tolerance (GstBaseAudioDecoder * dec, * Since: 0.10.36 */ gint64 -gst_base_audio_decoder_get_tolerance (GstBaseAudioDecoder * dec) +gst_audio_decoder_get_tolerance (GstAudioDecoder * dec) { gint64 result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_DECODER (dec), 0); + g_return_val_if_fail (GST_IS_AUDIO_DECODER (dec), 0); GST_OBJECT_LOCK (dec); result = dec->priv->tolerance; diff --git a/gst-libs/gst/audio/gstbaseaudiodecoder.h b/gst-libs/gst/audio/gstaudiodecoder.h similarity index 55% rename from gst-libs/gst/audio/gstbaseaudiodecoder.h rename to gst-libs/gst/audio/gstaudiodecoder.h index 2f78779..0fbb20a 100644 --- a/gst-libs/gst/audio/gstbaseaudiodecoder.h +++ b/gst-libs/gst/audio/gstaudiodecoder.h @@ -21,11 +21,11 @@ * Boston, MA 02111-1307, USA. */ -#ifndef _GST_BASE_AUDIO_DECODER_H_ -#define _GST_BASE_AUDIO_DECODER_H_ +#ifndef _GST_AUDIO_DECODER_H_ +#define _GST_AUDIO_DECODER_H_ #ifndef GST_USE_UNSTABLE_API -#warning "GstBaseAudioDecoder is unstable API and may change in future." +#warning "GstAudioDecoder is unstable API and may change in future." #warning "You can define GST_USE_UNSTABLE_API to avoid this warning." #endif @@ -35,70 +35,70 @@ G_BEGIN_DECLS -#define GST_TYPE_BASE_AUDIO_DECODER \ - (gst_base_audio_decoder_get_type()) -#define GST_BASE_AUDIO_DECODER(obj) \ - (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_AUDIO_DECODER,GstBaseAudioDecoder)) -#define GST_BASE_AUDIO_DECODER_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_AUDIO_DECODER,GstBaseAudioDecoderClass)) -#define GST_BASE_AUDIO_DECODER_GET_CLASS(obj) \ - (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_BASE_AUDIO_DECODER,GstBaseAudioDecoderClass)) -#define GST_IS_BASE_AUDIO_DECODER(obj) \ - (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_AUDIO_DECODER)) -#define GST_IS_BASE_AUDIO_DECODER_CLASS(obj) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_AUDIO_DECODER)) +#define GST_TYPE_AUDIO_DECODER \ + (gst_audio_decoder_get_type()) +#define GST_AUDIO_DECODER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_DECODER,GstAudioDecoder)) +#define GST_AUDIO_DECODER_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_DECODER,GstAudioDecoderClass)) +#define GST_AUDIO_DECODER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_AUDIO_DECODER,GstAudioDecoderClass)) +#define GST_IS_AUDIO_DECODER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_DECODER)) +#define GST_IS_AUDIO_DECODER_CLASS(obj) \ + (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_DECODER)) /** - * GST_BASE_AUDIO_DECODER_SINK_NAME: + * GST_AUDIO_DECODER_SINK_NAME: * * The name of the templates for the sink pad. * * Since: 0.10.36 */ -#define GST_BASE_AUDIO_DECODER_SINK_NAME "sink" +#define GST_AUDIO_DECODER_SINK_NAME "sink" /** - * GST_BASE_AUDIO_DECODER_SRC_NAME: + * GST_AUDIO_DECODER_SRC_NAME: * * The name of the templates for the source pad. * * Since: 0.10.36 */ -#define GST_BASE_AUDIO_DECODER_SRC_NAME "src" +#define GST_AUDIO_DECODER_SRC_NAME "src" /** - * GST_BASE_AUDIO_DECODER_SRC_PAD: + * GST_AUDIO_DECODER_SRC_PAD: * @obj: base audio codec instance * * Gives the pointer to the source #GstPad object of the element. * * Since: 0.10.36 */ -#define GST_BASE_AUDIO_DECODER_SRC_PAD(obj) (((GstBaseAudioDecoder *) (obj))->srcpad) +#define GST_AUDIO_DECODER_SRC_PAD(obj) (((GstAudioDecoder *) (obj))->srcpad) /** - * GST_BASE_AUDIO_DECODER_SINK_PAD: + * GST_AUDIO_DECODER_SINK_PAD: * @obj: base audio codec instance * * Gives the pointer to the sink #GstPad object of the element. * * Since: 0.10.36 */ -#define GST_BASE_AUDIO_DECODER_SINK_PAD(obj) (((GstBaseAudioDecoder *) (obj))->sinkpad) +#define GST_AUDIO_DECODER_SINK_PAD(obj) (((GstAudioDecoder *) (obj))->sinkpad) -typedef struct _GstBaseAudioDecoder GstBaseAudioDecoder; -typedef struct _GstBaseAudioDecoderClass GstBaseAudioDecoderClass; +typedef struct _GstAudioDecoder GstAudioDecoder; +typedef struct _GstAudioDecoderClass GstAudioDecoderClass; -typedef struct _GstBaseAudioDecoderPrivate GstBaseAudioDecoderPrivate; +typedef struct _GstAudioDecoderPrivate GstAudioDecoderPrivate; /* do not use this one, use macro below */ -GstFlowReturn _gst_base_audio_decoder_error (GstBaseAudioDecoder *dec, gint weight, - GQuark domain, gint code, - gchar *txt, gchar *debug, - const gchar *file, const gchar *function, - gint line); +GstFlowReturn _gst_audio_decoder_error (GstAudioDecoder *dec, gint weight, + GQuark domain, gint code, + gchar *txt, gchar *debug, + const gchar *file, const gchar *function, + gint line); /** - * GST_BASE_AUDIO_DECODER_ERROR: + * GST_AUDIO_DECODER_ERROR: * @el: the base audio decoder element that generates the error * @weight: element defined weight of the error, added to error count * @domain: like CORE, LIBRARY, RESOURCE or STREAM (see #gstreamer-GstGError) @@ -120,24 +120,24 @@ GstFlowReturn _gst_base_audio_decoder_error (GstBaseAudioDecoder *dec, gint weig * * Since: 0.10.36 */ -#define GST_BASE_AUDIO_DECODER_ERROR(el, w, domain, code, text, debug, ret) \ +#define GST_AUDIO_DECODER_ERROR(el, w, domain, code, text, debug, ret) \ G_STMT_START { \ gchar *__txt = _gst_element_error_printf text; \ gchar *__dbg = _gst_element_error_printf debug; \ - GstBaseAudioDecoder *dec = GST_BASE_AUDIO_DECODER (el); \ - ret = _gst_base_audio_decoder_error (dec, w, GST_ ## domain ## _ERROR, \ + GstAudioDecoder *dec = GST_AUDIO_DECODER (el); \ + ret = _gst_audio_decoder_error (dec, w, GST_ ## domain ## _ERROR, \ GST_ ## domain ## _ERROR_ ## code, __txt, __dbg, __FILE__, \ GST_FUNCTION, __LINE__); \ } G_STMT_END /** - * GstBaseAudioDecoder: + * GstAudioDecoder: * - * The opaque #GstBaseAudioDecoder data structure. + * The opaque #GstAudioDecoder data structure. * * Since: 0.10.36 */ -struct _GstBaseAudioDecoder +struct _GstAudioDecoder { GstElement element; @@ -150,12 +150,12 @@ struct _GstBaseAudioDecoder GstSegment segment; /*< private >*/ - GstBaseAudioDecoderPrivate *priv; + GstAudioDecoderPrivate *priv; gpointer _gst_reserved[GST_PADDING_LARGE]; }; /** - * GstBaseAudioDecoderClass: + * GstAudioDecoderClass: * @start: Optional. * Called when the element starts processing. * Allows opening external resources. @@ -191,85 +191,93 @@ struct _GstBaseAudioDecoder * * Since: 0.10.36 */ -struct _GstBaseAudioDecoderClass +struct _GstAudioDecoderClass { GstElementClass parent_class; /*< public >*/ /* virtual methods for subclasses */ - gboolean (*start) (GstBaseAudioDecoder *dec); + gboolean (*start) (GstAudioDecoder *dec); - gboolean (*stop) (GstBaseAudioDecoder *dec); + gboolean (*stop) (GstAudioDecoder *dec); - gboolean (*set_format) (GstBaseAudioDecoder *dec, + gboolean (*set_format) (GstAudioDecoder *dec, GstCaps *caps); - GstFlowReturn (*parse) (GstBaseAudioDecoder *dec, + GstFlowReturn (*parse) (GstAudioDecoder *dec, GstAdapter *adapter, gint *offset, gint *length); - GstFlowReturn (*handle_frame) (GstBaseAudioDecoder *dec, + GstFlowReturn (*handle_frame) (GstAudioDecoder *dec, GstBuffer *buffer); - void (*flush) (GstBaseAudioDecoder *dec, gboolean hard); + void (*flush) (GstAudioDecoder *dec, gboolean hard); - GstFlowReturn (*pre_push) (GstBaseAudioDecoder *dec, + GstFlowReturn (*pre_push) (GstAudioDecoder *dec, GstBuffer **buffer); - gboolean (*event) (GstBaseAudioDecoder *dec, + gboolean (*event) (GstAudioDecoder *dec, GstEvent *event); /*< private >*/ gpointer _gst_reserved[GST_PADDING_LARGE]; }; -GstFlowReturn gst_base_audio_decoder_finish_frame (GstBaseAudioDecoder * dec, +GType gst_audio_decoder_get_type (void); + +GstFlowReturn gst_audio_decoder_finish_frame (GstAudioDecoder * dec, GstBuffer * buf, gint frames); /* context parameters */ -GstAudioInfo * gst_base_audio_decoder_get_audio_info (GstBaseAudioDecoder * dec); +GstAudioInfo * gst_audio_decoder_get_audio_info (GstAudioDecoder * dec); + +void gst_audio_decoder_set_plc_aware (GstAudioDecoder * dec, + gboolean plc); + +gint gst_audio_decoder_get_plc_aware (GstAudioDecoder * dec); + +void gst_audio_decoder_set_byte_time (GstAudioDecoder * dec, + gboolean enabled); -void gst_base_audio_decoder_set_plc_aware (GstBaseAudioDecoder * dec, - gboolean plc); -gint gst_base_audio_decoder_get_plc_aware (GstBaseAudioDecoder * dec); +gint gst_audio_decoder_get_byte_time (GstAudioDecoder * dec); -void gst_base_audio_decoder_set_byte_time (GstBaseAudioDecoder * dec, - gboolean enabled); -gint gst_base_audio_decoder_get_byte_time (GstBaseAudioDecoder * dec); +gint gst_audio_decoder_get_delay (GstAudioDecoder * dec); -gint gst_base_audio_decoder_get_delay (GstBaseAudioDecoder * dec); +void gst_audio_decoder_set_max_errors (GstAudioDecoder * enc, + gint num); -void gst_base_audio_decoder_set_max_errors (GstBaseAudioDecoder * enc, - gint num); -gint gst_base_audio_decoder_get_max_errors (GstBaseAudioDecoder * dec); +gint gst_audio_decoder_get_max_errors (GstAudioDecoder * dec); -void gst_base_audio_decoder_set_latency (GstBaseAudioDecoder * dec, - GstClockTime min, GstClockTime max); -void gst_base_audio_decoder_get_latency (GstBaseAudioDecoder * dec, - GstClockTime * min, GstClockTime * max); +void gst_audio_decoder_set_latency (GstAudioDecoder * dec, + GstClockTime min, + GstClockTime max); -void gst_base_audio_decoder_get_parse_state (GstBaseAudioDecoder * dec, - gboolean * sync, gboolean * eos); +void gst_audio_decoder_get_latency (GstAudioDecoder * dec, + GstClockTime * min, + GstClockTime * max); + +void gst_audio_decoder_get_parse_state (GstAudioDecoder * dec, + gboolean * sync, + gboolean * eos); /* object properties */ -void gst_base_audio_decoder_set_plc (GstBaseAudioDecoder * dec, - gboolean enabled); -gboolean gst_base_audio_decoder_get_plc (GstBaseAudioDecoder * dec); +void gst_audio_decoder_set_plc (GstAudioDecoder * dec, + gboolean enabled); -void gst_base_audio_decoder_set_min_latency (GstBaseAudioDecoder * dec, - gint64 num); -gint64 gst_base_audio_decoder_get_min_latency (GstBaseAudioDecoder * dec); +gboolean gst_audio_decoder_get_plc (GstAudioDecoder * dec); -void gst_base_audio_decoder_set_tolerance (GstBaseAudioDecoder * dec, - gint64 tolerance); +void gst_audio_decoder_set_min_latency (GstAudioDecoder * dec, + gint64 num); -gint64 gst_base_audio_decoder_get_tolerance (GstBaseAudioDecoder * dec); +gint64 gst_audio_decoder_get_min_latency (GstAudioDecoder * dec); -GType gst_base_audio_decoder_get_type (void); +void gst_audio_decoder_set_tolerance (GstAudioDecoder * dec, + gint64 tolerance); -G_END_DECLS +gint64 gst_audio_decoder_get_tolerance (GstAudioDecoder * dec); -#endif +G_END_DECLS +#endif /* _GST_AUDIO_DECODER_H_ */ diff --git a/gst-libs/gst/audio/gstbaseaudioencoder.c b/gst-libs/gst/audio/gstaudioencoder.c similarity index 79% rename from gst-libs/gst/audio/gstbaseaudioencoder.c rename to gst-libs/gst/audio/gstaudioencoder.c index 63131fd..6f47f6b 100644 --- a/gst-libs/gst/audio/gstbaseaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@ -20,7 +20,7 @@ */ /** - * SECTION:gstbaseaudioencoder + * SECTION:gstaudioencoder * @short_description: Base class for audio encoders * @see_also: #GstBaseTransform * @since: 0.10.36 @@ -28,16 +28,16 @@ * This base class is for audio encoders turning raw audio samples into * encoded audio data. * - * GstBaseAudioEncoder and subclass should cooperate as follows. + * GstAudioEncoder and subclass should cooperate as follows. * * * Configuration * - * Initially, GstBaseAudioEncoder calls @start when the encoder element + * Initially, GstAudioEncoder calls @start when the encoder element * is activated, which allows subclass to perform any global setup. * * - * GstBaseAudioEncoder calls @set_format to inform subclass of the format + * GstAudioEncoder calls @set_format to inform subclass of the format * of input audio data that it is about to receive. Subclass should * setup for encoding and configure various base class parameters * appropriately, notably those directing desired input data handling. @@ -45,11 +45,11 @@ * parameters require reconfiguration. * * - * GstBaseAudioEncoder calls @stop at end of all processing. + * GstAudioEncoder calls @stop at end of all processing. * * * - * As of configuration stage, and throughout processing, GstBaseAudioEncoder + * As of configuration stage, and throughout processing, GstAudioEncoder * maintains various parameters that provide required context, * e.g. describing the format of input audio data. * Conversely, subclass can and should configure these context parameters @@ -63,7 +63,7 @@ * * * If codec processing results in encoded data, subclass should call - * @gst_base_audio_encoder_finish_frame to have encoded data pushed + * @gst_audio_encoder_finish_frame to have encoded data pushed * downstream. Alternatively, it might also call to indicate dropped * (non-encoded) samples. * @@ -72,7 +72,7 @@ * it is passed to @pre_push. * * - * During the parsing process GstBaseAudioEncoderClass will handle both + * During the parsing process GstAudioEncoderClass will handle both * srcpad and sinkpad events. Sink events will be passed to subclass * if @event callback has been provided. * @@ -81,7 +81,7 @@ * * Shutdown phase * - * GstBaseAudioEncoder class calls @stop to inform the subclass that data + * GstAudioEncoder class calls @stop to inform the subclass that data * parsing will be stopped. * * @@ -92,7 +92,7 @@ * source and sink pads. The pads need to be named "sink" and "src". It also * needs to set the fixed caps on srcpad, when the format is ensured. This * is typically when base class calls subclass' @set_format function, though - * it might be delayed until calling @gst_base_audio_encoder_finish_frame. + * it might be delayed until calling @gst_audio_encoder_finish_frame. * * In summary, above process should have subclass concentrating on * codec data processing while leaving other matters to base class, @@ -101,18 +101,18 @@ * * In particular, base class will either favor tracking upstream timestamps * (at the possible expense of jitter) or aim to arrange for a perfect stream of - * output timestamps, depending on #GstBaseAudioEncoder:perfect-ts. + * output timestamps, depending on #GstAudioEncoder:perfect-ts. * However, in the latter case, the input may not be so perfect or ideal, which * is handled as follows. An input timestamp is compared with the expected * timestamp as dictated by input sample stream and if the deviation is less - * than #GstBaseAudioEncoder:tolerance, the deviation is discarded. + * than #GstAudioEncoder:tolerance, the deviation is discarded. * Otherwise, it is considered a discontuinity and subsequent output timestamp * is resynced to the new position after performing configured discontinuity * processing. In the non-perfect-ts case, an upstream variation exceeding * tolerance only leads to marking DISCONT on subsequent outgoing * (while timestamps are adjusted to upstream regardless of variation). * While DISCONT is also marked in the perfect-ts case, this one optionally - * (see #GstBaseAudioEncoder:hard-resync) + * (see #GstAudioEncoder:hard-resync) * performs some additional steps, such as clipping of (early) input samples * or draining all currently remaining input data, depending on the direction * of the discontuinity. @@ -141,7 +141,7 @@ * * * Accept data in @handle_frame and provide encoded results to - * @gst_base_audio_encoder_finish_frame. + * @gst_audio_encoder_finish_frame. * * * @@ -152,7 +152,7 @@ #endif #define GST_USE_UNSTABLE_API -#include "gstbaseaudioencoder.h" +#include "gstaudioencoder.h" #include #include @@ -160,12 +160,12 @@ #include -GST_DEBUG_CATEGORY_STATIC (gst_base_audio_encoder_debug); -#define GST_CAT_DEFAULT gst_base_audio_encoder_debug +GST_DEBUG_CATEGORY_STATIC (gst_audio_encoder_debug); +#define GST_CAT_DEFAULT gst_audio_encoder_debug -#define GST_BASE_AUDIO_ENCODER_GET_PRIVATE(obj) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_BASE_AUDIO_ENCODER, \ - GstBaseAudioEncoderPrivate)) +#define GST_AUDIO_ENCODER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_AUDIO_ENCODER, \ + GstAudioEncoderPrivate)) enum { @@ -181,7 +181,7 @@ enum #define DEFAULT_HARD_RESYNC FALSE #define DEFAULT_TOLERANCE 40000000 -typedef struct _GstBaseAudioEncoderContext +typedef struct _GstAudioEncoderContext { /* input */ GstAudioInfo info; @@ -193,9 +193,9 @@ typedef struct _GstBaseAudioEncoderContext /* MT-protected (with LOCK) */ GstClockTime min_latency; GstClockTime max_latency; -} GstBaseAudioEncoderContext; +} GstAudioEncoderContext; -struct _GstBaseAudioEncoderPrivate +struct _GstAudioEncoderPrivate { /* activation status */ gboolean active; @@ -232,7 +232,7 @@ struct _GstBaseAudioEncoderPrivate guint64 bytes_out; /* context storage */ - GstBaseAudioEncoderContext ctx; + GstAudioEncoderContext ctx; /* properties */ gint64 tolerance; @@ -244,27 +244,26 @@ struct _GstBaseAudioEncoderPrivate static GstElementClass *parent_class = NULL; -static void gst_base_audio_encoder_class_init (GstBaseAudioEncoderClass * - klass); -static void gst_base_audio_encoder_init (GstBaseAudioEncoder * parse, - GstBaseAudioEncoderClass * klass); +static void gst_audio_encoder_class_init (GstAudioEncoderClass * klass); +static void gst_audio_encoder_init (GstAudioEncoder * parse, + GstAudioEncoderClass * klass); GType -gst_base_audio_encoder_get_type (void) +gst_audio_encoder_get_type (void) { - static GType base_audio_encoder_type = 0; + static GType audio_encoder_type = 0; - if (!base_audio_encoder_type) { - static const GTypeInfo base_audio_encoder_info = { - sizeof (GstBaseAudioEncoderClass), + if (!audio_encoder_type) { + static const GTypeInfo audio_encoder_info = { + sizeof (GstAudioEncoderClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, - (GClassInitFunc) gst_base_audio_encoder_class_init, + (GClassInitFunc) gst_audio_encoder_class_init, NULL, NULL, - sizeof (GstBaseAudioEncoder), + sizeof (GstAudioEncoder), 0, - (GInstanceInitFunc) gst_base_audio_encoder_init, + (GInstanceInitFunc) gst_audio_encoder_init, }; const GInterfaceInfo preset_interface_info = { NULL, /* interface_init */ @@ -272,59 +271,52 @@ gst_base_audio_encoder_get_type (void) NULL /* interface_data */ }; - base_audio_encoder_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstBaseAudioEncoder", &base_audio_encoder_info, G_TYPE_FLAG_ABSTRACT); + audio_encoder_type = g_type_register_static (GST_TYPE_ELEMENT, + "GstAudioEncoder", &audio_encoder_info, G_TYPE_FLAG_ABSTRACT); - g_type_add_interface_static (base_audio_encoder_type, GST_TYPE_PRESET, + g_type_add_interface_static (audio_encoder_type, GST_TYPE_PRESET, &preset_interface_info); } - return base_audio_encoder_type; + return audio_encoder_type; } -static void gst_base_audio_encoder_finalize (GObject * object); -static void gst_base_audio_encoder_reset (GstBaseAudioEncoder * enc, - gboolean full); +static void gst_audio_encoder_finalize (GObject * object); +static void gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full); -static void gst_base_audio_encoder_set_property (GObject * object, +static void gst_audio_encoder_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); -static void gst_base_audio_encoder_get_property (GObject * object, +static void gst_audio_encoder_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static gboolean gst_base_audio_encoder_sink_activate_push (GstPad * pad, +static gboolean gst_audio_encoder_sink_activate_push (GstPad * pad, gboolean active); -static gboolean gst_base_audio_encoder_sink_event (GstPad * pad, - GstEvent * event); -static gboolean gst_base_audio_encoder_sink_setcaps (GstPad * pad, - GstCaps * caps); -static GstFlowReturn gst_base_audio_encoder_chain (GstPad * pad, - GstBuffer * buffer); -static gboolean gst_base_audio_encoder_src_query (GstPad * pad, - GstQuery * query); -static gboolean gst_base_audio_encoder_sink_query (GstPad * pad, - GstQuery * query); -static const GstQueryType *gst_base_audio_encoder_get_query_types (GstPad * - pad); -static GstCaps *gst_base_audio_encoder_sink_getcaps (GstPad * pad); +static gboolean gst_audio_encoder_sink_event (GstPad * pad, GstEvent * event); +static gboolean gst_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps); +static GstFlowReturn gst_audio_encoder_chain (GstPad * pad, GstBuffer * buffer); +static gboolean gst_audio_encoder_src_query (GstPad * pad, GstQuery * query); +static gboolean gst_audio_encoder_sink_query (GstPad * pad, GstQuery * query); +static const GstQueryType *gst_audio_encoder_get_query_types (GstPad * pad); +static GstCaps *gst_audio_encoder_sink_getcaps (GstPad * pad); static void -gst_base_audio_encoder_class_init (GstBaseAudioEncoderClass * klass) +gst_audio_encoder_class_init (GstAudioEncoderClass * klass) { GObjectClass *gobject_class; gobject_class = G_OBJECT_CLASS (klass); parent_class = g_type_class_peek_parent (klass); - GST_DEBUG_CATEGORY_INIT (gst_base_audio_encoder_debug, "baseaudioencoder", 0, - "baseaudioencoder element"); + GST_DEBUG_CATEGORY_INIT (gst_audio_encoder_debug, "audioencoder", 0, + "audio encoder base class"); - g_type_class_add_private (klass, sizeof (GstBaseAudioEncoderPrivate)); + g_type_class_add_private (klass, sizeof (GstAudioEncoderPrivate)); - gobject_class->set_property = gst_base_audio_encoder_set_property; - gobject_class->get_property = gst_base_audio_encoder_get_property; + gobject_class->set_property = gst_audio_encoder_set_property; + gobject_class->get_property = gst_audio_encoder_get_property; - gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_base_audio_encoder_finalize); + gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_audio_encoder_finalize); /* properties */ g_object_class_install_property (gobject_class, PROP_PERFECT_TS, @@ -347,14 +339,13 @@ gst_base_audio_encoder_class_init (GstBaseAudioEncoderClass * klass) } static void -gst_base_audio_encoder_init (GstBaseAudioEncoder * enc, - GstBaseAudioEncoderClass * bclass) +gst_audio_encoder_init (GstAudioEncoder * enc, GstAudioEncoderClass * bclass) { GstPadTemplate *pad_template; - GST_DEBUG_OBJECT (enc, "gst_base_audio_encoder_init"); + GST_DEBUG_OBJECT (enc, "gst_audio_encoder_init"); - enc->priv = GST_BASE_AUDIO_ENCODER_GET_PRIVATE (enc); + enc->priv = GST_AUDIO_ENCODER_GET_PRIVATE (enc); /* only push mode supported */ pad_template = @@ -362,17 +353,17 @@ gst_base_audio_encoder_init (GstBaseAudioEncoder * enc, g_return_if_fail (pad_template != NULL); enc->sinkpad = gst_pad_new_from_template (pad_template, "sink"); gst_pad_set_event_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_sink_event)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_sink_event)); gst_pad_set_setcaps_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_sink_setcaps)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_sink_setcaps)); gst_pad_set_getcaps_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_sink_getcaps)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_sink_getcaps)); gst_pad_set_query_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_sink_query)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_sink_query)); gst_pad_set_chain_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_chain)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_chain)); gst_pad_set_activatepush_function (enc->sinkpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_sink_activate_push)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_sink_activate_push)); gst_element_add_pad (GST_ELEMENT (enc), enc->sinkpad); GST_DEBUG_OBJECT (enc, "sinkpad created"); @@ -383,9 +374,9 @@ gst_base_audio_encoder_init (GstBaseAudioEncoder * enc, g_return_if_fail (pad_template != NULL); enc->srcpad = gst_pad_new_from_template (pad_template, "src"); gst_pad_set_query_function (enc->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_src_query)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_src_query)); gst_pad_set_query_type_function (enc->srcpad, - GST_DEBUG_FUNCPTR (gst_base_audio_encoder_get_query_types)); + GST_DEBUG_FUNCPTR (gst_audio_encoder_get_query_types)); gst_pad_use_fixed_caps (enc->srcpad); gst_element_add_pad (GST_ELEMENT (enc), enc->srcpad); GST_DEBUG_OBJECT (enc, "src created"); @@ -399,12 +390,12 @@ gst_base_audio_encoder_init (GstBaseAudioEncoder * enc, enc->priv->tolerance = DEFAULT_TOLERANCE; /* init state */ - gst_base_audio_encoder_reset (enc, TRUE); + gst_audio_encoder_reset (enc, TRUE); GST_DEBUG_OBJECT (enc, "init ok"); } static void -gst_base_audio_encoder_reset (GstBaseAudioEncoder * enc, gboolean full) +gst_audio_encoder_reset (GstAudioEncoder * enc, gboolean full) { GST_OBJECT_LOCK (enc); @@ -431,9 +422,9 @@ gst_base_audio_encoder_reset (GstBaseAudioEncoder * enc, gboolean full) } static void -gst_base_audio_encoder_finalize (GObject * object) +gst_audio_encoder_finalize (GObject * object) { - GstBaseAudioEncoder *enc = GST_BASE_AUDIO_ENCODER (object); + GstAudioEncoder *enc = GST_AUDIO_ENCODER (object); g_object_unref (enc->priv->adapter); @@ -441,8 +432,8 @@ gst_base_audio_encoder_finalize (GObject * object) } /** - * gst_base_audio_encoder_finish_frame: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_finish_frame: + * @enc: a #GstAudioEncoder * @buffer: encoded data * @samples: number of samples (per channel) represented by encoded data * @@ -466,15 +457,15 @@ gst_base_audio_encoder_finalize (GObject * object) * Since: 0.10.36 */ GstFlowReturn -gst_base_audio_encoder_finish_frame (GstBaseAudioEncoder * enc, GstBuffer * buf, +gst_audio_encoder_finish_frame (GstAudioEncoder * enc, GstBuffer * buf, gint samples) { - GstBaseAudioEncoderClass *klass; - GstBaseAudioEncoderPrivate *priv; - GstBaseAudioEncoderContext *ctx; + GstAudioEncoderClass *klass; + GstAudioEncoderPrivate *priv; + GstAudioEncoderContext *ctx; GstFlowReturn ret = GST_FLOW_OK; - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); priv = enc->priv; ctx = &enc->priv->ctx; @@ -655,16 +646,16 @@ overflow: * (i.e. really returned by encoder subclass) * - start + offset is what needs to be fed to subclass next */ static GstFlowReturn -gst_base_audio_encoder_push_buffers (GstBaseAudioEncoder * enc, gboolean force) +gst_audio_encoder_push_buffers (GstAudioEncoder * enc, gboolean force) { - GstBaseAudioEncoderClass *klass; - GstBaseAudioEncoderPrivate *priv; - GstBaseAudioEncoderContext *ctx; + GstAudioEncoderClass *klass; + GstAudioEncoderPrivate *priv; + GstAudioEncoderContext *ctx; gint av, need; GstBuffer *buf; GstFlowReturn ret = GST_FLOW_OK; - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); g_return_val_if_fail (klass->handle_frame != NULL, GST_FLOW_ERROR); @@ -737,16 +728,16 @@ gst_base_audio_encoder_push_buffers (GstBaseAudioEncoder * enc, gboolean force) } static GstFlowReturn -gst_base_audio_encoder_drain (GstBaseAudioEncoder * enc) +gst_audio_encoder_drain (GstAudioEncoder * enc) { if (enc->priv->drained) return GST_FLOW_OK; else - return gst_base_audio_encoder_push_buffers (enc, TRUE); + return gst_audio_encoder_push_buffers (enc, TRUE); } static void -gst_base_audio_encoder_set_base_gp (GstBaseAudioEncoder * enc) +gst_audio_encoder_set_base_gp (GstAudioEncoder * enc) { GstClockTime ts; @@ -773,15 +764,15 @@ gst_base_audio_encoder_set_base_gp (GstBaseAudioEncoder * enc) } static GstFlowReturn -gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer) +gst_audio_encoder_chain (GstPad * pad, GstBuffer * buffer) { - GstBaseAudioEncoder *enc; - GstBaseAudioEncoderPrivate *priv; - GstBaseAudioEncoderContext *ctx; + GstAudioEncoder *enc; + GstAudioEncoderPrivate *priv; + GstAudioEncoderContext *ctx; GstFlowReturn ret = GST_FLOW_OK; gboolean discont; - enc = GST_BASE_AUDIO_ENCODER (GST_OBJECT_PARENT (pad)); + enc = GST_AUDIO_ENCODER (GST_OBJECT_PARENT (pad)); priv = enc->priv; ctx = &enc->priv->ctx; @@ -845,7 +836,7 @@ gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer) priv->base_ts = GST_BUFFER_TIMESTAMP (buffer); GST_DEBUG_OBJECT (enc, "new base ts %" GST_TIME_FORMAT, GST_TIME_ARGS (priv->base_ts)); - gst_base_audio_encoder_set_base_gp (enc); + gst_audio_encoder_set_base_gp (enc); } /* check for continuity; @@ -900,12 +891,12 @@ gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer) /* care even less about duration after this */ } else { /* drain stuff prior to resync */ - gst_base_audio_encoder_drain (enc); + gst_audio_encoder_drain (enc); } } /* now re-sync ts */ priv->base_ts += diff; - gst_base_audio_encoder_set_base_gp (enc); + gst_audio_encoder_set_base_gp (enc); priv->discont |= discont; } @@ -913,7 +904,7 @@ gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer) /* new stuff, so we can push subclass again */ enc->priv->drained = FALSE; - ret = gst_base_audio_encoder_push_buffers (enc, FALSE); + ret = gst_audio_encoder_push_buffers (enc, FALSE); done: GST_LOG_OBJECT (enc, "chain leaving"); @@ -955,17 +946,17 @@ audio_info_is_equal (GstAudioInfo * from, GstAudioInfo * to) } static gboolean -gst_base_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps) +gst_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps) { - GstBaseAudioEncoder *enc; - GstBaseAudioEncoderClass *klass; - GstBaseAudioEncoderContext *ctx; + GstAudioEncoder *enc; + GstAudioEncoderClass *klass; + GstAudioEncoderContext *ctx; GstAudioInfo *state, *old_state; gboolean res = TRUE, changed = FALSE; guint old_rate; - enc = GST_BASE_AUDIO_ENCODER (GST_PAD_PARENT (pad)); - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + enc = GST_AUDIO_ENCODER (GST_PAD_PARENT (pad)); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); /* subclass must do something here ... */ g_return_val_if_fail (klass->set_format != NULL, FALSE); @@ -998,7 +989,7 @@ gst_base_audio_encoder_sink_setcaps (GstPad * pad, GstCaps * caps) GstClockTime old_max_latency; /* drain any pending old data stuff */ - gst_base_audio_encoder_drain (enc); + gst_audio_encoder_drain (enc); /* context defaults */ enc->priv->ctx.frame_samples = 0; @@ -1041,8 +1032,8 @@ refuse_caps: /** - * gst_base_audio_encoder_proxy_getcaps: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_proxy_getcaps: + * @enc: a #GstAudioEncoder * @caps: initial caps * * Returns caps that express @caps (or sink template caps if @caps == NULL) @@ -1054,7 +1045,7 @@ refuse_caps: * Since: 0.10.36 */ GstCaps * -gst_base_audio_encoder_proxy_getcaps (GstBaseAudioEncoder * enc, GstCaps * caps) +gst_audio_encoder_proxy_getcaps (GstAudioEncoder * enc, GstCaps * caps) { const GstCaps *templ_caps; GstCaps *allowed = NULL; @@ -1109,20 +1100,20 @@ done: } static GstCaps * -gst_base_audio_encoder_sink_getcaps (GstPad * pad) +gst_audio_encoder_sink_getcaps (GstPad * pad) { - GstBaseAudioEncoder *enc; - GstBaseAudioEncoderClass *klass; + GstAudioEncoder *enc; + GstAudioEncoderClass *klass; GstCaps *caps; - enc = GST_BASE_AUDIO_ENCODER (gst_pad_get_parent (pad)); - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + enc = GST_AUDIO_ENCODER (gst_pad_get_parent (pad)); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); g_assert (pad == enc->sinkpad); if (klass->getcaps) caps = klass->getcaps (enc); else - caps = gst_base_audio_encoder_proxy_getcaps (enc, NULL); + caps = gst_audio_encoder_proxy_getcaps (enc, NULL); gst_object_unref (enc); GST_LOG_OBJECT (enc, "returning caps %" GST_PTR_FORMAT, caps); @@ -1131,13 +1122,12 @@ gst_base_audio_encoder_sink_getcaps (GstPad * pad) } static gboolean -gst_base_audio_encoder_sink_eventfunc (GstBaseAudioEncoder * enc, - GstEvent * event) +gst_audio_encoder_sink_eventfunc (GstAudioEncoder * enc, GstEvent * event) { - GstBaseAudioEncoderClass *klass; + GstAudioEncoderClass *klass; gboolean handled = FALSE; - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NEWSEGMENT: @@ -1165,9 +1155,9 @@ gst_base_audio_encoder_sink_eventfunc (GstBaseAudioEncoder * enc, } /* finish current segment */ - gst_base_audio_encoder_drain (enc); + gst_audio_encoder_drain (enc); /* reset partially for new segment */ - gst_base_audio_encoder_reset (enc, FALSE); + gst_audio_encoder_reset (enc, FALSE); /* and follow along with segment */ gst_segment_set_newsegment_full (&enc->segment, update, rate, arate, format, start, stop, time); @@ -1183,11 +1173,11 @@ gst_base_audio_encoder_sink_eventfunc (GstBaseAudioEncoder * enc, if (!enc->priv->drained && klass->flush) klass->flush (enc); /* and get (re)set for the sequel */ - gst_base_audio_encoder_reset (enc, FALSE); + gst_audio_encoder_reset (enc, FALSE); break; case GST_EVENT_EOS: - gst_base_audio_encoder_drain (enc); + gst_audio_encoder_drain (enc); break; default: @@ -1198,15 +1188,15 @@ gst_base_audio_encoder_sink_eventfunc (GstBaseAudioEncoder * enc, } static gboolean -gst_base_audio_encoder_sink_event (GstPad * pad, GstEvent * event) +gst_audio_encoder_sink_event (GstPad * pad, GstEvent * event) { - GstBaseAudioEncoder *enc; - GstBaseAudioEncoderClass *klass; + GstAudioEncoder *enc; + GstAudioEncoderClass *klass; gboolean handled = FALSE; gboolean ret = TRUE; - enc = GST_BASE_AUDIO_ENCODER (gst_pad_get_parent (pad)); - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + enc = GST_AUDIO_ENCODER (gst_pad_get_parent (pad)); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); GST_DEBUG_OBJECT (enc, "received event %d, %s", GST_EVENT_TYPE (event), GST_EVENT_TYPE_NAME (event)); @@ -1215,7 +1205,7 @@ gst_base_audio_encoder_sink_event (GstPad * pad, GstEvent * event) handled = klass->event (enc, event); if (!handled) - handled = gst_base_audio_encoder_sink_eventfunc (enc, event); + handled = gst_audio_encoder_sink_eventfunc (enc, event); if (!handled) ret = gst_pad_event_default (pad, event); @@ -1227,12 +1217,12 @@ gst_base_audio_encoder_sink_event (GstPad * pad, GstEvent * event) } static gboolean -gst_base_audio_encoder_sink_query (GstPad * pad, GstQuery * query) +gst_audio_encoder_sink_query (GstPad * pad, GstQuery * query) { gboolean res = TRUE; - GstBaseAudioEncoder *enc; + GstAudioEncoder *enc; - enc = GST_BASE_AUDIO_ENCODER (gst_pad_get_parent (pad)); + enc = GST_AUDIO_ENCODER (gst_pad_get_parent (pad)); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_FORMATS: @@ -1265,9 +1255,9 @@ error: } static const GstQueryType * -gst_base_audio_encoder_get_query_types (GstPad * pad) +gst_audio_encoder_get_query_types (GstPad * pad) { - static const GstQueryType gst_base_audio_encoder_src_query_types[] = { + static const GstQueryType gst_audio_encoder_src_query_types[] = { GST_QUERY_POSITION, GST_QUERY_DURATION, GST_QUERY_CONVERT, @@ -1275,11 +1265,11 @@ gst_base_audio_encoder_get_query_types (GstPad * pad) 0 }; - return gst_base_audio_encoder_src_query_types; + return gst_audio_encoder_src_query_types; } /* - * gst_base_audio_encoded_audio_convert: + * gst_audio_encoded_audio_convert: * @fmt: audio format of the encoded audio * @bytes: number of encoded bytes * @samples: number of encoded samples @@ -1295,9 +1285,9 @@ gst_base_audio_encoder_get_query_types (GstPad * pad) * * Since: 0.10.36 */ -/* FIXME: make gst_base_audio_encoded_audio_convert() public? */ +/* FIXME: make gst_audio_encoded_audio_convert() public? */ static gboolean -gst_base_audio_encoded_audio_convert (GstAudioInfo * fmt, +gst_audio_encoded_audio_convert (GstAudioInfo * fmt, gint64 bytes, gint64 samples, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value) { @@ -1356,13 +1346,13 @@ exit: * segment stuff etc at all * Supposedly that's backward compatibility ... */ static gboolean -gst_base_audio_encoder_src_query (GstPad * pad, GstQuery * query) +gst_audio_encoder_src_query (GstPad * pad, GstQuery * query) { - GstBaseAudioEncoder *enc; + GstAudioEncoder *enc; GstPad *peerpad; gboolean res = FALSE; - enc = GST_BASE_AUDIO_ENCODER (GST_PAD_PARENT (pad)); + enc = GST_AUDIO_ENCODER (GST_PAD_PARENT (pad)); peerpad = gst_pad_get_peer (GST_PAD (enc->sinkpad)); GST_LOG_OBJECT (enc, "handling query: %" GST_PTR_FORMAT, query); @@ -1430,7 +1420,7 @@ gst_base_audio_encoder_src_query (GstPad * pad, GstQuery * query) gint64 src_val, dest_val; gst_query_parse_convert (query, &src_fmt, &src_val, &dest_fmt, &dest_val); - if (!(res = gst_base_audio_encoded_audio_convert (&enc->priv->ctx.info, + if (!(res = gst_audio_encoded_audio_convert (&enc->priv->ctx.info, enc->priv->bytes_out, enc->priv->samples_in, src_fmt, src_val, &dest_fmt, &dest_val))) break; @@ -1470,12 +1460,12 @@ gst_base_audio_encoder_src_query (GstPad * pad, GstQuery * query) } static void -gst_base_audio_encoder_set_property (GObject * object, guint prop_id, +gst_audio_encoder_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { - GstBaseAudioEncoder *enc; + GstAudioEncoder *enc; - enc = GST_BASE_AUDIO_ENCODER (object); + enc = GST_AUDIO_ENCODER (object); switch (prop_id) { case PROP_PERFECT_TS: @@ -1497,12 +1487,12 @@ gst_base_audio_encoder_set_property (GObject * object, guint prop_id, } static void -gst_base_audio_encoder_get_property (GObject * object, guint prop_id, +gst_audio_encoder_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { - GstBaseAudioEncoder *enc; + GstAudioEncoder *enc; - enc = GST_BASE_AUDIO_ENCODER (object); + enc = GST_AUDIO_ENCODER (object); switch (prop_id) { case PROP_PERFECT_TS: @@ -1524,12 +1514,12 @@ gst_base_audio_encoder_get_property (GObject * object, guint prop_id, } static gboolean -gst_base_audio_encoder_activate (GstBaseAudioEncoder * enc, gboolean active) +gst_audio_encoder_activate (GstAudioEncoder * enc, gboolean active) { - GstBaseAudioEncoderClass *klass; + GstAudioEncoderClass *klass; gboolean result = FALSE; - klass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc); + klass = GST_AUDIO_ENCODER_GET_CLASS (enc); g_return_val_if_fail (!enc->priv->granule || enc->priv->perfect_ts, FALSE); @@ -1548,7 +1538,7 @@ gst_base_audio_encoder_activate (GstBaseAudioEncoder * enc, gboolean active) result = klass->stop (enc); /* clean up */ - gst_base_audio_encoder_reset (enc, TRUE); + gst_audio_encoder_reset (enc, TRUE); } GST_DEBUG_OBJECT (enc, "activate return: %d", result); return result; @@ -1556,16 +1546,16 @@ gst_base_audio_encoder_activate (GstBaseAudioEncoder * enc, gboolean active) static gboolean -gst_base_audio_encoder_sink_activate_push (GstPad * pad, gboolean active) +gst_audio_encoder_sink_activate_push (GstPad * pad, gboolean active) { gboolean result = TRUE; - GstBaseAudioEncoder *enc; + GstAudioEncoder *enc; - enc = GST_BASE_AUDIO_ENCODER (gst_pad_get_parent (pad)); + enc = GST_AUDIO_ENCODER (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (enc, "sink activate push %d", active); - result = gst_base_audio_encoder_activate (enc, active); + result = gst_audio_encoder_activate (enc, active); if (result) enc->priv->active = active; @@ -1577,24 +1567,24 @@ gst_base_audio_encoder_sink_activate_push (GstPad * pad, gboolean active) } /** - * gst_base_audio_encoder_get_audio_info: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_audio_info: + * @enc: a #GstAudioEncoder * * Returns: a #GstAudioInfo describing the input audio format * * Since: 0.10.36 */ GstAudioInfo * -gst_base_audio_encoder_get_audio_info (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_audio_info (GstAudioEncoder * enc) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), NULL); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), NULL); return &enc->priv->ctx.info; } /** - * gst_base_audio_encoder_set_frame_samples: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_frame_samples: + * @enc: a #GstAudioEncoder * @num: number of samples per frame * * Sets number of samples (per channel) subclass needs to be handed, @@ -1603,32 +1593,32 @@ gst_base_audio_encoder_get_audio_info (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_frame_samples (GstBaseAudioEncoder * enc, gint num) +gst_audio_encoder_set_frame_samples (GstAudioEncoder * enc, gint num) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); enc->priv->ctx.frame_samples = num; } /** - * gst_base_audio_encoder_get_frame_samples: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_frame_samples: + * @enc: a #GstAudioEncoder * * Returns: currently requested samples per frame * * Since: 0.10.36 */ gint -gst_base_audio_encoder_get_frame_samples (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_frame_samples (GstAudioEncoder * enc) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), 0); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), 0); return enc->priv->ctx.frame_samples; } /** - * gst_base_audio_encoder_set_frame_max: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_frame_max: + * @enc: a #GstAudioEncoder * @num: number of frames * * Sets max number of frames accepted at once (assumed minimally 1) @@ -1636,32 +1626,32 @@ gst_base_audio_encoder_get_frame_samples (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_frame_max (GstBaseAudioEncoder * enc, gint num) +gst_audio_encoder_set_frame_max (GstAudioEncoder * enc, gint num) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); enc->priv->ctx.frame_max = num; } /** - * gst_base_audio_encoder_get_frame_max: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_frame_max: + * @enc: a #GstAudioEncoder * * Returns: currently configured maximum handled frames * * Since: 0.10.36 */ gint -gst_base_audio_encoder_get_frame_max (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_frame_max (GstAudioEncoder * enc) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), 0); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), 0); return enc->priv->ctx.frame_max; } /** - * gst_base_audio_encoder_set_lookahead: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_lookahead: + * @enc: a #GstAudioEncoder * @num: lookahead * * Sets encoder lookahead (in units of input rate samples) @@ -1669,30 +1659,30 @@ gst_base_audio_encoder_get_frame_max (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_lookahead (GstBaseAudioEncoder * enc, gint num) +gst_audio_encoder_set_lookahead (GstAudioEncoder * enc, gint num) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); enc->priv->ctx.lookahead = num; } /** - * gst_base_audio_encoder_get_lookahead: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_lookahead: + * @enc: a #GstAudioEncoder * * Returns: currently configured encoder lookahead */ gint -gst_base_audio_encoder_get_lookahead (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_lookahead (GstAudioEncoder * enc) { - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), 0); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), 0); return enc->priv->ctx.lookahead; } /** - * gst_base_audio_encoder_set_latency: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_latency: + * @enc: a #GstAudioEncoder * @min: minimum latency * @max: maximum latency * @@ -1701,10 +1691,10 @@ gst_base_audio_encoder_get_lookahead (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_latency (GstBaseAudioEncoder * enc, +gst_audio_encoder_set_latency (GstAudioEncoder * enc, GstClockTime min, GstClockTime max) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_OBJECT_LOCK (enc); enc->priv->ctx.min_latency = min; @@ -1713,8 +1703,8 @@ gst_base_audio_encoder_set_latency (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_get_latency: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_latency: + * @enc: a #GstAudioEncoder * @min: a pointer to storage to hold minimum latency * @max: a pointer to storage to hold maximum latency * @@ -1723,10 +1713,10 @@ gst_base_audio_encoder_set_latency (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ void -gst_base_audio_encoder_get_latency (GstBaseAudioEncoder * enc, +gst_audio_encoder_get_latency (GstAudioEncoder * enc, GstClockTime * min, GstClockTime * max) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_OBJECT_LOCK (enc); if (min) @@ -1737,8 +1727,8 @@ gst_base_audio_encoder_get_latency (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_set_mark_granule: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_mark_granule: + * @enc: a #GstAudioEncoder * @enabled: new state * * Enable or disable encoder granule handling. @@ -1748,10 +1738,9 @@ gst_base_audio_encoder_get_latency (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ void -gst_base_audio_encoder_set_mark_granule (GstBaseAudioEncoder * enc, - gboolean enabled) +gst_audio_encoder_set_mark_granule (GstAudioEncoder * enc, gboolean enabled) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_LOG_OBJECT (enc, "enabled: %d", enabled); @@ -1761,8 +1750,8 @@ gst_base_audio_encoder_set_mark_granule (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_get_mark_granule: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_mark_granule: + * @enc: a #GstAudioEncoder * * Queries if the encoder will handle granule marking. * @@ -1773,11 +1762,11 @@ gst_base_audio_encoder_set_mark_granule (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ gboolean -gst_base_audio_encoder_get_mark_granule (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_mark_granule (GstAudioEncoder * enc) { gboolean result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), FALSE); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), FALSE); GST_OBJECT_LOCK (enc); result = enc->priv->granule; @@ -1787,8 +1776,8 @@ gst_base_audio_encoder_get_mark_granule (GstBaseAudioEncoder * enc) } /** - * gst_base_audio_encoder_set_perfect_timestamp: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_perfect_timestamp: + * @enc: a #GstAudioEncoder * @enabled: new state * * Enable or disable encoder perfect output timestamp preference. @@ -1798,10 +1787,10 @@ gst_base_audio_encoder_get_mark_granule (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_perfect_timestamp (GstBaseAudioEncoder * enc, +gst_audio_encoder_set_perfect_timestamp (GstAudioEncoder * enc, gboolean enabled) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_LOG_OBJECT (enc, "enabled: %d", enabled); @@ -1811,8 +1800,8 @@ gst_base_audio_encoder_set_perfect_timestamp (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_get_perfect_timestamp: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_perfect_timestamp: + * @enc: a #GstAudioEncoder * * Queries encoder perfect timestamp behaviour. * @@ -1823,11 +1812,11 @@ gst_base_audio_encoder_set_perfect_timestamp (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ gboolean -gst_base_audio_encoder_get_perfect_timestamp (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_perfect_timestamp (GstAudioEncoder * enc) { gboolean result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), FALSE); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), FALSE); GST_OBJECT_LOCK (enc); result = enc->priv->perfect_ts; @@ -1837,8 +1826,8 @@ gst_base_audio_encoder_get_perfect_timestamp (GstBaseAudioEncoder * enc) } /** - * gst_base_audio_encoder_set_hard_sync: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_hard_sync: + * @enc: a #GstAudioEncoder * @enabled: new state * * Sets encoder hard resync handling. @@ -1848,10 +1837,9 @@ gst_base_audio_encoder_get_perfect_timestamp (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_hard_resync (GstBaseAudioEncoder * enc, - gboolean enabled) +gst_audio_encoder_set_hard_resync (GstAudioEncoder * enc, gboolean enabled) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_LOG_OBJECT (enc, "enabled: %d", enabled); @@ -1861,8 +1849,8 @@ gst_base_audio_encoder_set_hard_resync (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_get_hard_sync: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_hard_sync: + * @enc: a #GstAudioEncoder * * Queries encoder's hard resync setting. * @@ -1873,11 +1861,11 @@ gst_base_audio_encoder_set_hard_resync (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ gboolean -gst_base_audio_encoder_get_hard_resync (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_hard_resync (GstAudioEncoder * enc) { gboolean result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), FALSE); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), FALSE); GST_OBJECT_LOCK (enc); result = enc->priv->hard_resync; @@ -1887,8 +1875,8 @@ gst_base_audio_encoder_get_hard_resync (GstBaseAudioEncoder * enc) } /** - * gst_base_audio_encoder_set_tolerance: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_set_tolerance: + * @enc: a #GstAudioEncoder * @tolerance: new tolerance * * Configures encoder audio jitter tolerance threshold. @@ -1898,10 +1886,9 @@ gst_base_audio_encoder_get_hard_resync (GstBaseAudioEncoder * enc) * Since: 0.10.36 */ void -gst_base_audio_encoder_set_tolerance (GstBaseAudioEncoder * enc, - gint64 tolerance) +gst_audio_encoder_set_tolerance (GstAudioEncoder * enc, gint64 tolerance) { - g_return_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc)); + g_return_if_fail (GST_IS_AUDIO_ENCODER (enc)); GST_OBJECT_LOCK (enc); enc->priv->tolerance = tolerance; @@ -1909,8 +1896,8 @@ gst_base_audio_encoder_set_tolerance (GstBaseAudioEncoder * enc, } /** - * gst_base_audio_encoder_get_tolerance: - * @enc: a #GstBaseAudioEncoder + * gst_audio_encoder_get_tolerance: + * @enc: a #GstAudioEncoder * * Queries current audio jitter tolerance threshold. * @@ -1921,11 +1908,11 @@ gst_base_audio_encoder_set_tolerance (GstBaseAudioEncoder * enc, * Since: 0.10.36 */ gint64 -gst_base_audio_encoder_get_tolerance (GstBaseAudioEncoder * enc) +gst_audio_encoder_get_tolerance (GstAudioEncoder * enc) { gint64 result; - g_return_val_if_fail (GST_IS_BASE_AUDIO_ENCODER (enc), 0); + g_return_val_if_fail (GST_IS_AUDIO_ENCODER (enc), 0); GST_OBJECT_LOCK (enc); result = enc->priv->tolerance; diff --git a/gst-libs/gst/audio/gstaudioencoder.h b/gst-libs/gst/audio/gstaudioencoder.h new file mode 100644 index 0000000..ada952f --- /dev/null +++ b/gst-libs/gst/audio/gstaudioencoder.h @@ -0,0 +1,244 @@ +/* GStreamer + * Copyright (C) 2011 Mark Nauwelaerts . + * Copyright (C) 2011 Nokia Corporation. All rights reserved. + * Contact: Stefan Kost + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __GST_AUDIO_ENCODER_H__ +#define __GST_AUDIO_ENCODER_H__ + +#ifndef GST_USE_UNSTABLE_API +#warning "GstAudioEncoder is unstable API and may change in future." +#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." +#endif + +#include +#include + +G_BEGIN_DECLS + +#define GST_TYPE_AUDIO_ENCODER (gst_audio_encoder_get_type()) +#define GST_AUDIO_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUDIO_ENCODER,GstAudioEncoder)) +#define GST_AUDIO_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUDIO_ENCODER,GstAudioEncoderClass)) +#define GST_AUDIO_ENCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_AUDIO_ENCODER,GstAudioEncoderClass)) +#define GST_IS_AUDIO_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUDIO_ENCODER)) +#define GST_IS_AUDIO_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUDIO_ENCODER)) +#define GST_AUDIO_ENCODER_CAST(obj) ((GstAudioEncoder *)(obj)) + +/** + * GST_AUDIO_ENCODER_SINK_NAME: + * + * the name of the templates for the sink pad + * + * Since: 0.10.36 + */ +#define GST_AUDIO_ENCODER_SINK_NAME "sink" +/** + * GST_AUDIO_ENCODER_SRC_NAME: + * + * the name of the templates for the source pad + * + * Since: 0.10.36 + */ +#define GST_AUDIO_ENCODER_SRC_NAME "src" + +/** + * GST_AUDIO_ENCODER_SRC_PAD: + * @obj: base parse instance + * + * Gives the pointer to the source #GstPad object of the element. + * + * Since: 0.10.36 + */ +#define GST_AUDIO_ENCODER_SRC_PAD(obj) (GST_AUDIO_ENCODER_CAST (obj)->srcpad) + +/** + * GST_AUDIO_ENCODER_SINK_PAD: + * @obj: base parse instance + * + * Gives the pointer to the sink #GstPad object of the element. + * + * Since: 0.10.36 + */ +#define GST_AUDIO_ENCODER_SINK_PAD(obj) (GST_AUDIO_ENCODER_CAST (obj)->sinkpad) + +/** + * GST_AUDIO_ENCODER_SEGMENT: + * @obj: base parse instance + * + * Gives the segment of the element. + * + * Since: 0.10.36 + */ +#define GST_AUDIO_ENCODER_SEGMENT(obj) (GST_AUDIO_ENCODER_CAST (obj)->segment) + + +typedef struct _GstAudioEncoder GstAudioEncoder; +typedef struct _GstAudioEncoderClass GstAudioEncoderClass; + +typedef struct _GstAudioEncoderPrivate GstAudioEncoderPrivate; + +/** + * GstAudioEncoder: + * @element: the parent element. + * + * The opaque #GstAudioEncoder data structure. + * + * Since: 0.10.36 + */ +struct _GstAudioEncoder { + GstElement element; + + /*< protected >*/ + /* source and sink pads */ + GstPad *sinkpad; + GstPad *srcpad; + + /* MT-protected (with STREAM_LOCK) */ + GstSegment segment; + + /*< private >*/ + GstAudioEncoderPrivate *priv; + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +/** + * GstAudioEncoderClass: + * @start: Optional. + * Called when the element starts processing. + * Allows opening external resources. + * @stop: Optional. + * Called when the element stops processing. + * Allows closing external resources. + * @set_format: Notifies subclass of incoming data format. + * GstAudioInfo contains the format according to provided caps. + * @handle_frame: Provides input samples (or NULL to clear any remaining data) + * according to directions as provided by subclass in the + * #GstAudioEncoderContext. Input data ref management + * is performed by base class, subclass should not care or + * intervene. + * @flush: Optional. + * Instructs subclass to clear any codec caches and discard + * any pending samples and not yet returned encoded data. + * @event: Optional. + * Event handler on the sink pad. This function should return + * TRUE if the event was handled and should be discarded + * (i.e. not unref'ed). + * @pre_push: Optional. + * Called just prior to pushing (encoded data) buffer downstream. + * Subclass has full discretionary access to buffer, + * and a not OK flow return will abort downstream pushing. + * @getcaps: Optional. + * Allows for a custom sink getcaps implementation (e.g. + * for multichannel input specification). If not implemented, + * default returns gst_audio_encoder_proxy_getcaps + * applied to sink template caps. + * + * Subclasses can override any of the available virtual methods or not, as + * needed. At minimum @set_format and @handle_frame needs to be overridden. + * + * Since: 0.10.36 + */ +struct _GstAudioEncoderClass { + GstElementClass parent_class; + + /*< public >*/ + /* virtual methods for subclasses */ + + gboolean (*start) (GstAudioEncoder *enc); + + gboolean (*stop) (GstAudioEncoder *enc); + + gboolean (*set_format) (GstAudioEncoder *enc, + GstAudioInfo *info); + + GstFlowReturn (*handle_frame) (GstAudioEncoder *enc, + GstBuffer *buffer); + + void (*flush) (GstAudioEncoder *enc); + + GstFlowReturn (*pre_push) (GstAudioEncoder *enc, + GstBuffer **buffer); + + gboolean (*event) (GstAudioEncoder *enc, + GstEvent *event); + + GstCaps * (*getcaps) (GstAudioEncoder *enc); + + /*< private >*/ + gpointer _gst_reserved[GST_PADDING_LARGE]; +}; + +GType gst_audio_encoder_get_type (void); + +GstFlowReturn gst_audio_encoder_finish_frame (GstAudioEncoder * enc, + GstBuffer * buffer, + gint samples); + +GstCaps * gst_audio_encoder_proxy_getcaps (GstAudioEncoder * enc, + GstCaps * caps); + + +/* context parameters */ +GstAudioInfo * gst_audio_encoder_get_audio_info (GstAudioEncoder * enc); + +gint gst_audio_encoder_get_frame_samples (GstAudioEncoder * enc); + +void gst_audio_encoder_set_frame_samples (GstAudioEncoder * enc, gint num); + +gint gst_audio_encoder_get_frame_max (GstAudioEncoder * enc); + +void gst_audio_encoder_set_frame_max (GstAudioEncoder * enc, gint num); + +gint gst_audio_encoder_get_lookahead (GstAudioEncoder * enc); + +void gst_audio_encoder_set_lookahead (GstAudioEncoder * enc, gint num); + +void gst_audio_encoder_get_latency (GstAudioEncoder * enc, + GstClockTime * min, + GstClockTime * max); + +void gst_audio_encoder_set_latency (GstAudioEncoder * enc, + GstClockTime min, + GstClockTime max); + +/* object properties */ + +void gst_audio_encoder_set_mark_granule (GstAudioEncoder * enc, + gboolean enabled); + +gboolean gst_audio_encoder_get_mark_granule (GstAudioEncoder * enc); + +void gst_audio_encoder_set_perfect_timestamp (GstAudioEncoder * enc, + gboolean enabled); + +gboolean gst_audio_encoder_get_perfect_timestamp (GstAudioEncoder * enc); + +void gst_audio_encoder_set_hard_resync (GstAudioEncoder * enc, + gboolean enabled); + +gboolean gst_audio_encoder_get_hard_resync (GstAudioEncoder * enc); + +void gst_audio_encoder_set_tolerance (GstAudioEncoder * enc, + gint64 tolerance); + +gint64 gst_audio_encoder_get_tolerance (GstAudioEncoder * enc); + +G_END_DECLS + +#endif /* __GST_AUDIO_ENCODER_H__ */ diff --git a/gst-libs/gst/audio/gstbaseaudioencoder.h b/gst-libs/gst/audio/gstbaseaudioencoder.h deleted file mode 100644 index fa948da..0000000 --- a/gst-libs/gst/audio/gstbaseaudioencoder.h +++ /dev/null @@ -1,235 +0,0 @@ -/* GStreamer - * Copyright (C) 2011 Mark Nauwelaerts . - * Copyright (C) 2011 Nokia Corporation. All rights reserved. - * Contact: Stefan Kost - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 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 - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __GST_BASE_AUDIO_ENCODER_H__ -#define __GST_BASE_AUDIO_ENCODER_H__ - -#ifndef GST_USE_UNSTABLE_API -#warning "GstBaseAudioEncoder is unstable API and may change in future." -#warning "You can define GST_USE_UNSTABLE_API to avoid this warning." -#endif - -#include -#include - -G_BEGIN_DECLS - -#define GST_TYPE_BASE_AUDIO_ENCODER (gst_base_audio_encoder_get_type()) -#define GST_BASE_AUDIO_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_BASE_AUDIO_ENCODER,GstBaseAudioEncoder)) -#define GST_BASE_AUDIO_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_BASE_AUDIO_ENCODER,GstBaseAudioEncoderClass)) -#define GST_BASE_AUDIO_ENCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_BASE_AUDIO_ENCODER,GstBaseAudioEncoderClass)) -#define GST_IS_BASE_AUDIO_ENCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_BASE_AUDIO_ENCODER)) -#define GST_IS_BASE_AUDIO_ENCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_BASE_AUDIO_ENCODER)) -#define GST_BASE_AUDIO_ENCODER_CAST(obj) ((GstBaseAudioEncoder *)(obj)) - -/** - * GST_BASE_AUDIO_ENCODER_SINK_NAME: - * - * the name of the templates for the sink pad - * - * Since: 0.10.36 - */ -#define GST_BASE_AUDIO_ENCODER_SINK_NAME "sink" -/** - * GST_BASE_AUDIO_ENCODER_SRC_NAME: - * - * the name of the templates for the source pad - * - * Since: 0.10.36 - */ -#define GST_BASE_AUDIO_ENCODER_SRC_NAME "src" - -/** - * GST_BASE_AUDIO_ENCODER_SRC_PAD: - * @obj: base parse instance - * - * Gives the pointer to the source #GstPad object of the element. - * - * Since: 0.10.36 - */ -#define GST_BASE_AUDIO_ENCODER_SRC_PAD(obj) (GST_BASE_AUDIO_ENCODER_CAST (obj)->srcpad) - -/** - * GST_BASE_AUDIO_ENCODER_SINK_PAD: - * @obj: base parse instance - * - * Gives the pointer to the sink #GstPad object of the element. - * - * Since: 0.10.36 - */ -#define GST_BASE_AUDIO_ENCODER_SINK_PAD(obj) (GST_BASE_AUDIO_ENCODER_CAST (obj)->sinkpad) - -/** - * GST_BASE_AUDIO_ENCODER_SEGMENT: - * @obj: base parse instance - * - * Gives the segment of the element. - * - * Since: 0.10.36 - */ -#define GST_BASE_AUDIO_ENCODER_SEGMENT(obj) (GST_BASE_AUDIO_ENCODER_CAST (obj)->segment) - - -typedef struct _GstBaseAudioEncoder GstBaseAudioEncoder; -typedef struct _GstBaseAudioEncoderClass GstBaseAudioEncoderClass; - -typedef struct _GstBaseAudioEncoderPrivate GstBaseAudioEncoderPrivate; - -/** - * GstBaseAudioEncoder: - * @element: the parent element. - * - * The opaque #GstBaseAudioEncoder data structure. - * - * Since: 0.10.36 - */ -struct _GstBaseAudioEncoder { - GstElement element; - - /*< protected >*/ - /* source and sink pads */ - GstPad *sinkpad; - GstPad *srcpad; - - /* MT-protected (with STREAM_LOCK) */ - GstSegment segment; - - /*< private >*/ - GstBaseAudioEncoderPrivate *priv; - gpointer _gst_reserved[GST_PADDING_LARGE]; -}; - -/** - * GstBaseAudioEncoderClass: - * @start: Optional. - * Called when the element starts processing. - * Allows opening external resources. - * @stop: Optional. - * Called when the element stops processing. - * Allows closing external resources. - * @set_format: Notifies subclass of incoming data format. - * GstAudioInfo contains the format according to provided caps. - * @handle_frame: Provides input samples (or NULL to clear any remaining data) - * according to directions as provided by subclass in the - * #GstBaseAudioEncoderContext. Input data ref management - * is performed by base class, subclass should not care or - * intervene. - * @flush: Optional. - * Instructs subclass to clear any codec caches and discard - * any pending samples and not yet returned encoded data. - * @event: Optional. - * Event handler on the sink pad. This function should return - * TRUE if the event was handled and should be discarded - * (i.e. not unref'ed). - * @pre_push: Optional. - * Called just prior to pushing (encoded data) buffer downstream. - * Subclass has full discretionary access to buffer, - * and a not OK flow return will abort downstream pushing. - * @getcaps: Optional. - * Allows for a custom sink getcaps implementation (e.g. - * for multichannel input specification). If not implemented, - * default returns gst_base_audio_encoder_proxy_getcaps - * applied to sink template caps. - * - * Subclasses can override any of the available virtual methods or not, as - * needed. At minimum @set_format and @handle_frame needs to be overridden. - * - * Since: 0.10.36 - */ -struct _GstBaseAudioEncoderClass { - GstElementClass parent_class; - - /*< public >*/ - /* virtual methods for subclasses */ - - gboolean (*start) (GstBaseAudioEncoder *enc); - - gboolean (*stop) (GstBaseAudioEncoder *enc); - - gboolean (*set_format) (GstBaseAudioEncoder *enc, - GstAudioInfo *info); - - GstFlowReturn (*handle_frame) (GstBaseAudioEncoder *enc, - GstBuffer *buffer); - - void (*flush) (GstBaseAudioEncoder *enc); - - GstFlowReturn (*pre_push) (GstBaseAudioEncoder *enc, - GstBuffer **buffer); - - gboolean (*event) (GstBaseAudioEncoder *enc, - GstEvent *event); - - GstCaps * (*getcaps) (GstBaseAudioEncoder *enc); - - /*< private >*/ - gpointer _gst_reserved[GST_PADDING_LARGE]; -}; - -GType gst_base_audio_encoder_get_type (void); - -GstFlowReturn gst_base_audio_encoder_finish_frame (GstBaseAudioEncoder * enc, - GstBuffer *buffer, gint samples); - -GstCaps * gst_base_audio_encoder_proxy_getcaps (GstBaseAudioEncoder * enc, - GstCaps * caps); - - -/* context parameters */ -GstAudioInfo * gst_base_audio_encoder_get_audio_info (GstBaseAudioEncoder * enc); - -gint gst_base_audio_encoder_get_frame_samples (GstBaseAudioEncoder * enc); -void gst_base_audio_encoder_set_frame_samples (GstBaseAudioEncoder * enc, - gint num); - -gint gst_base_audio_encoder_get_frame_max (GstBaseAudioEncoder * enc); -void gst_base_audio_encoder_set_frame_max (GstBaseAudioEncoder * enc, - gint num); - -gint gst_base_audio_encoder_get_lookahead (GstBaseAudioEncoder * enc); -void gst_base_audio_encoder_set_lookahead (GstBaseAudioEncoder * enc, - gint num); - -void gst_base_audio_encoder_get_latency (GstBaseAudioEncoder * enc, - GstClockTime * min, GstClockTime * max); -void gst_base_audio_encoder_set_latency (GstBaseAudioEncoder * enc, - GstClockTime min, GstClockTime max); - -/* object properties */ -void gst_base_audio_encoder_set_mark_granule (GstBaseAudioEncoder * enc, - gboolean enabled); -gboolean gst_base_audio_encoder_get_mark_granule (GstBaseAudioEncoder * enc); - -void gst_base_audio_encoder_set_perfect_timestamp (GstBaseAudioEncoder * enc, - gboolean enabled); -gboolean gst_base_audio_encoder_get_perfect_timestamp (GstBaseAudioEncoder * enc); - -void gst_base_audio_encoder_set_hard_resync (GstBaseAudioEncoder * enc, - gboolean enabled); -gboolean gst_base_audio_encoder_get_hard_resync (GstBaseAudioEncoder * enc); - -void gst_base_audio_encoder_set_tolerance (GstBaseAudioEncoder * enc, - gint64 tolerance); -gint64 gst_base_audio_encoder_get_tolerance (GstBaseAudioEncoder * enc); - -G_END_DECLS - -#endif /* __GST_BASE_AUDIO_ENCODER_H__ */ diff --git a/win32/common/libgstaudio.def b/win32/common/libgstaudio.def index 414a967..0500ea6 100644 --- a/win32/common/libgstaudio.def +++ b/win32/common/libgstaudio.def @@ -1,5 +1,5 @@ EXPORTS - _gst_base_audio_decoder_error + _gst_audio_decoder_error gst_audio_buffer_clip gst_audio_channel_position_get_type gst_audio_check_channel_positions @@ -10,8 +10,47 @@ EXPORTS gst_audio_clock_new gst_audio_clock_new_full gst_audio_clock_reset + gst_audio_decoder_finish_frame + gst_audio_decoder_get_audio_info + gst_audio_decoder_get_byte_time + gst_audio_decoder_get_delay + gst_audio_decoder_get_latency + gst_audio_decoder_get_max_errors + gst_audio_decoder_get_min_latency + gst_audio_decoder_get_parse_state + gst_audio_decoder_get_plc + gst_audio_decoder_get_plc_aware + gst_audio_decoder_get_tolerance + gst_audio_decoder_get_type + gst_audio_decoder_set_byte_time + gst_audio_decoder_set_latency + gst_audio_decoder_set_max_errors + gst_audio_decoder_set_min_latency + gst_audio_decoder_set_plc + gst_audio_decoder_set_plc_aware + gst_audio_decoder_set_tolerance gst_audio_default_registry_mixer_filter gst_audio_duration_from_pad_buffer + gst_audio_encoder_finish_frame + gst_audio_encoder_get_audio_info + gst_audio_encoder_get_frame_max + gst_audio_encoder_get_frame_samples + gst_audio_encoder_get_hard_resync + gst_audio_encoder_get_latency + gst_audio_encoder_get_lookahead + gst_audio_encoder_get_mark_granule + gst_audio_encoder_get_perfect_timestamp + gst_audio_encoder_get_tolerance + gst_audio_encoder_get_type + gst_audio_encoder_proxy_getcaps + gst_audio_encoder_set_frame_max + gst_audio_encoder_set_frame_samples + gst_audio_encoder_set_hard_resync + gst_audio_encoder_set_latency + gst_audio_encoder_set_lookahead + gst_audio_encoder_set_mark_granule + gst_audio_encoder_set_perfect_timestamp + gst_audio_encoder_set_tolerance gst_audio_filter_class_add_pad_templates gst_audio_filter_get_type gst_audio_fixate_channel_positions @@ -34,45 +73,6 @@ EXPORTS gst_audio_sink_get_type gst_audio_src_get_type gst_audio_structure_set_int - gst_base_audio_decoder_finish_frame - gst_base_audio_decoder_get_audio_info - gst_base_audio_decoder_get_byte_time - gst_base_audio_decoder_get_delay - gst_base_audio_decoder_get_latency - gst_base_audio_decoder_get_max_errors - gst_base_audio_decoder_get_min_latency - gst_base_audio_decoder_get_parse_state - gst_base_audio_decoder_get_plc - gst_base_audio_decoder_get_plc_aware - gst_base_audio_decoder_get_tolerance - gst_base_audio_decoder_get_type - gst_base_audio_decoder_set_byte_time - gst_base_audio_decoder_set_latency - gst_base_audio_decoder_set_max_errors - gst_base_audio_decoder_set_min_latency - gst_base_audio_decoder_set_plc - gst_base_audio_decoder_set_plc_aware - gst_base_audio_decoder_set_tolerance - gst_base_audio_encoder_finish_frame - gst_base_audio_encoder_get_audio_info - gst_base_audio_encoder_get_frame_max - gst_base_audio_encoder_get_frame_samples - gst_base_audio_encoder_get_hard_resync - gst_base_audio_encoder_get_latency - gst_base_audio_encoder_get_lookahead - gst_base_audio_encoder_get_mark_granule - gst_base_audio_encoder_get_perfect_timestamp - gst_base_audio_encoder_get_tolerance - gst_base_audio_encoder_get_type - gst_base_audio_encoder_proxy_getcaps - gst_base_audio_encoder_set_frame_max - gst_base_audio_encoder_set_frame_samples - gst_base_audio_encoder_set_hard_resync - gst_base_audio_encoder_set_latency - gst_base_audio_encoder_set_lookahead - gst_base_audio_encoder_set_mark_granule - gst_base_audio_encoder_set_perfect_timestamp - gst_base_audio_encoder_set_tolerance gst_base_audio_sink_create_ringbuffer gst_base_audio_sink_get_drift_tolerance gst_base_audio_sink_get_provide_clock -- 2.7.4