Commit 8b468c3c authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

audio: Generate audiobasesink/src and audiocdsrc GLib enums automatically

And ensure that GstAudioBaseSrcSlaveMethod's re-timestamp stays
re-timestamp and doesn't become retimestamp.
parent bdccc98e
......@@ -11,7 +11,10 @@ glib_enum_headers= \
audio-info.h \
audio-quantize.h \
audio-resampler.h \
gstaudioringbuffer.h
gstaudioringbuffer.h \
gstaudiobasesrc.h \
gstaudiocdsrc.h \
gstaudiobasesink.h
glib_enum_define = GST_AUDIO
glib_gen_prefix = gst_audio
......
......@@ -121,30 +121,6 @@ enum
PROP_LAST
};
GType
gst_audio_base_sink_slave_method_get_type (void)
{
static volatile gsize slave_method_type = 0;
static const GEnumValue slave_method[] = {
{GST_AUDIO_BASE_SINK_SLAVE_RESAMPLE, "GST_AUDIO_BASE_SINK_SLAVE_RESAMPLE",
"resample"},
{GST_AUDIO_BASE_SINK_SLAVE_SKEW, "GST_AUDIO_BASE_SINK_SLAVE_SKEW", "skew"},
{GST_AUDIO_BASE_SINK_SLAVE_NONE, "GST_AUDIO_BASE_SINK_SLAVE_NONE", "none"},
{GST_AUDIO_BASE_SINK_SLAVE_CUSTOM, "GST_AUDIO_BASE_SINK_SLAVE_CUSTOM",
"custom"},
{0, NULL, NULL},
};
if (g_once_init_enter (&slave_method_type)) {
GType tmp =
g_enum_register_static ("GstAudioBaseSinkSlaveMethod", slave_method);
g_once_init_leave (&slave_method_type, tmp);
}
return (GType) slave_method_type;
}
#define _do_init \
GST_DEBUG_CATEGORY_INIT (gst_audio_base_sink_debug, "audiobasesink", 0, "audiobasesink element");
#define gst_audio_base_sink_parent_class parent_class
......
......@@ -99,8 +99,6 @@ typedef enum
GST_AUDIO_BASE_SINK_SLAVE_CUSTOM
} GstAudioBaseSinkSlaveMethod;
#define GST_TYPE_AUDIO_BASE_SINK_SLAVE_METHOD (gst_audio_base_sink_slave_method_get_type ())
typedef struct _GstAudioBaseSink GstAudioBaseSink;
typedef struct _GstAudioBaseSinkClass GstAudioBaseSinkClass;
typedef struct _GstAudioBaseSinkPrivate GstAudioBaseSinkPrivate;
......@@ -223,7 +221,6 @@ struct _GstAudioBaseSinkClass {
};
GType gst_audio_base_sink_get_type(void);
GType gst_audio_base_sink_slave_method_get_type (void);
GstAudioRingBuffer *
gst_audio_base_sink_create_ringbuffer (GstAudioBaseSink *sink);
......
......@@ -45,29 +45,6 @@
GST_DEBUG_CATEGORY_STATIC (gst_audio_base_src_debug);
#define GST_CAT_DEFAULT gst_audio_base_src_debug
GType
gst_audio_base_src_slave_method_get_type (void)
{
static volatile gsize slave_method_type = 0;
/* FIXME 2.0: nick should be "retimestamp" not "re-timestamp" */
static const GEnumValue slave_method[] = {
{GST_AUDIO_BASE_SRC_SLAVE_RESAMPLE,
"GST_AUDIO_BASE_SRC_SLAVE_RESAMPLE", "resample"},
{GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP,
"GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP", "re-timestamp"},
{GST_AUDIO_BASE_SRC_SLAVE_SKEW, "GST_AUDIO_BASE_SRC_SLAVE_SKEW", "skew"},
{GST_AUDIO_BASE_SRC_SLAVE_NONE, "GST_AUDIO_BASE_SRC_SLAVE_NONE", "none"},
{0, NULL, NULL},
};
if (g_once_init_enter (&slave_method_type)) {
GType tmp =
g_enum_register_static ("GstAudioBaseSrcSlaveMethod", slave_method);
g_once_init_leave (&slave_method_type, tmp);
}
return (GType) slave_method_type;
}
#define GST_AUDIO_BASE_SRC_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_AUDIO_BASE_SRC, GstAudioBaseSrcPrivate))
......@@ -993,7 +970,7 @@ gst_audio_base_src_create (GstBaseSrc * bsrc, guint64 offset, guint length,
}
break;
}
case GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP:
case GST_AUDIO_BASE_SRC_SLAVE_RE_TIMESTAMP:
{
GstClockTime base_time, latency;
......
......@@ -62,10 +62,12 @@ typedef struct _GstAudioBaseSrc GstAudioBaseSrc;
typedef struct _GstAudioBaseSrcClass GstAudioBaseSrcClass;
typedef struct _GstAudioBaseSrcPrivate GstAudioBaseSrcPrivate;
/* FIXME 2.0: Should be "retimestamp" not "re-timestamp" */
/**
* GstAudioBaseSrcSlaveMethod:
* @GST_AUDIO_BASE_SRC_SLAVE_RESAMPLE: Resample to match the master clock.
* @GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP: Retimestamp output buffers with master
* @GST_AUDIO_BASE_SRC_SLAVE_RE_TIMESTAMP: Retimestamp output buffers with master
* clock time.
* @GST_AUDIO_BASE_SRC_SLAVE_SKEW: Adjust capture pointer when master clock
* drifts too much.
......@@ -77,12 +79,12 @@ typedef struct _GstAudioBaseSrcPrivate GstAudioBaseSrcPrivate;
typedef enum
{
GST_AUDIO_BASE_SRC_SLAVE_RESAMPLE,
GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP,
GST_AUDIO_BASE_SRC_SLAVE_RE_TIMESTAMP,
GST_AUDIO_BASE_SRC_SLAVE_SKEW,
GST_AUDIO_BASE_SRC_SLAVE_NONE
} GstAudioBaseSrcSlaveMethod;
#define GST_TYPE_AUDIO_BASE_SRC_SLAVE_METHOD (gst_audio_base_src_slave_method_get_type ())
#define GST_AUDIO_BASE_SRC_SLAVE_RETIMESTAMP GST_AUDIO_BASE_SRC_SLAVE_RE_TIMESTAMP
/**
* GstAudioBaseSrc:
......@@ -131,7 +133,6 @@ struct _GstAudioBaseSrcClass {
};
GType gst_audio_base_src_get_type(void);
GType gst_audio_base_src_slave_method_get_type (void);
GstAudioRingBuffer *
gst_audio_base_src_create_ringbuffer (GstAudioBaseSrc *src);
......
......@@ -200,24 +200,6 @@ GST_STATIC_PAD_TEMPLATE ("src",
static GstFormat track_format;
static GstFormat sector_format;
GType
gst_audio_cd_src_mode_get_type (void)
{
static GType mode_type; /* 0 */
static const GEnumValue modes[] = {
{GST_AUDIO_CD_SRC_MODE_NORMAL, "Stream consists of a single track",
"normal"},
{GST_AUDIO_CD_SRC_MODE_CONTINUOUS, "Stream consists of the whole disc",
"continuous"},
{0, NULL, NULL}
};
if (mode_type == 0)
mode_type = g_enum_register_static ("GstAudioCdSrcMode", modes);
return mode_type;
}
static void
gst_audio_cd_src_class_init (GstAudioCdSrcClass * klass)
{
......
......@@ -54,8 +54,6 @@ typedef enum {
GST_AUDIO_CD_SRC_MODE_CONTINUOUS /* stream = whole disc */
} GstAudioCdSrcMode;
#define GST_TYPE_AUDIO_CD_SRC_MODE (gst_audio_cd_src_mode_get_type ())
/**
* GstAudioCdSrcTrack:
* @is_audio: Whether this is an audio track
......@@ -134,7 +132,6 @@ struct _GstAudioCdSrcClass {
};
GType gst_audio_cd_src_get_type (void);
GType gst_audio_cd_src_mode_get_type (void);
gboolean gst_audio_cd_src_add_track (GstAudioCdSrc * src,
GstAudioCdSrcTrack * track);
......
......@@ -33,6 +33,9 @@ audio_mkenum_headers = [
'audio-quantize.h',
'audio-resampler.h',
'gstaudioringbuffer.h',
'gstaudiobasesrc.h',
'gstaudiocdsrc.h',
'gstaudiobasesink.h',
]
# FIXME: check headers
......
EXPORTS
_gst_audio_decoder_error
gst_audio_base_sink_create_ringbuffer
gst_audio_base_sink_discont_reason_get_type
gst_audio_base_sink_get_alignment_threshold
gst_audio_base_sink_get_discont_wait
gst_audio_base_sink_get_drift_tolerance
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment