audio: Integrate audio base classes into the build system and fixup

This commit is contained in:
Sebastian Dröge 2011-08-15 13:06:51 +02:00
parent 0d07b52760
commit 0a44778d61
5 changed files with 33 additions and 47 deletions

View file

@ -14,7 +14,10 @@ libgstopenmax_la_SOURCES = \
gstbasevideocodec.c \
gstbasevideodecoder.c \
gstbasevideoencoder.c \
gstbasevideoutils.c
gstbasevideoutils.c \
gstbaseaudiodecoder.c \
gstbaseaudioencoder.c \
gstbaseaudioutils.c
noinst_HEADERS = \
gstomx.h \
@ -30,7 +33,10 @@ noinst_HEADERS = \
gstbasevideocodec.h \
gstbasevideodecoder.h \
gstbasevideoencoder.h \
gstbasevideoutils.h
gstbasevideoutils.h \
gstbaseaudiodecoder.h \
gstbaseaudioencoder.h \
gstbaseaudioutils.h
fixbaseclasses = \
-DGstBaseVideoCodec=OMXBaseVideoCodec \
@ -38,7 +44,11 @@ fixbaseclasses = \
-DGstBaseVideoEncoder=OMXBaseVideoEncoder \
-DGstBaseVideoEncoderClass=OMXBaseVideoEncoderClass \
-DGstBaseVideoDecoder=OMXBaseVideoDecoder \
-DGstBaseVideoDecoderClass=OMXBaseVideoDecoderClass
-DGstBaseVideoDecoderClass=OMXBaseVideoDecoderClass \
-DGstBaseAudioDecoder=OMXBaseAudioDecoder \
-DGstBaseAudioDecoderClass=OMXBaseAudioDecoderClass \
-DGstBaseAudioEncoder=OMXBaseAudioEncoder \
-DGstBaseAudioEncoderClass=OMXBaseAudioEncoderClass
libgstopenmax_la_CFLAGS = \
-DGST_USE_UNSTABLE_API=1 \
@ -49,6 +59,8 @@ libgstopenmax_la_CFLAGS = \
$(fixbaseclasses)
libgstopenmax_la_LIBADD = \
$(GST_PLUGINS_BASE_LIBS) \
-lgstaudio-@GST_MAJORMINOR@ \
-lgstpbutils-@GST_MAJORMINOR@ \
-lgstvideo-@GST_MAJORMINOR@ \
$(GST_BASE_LIBS) \
$(GST_LIBS)

View file

@ -1463,11 +1463,9 @@ static gboolean
gst_base_audio_decoder_src_event (GstPad * pad, GstEvent * event)
{
GstBaseAudioDecoder *dec;
GstBaseAudioDecoderClass *klass;
gboolean res = FALSE;
dec = GST_BASE_AUDIO_DECODER (gst_pad_get_parent (pad));
klass = GST_BASE_AUDIO_DECODER_GET_CLASS (dec);
GST_DEBUG_OBJECT (dec, "received event %d, %s", GST_EVENT_TYPE (event),
GST_EVENT_TYPE_NAME (event));
@ -1807,11 +1805,9 @@ gst_base_audio_decoder_change_state (GstElement * element,
GstStateChange transition)
{
GstBaseAudioDecoder *codec;
GstBaseAudioDecoderClass *codec_class;
GstStateChangeReturn ret;
codec = GST_BASE_AUDIO_DECODER (element);
codec_class = GST_BASE_AUDIO_DECODER_GET_CLASS (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:

View file

@ -30,8 +30,8 @@
#endif
#include <gst/gst.h>
#include <gst/audio/gstbaseaudioutils.h>
#include <gst/base/gstadapter.h>
#include "gstbaseaudioutils.h"
G_BEGIN_DECLS

View file

@ -220,45 +220,21 @@ 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);
GType
gst_base_audio_encoder_get_type (void)
static void
do_init (GType gtype)
{
static GType base_audio_encoder_type = 0;
const GInterfaceInfo preset_interface_info = {
NULL, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
if (!base_audio_encoder_type) {
static const GTypeInfo base_audio_encoder_info = {
sizeof (GstBaseAudioEncoderClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gst_base_audio_encoder_class_init,
NULL,
NULL,
sizeof (GstBaseAudioEncoder),
0,
(GInstanceInitFunc) gst_base_audio_encoder_init,
};
const GInterfaceInfo preset_interface_info = {
NULL, /* interface_init */
NULL, /* interface_finalize */
NULL /* interface_data */
};
base_audio_encoder_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstBaseAudioEncoder", &base_audio_encoder_info, G_TYPE_FLAG_ABSTRACT);
g_type_add_interface_static (base_audio_encoder_type, GST_TYPE_PRESET,
&preset_interface_info);
}
return base_audio_encoder_type;
g_type_add_interface_static (gtype, GST_TYPE_PRESET, &preset_interface_info);
}
GST_BOILERPLATE_FULL (GstBaseAudioEncoder, gst_base_audio_encoder, GstElement,
GST_TYPE_ELEMENT, do_init);
static void gst_base_audio_encoder_finalize (GObject * object);
static void gst_base_audio_encoder_reset (GstBaseAudioEncoder * enc,
gboolean full);
@ -292,7 +268,6 @@ gst_base_audio_encoder_class_init (GstBaseAudioEncoderClass * 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");
@ -324,6 +299,11 @@ gst_base_audio_encoder_class_init (GstBaseAudioEncoderClass * klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
gst_base_audio_encoder_base_init (gpointer g_class)
{
}
static void
gst_base_audio_encoder_init (GstBaseAudioEncoder * enc,
GstBaseAudioEncoderClass * bclass)
@ -745,7 +725,6 @@ gst_base_audio_encoder_set_base_gp (GstBaseAudioEncoder * enc)
static GstFlowReturn
gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer)
{
GstBaseAudioEncoderClass *bclass;
GstBaseAudioEncoder *enc;
GstBaseAudioEncoderPrivate *priv;
GstBaseAudioEncoderContext *ctx;
@ -753,7 +732,6 @@ gst_base_audio_encoder_chain (GstPad * pad, GstBuffer * buffer)
gboolean discont;
enc = GST_BASE_AUDIO_ENCODER (GST_OBJECT_PARENT (pad));
bclass = GST_BASE_AUDIO_ENCODER_GET_CLASS (enc);
priv = enc->priv;
ctx = enc->ctx;

View file

@ -28,7 +28,7 @@
#endif
#include <gst/gst.h>
#include <gst/audio/gstbaseaudioutils.h>
#include "gstbaseaudioutils.h"
G_BEGIN_DECLS