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
This commit is contained in:
Tim-Philipp Müller 2011-09-05 15:01:09 +01:00
parent 2768ed75e0
commit 86e6343759
7 changed files with 845 additions and 856 deletions

View file

@ -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 \

View file

@ -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_base_audio_decoder_set_plc_aware (GstBaseAudioDecoder * dec,
gboolean plc);
gint gst_base_audio_decoder_get_plc_aware (GstBaseAudioDecoder * dec);
void gst_audio_decoder_set_plc_aware (GstAudioDecoder * dec,
gboolean plc);
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_plc_aware (GstAudioDecoder * dec);
gint gst_base_audio_decoder_get_delay (GstBaseAudioDecoder * dec);
void gst_audio_decoder_set_byte_time (GstAudioDecoder * dec,
gboolean enabled);
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_byte_time (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);
gint gst_audio_decoder_get_delay (GstAudioDecoder * dec);
void gst_base_audio_decoder_get_parse_state (GstBaseAudioDecoder * dec,
gboolean * sync, gboolean * eos);
void gst_audio_decoder_set_max_errors (GstAudioDecoder * enc,
gint num);
gint gst_audio_decoder_get_max_errors (GstAudioDecoder * dec);
void gst_audio_decoder_set_latency (GstAudioDecoder * dec,
GstClockTime min,
GstClockTime max);
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);
gint64 gst_audio_decoder_get_tolerance (GstAudioDecoder * dec);
G_END_DECLS
#endif
#endif /* _GST_AUDIO_DECODER_H_ */

View file

@ -0,0 +1,244 @@
/* GStreamer
* Copyright (C) 2011 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>.
* Copyright (C) 2011 Nokia Corporation. All rights reserved.
* Contact: Stefan Kost <stefan.kost@nokia.com>
*
* 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 <gst/gst.h>
#include <gst/audio/audio.h>
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__ */

View file

@ -1,235 +0,0 @@
/* GStreamer
* Copyright (C) 2011 Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>.
* Copyright (C) 2011 Nokia Corporation. All rights reserved.
* Contact: Stefan Kost <stefan.kost@nokia.com>
*
* 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 <gst/gst.h>
#include <gst/audio/audio.h>
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__ */

View file

@ -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