Commit 2b32341a authored by Edward Hervey's avatar Edward Hervey 🤘

Wrap gst-plugins-base's audio helper library.

Original commit message from CVS:
* configure.ac:
* gst/Makefile.am:
* gst/audio.defs:
* gst/audio.override:
* gst/audiomodule.c: (initaudio):
Wrap gst-plugins-base's audio helper library.
Partially fixes #565762
parent e9d605a7
2008-12-31 Edward Hervey <edward.hervey@collabora.co.uk>
* configure.ac:
* gst/Makefile.am:
* gst/audio.defs:
* gst/audio.override:
* gst/audiomodule.c: (initaudio):
Wrap gst-plugins-base's audio helper library.
Partially fixes #565762
2008-12-30 Edward Hervey <edward.hervey@collabora.co.uk>
* configure.ac:
......
......@@ -182,6 +182,11 @@ then
IGNORE_GST_PB_0_10_18=""
fi
if test $GST_PB_MINOR_VERSION -ge "22"
then
AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
fi
else
IGNORE_GST_0_10_13=""
IGNORE_GST_0_10_14=""
......@@ -195,6 +200,7 @@ else
IGNORE_GST_PB_0_10_16=""
IGNORE_GST_PB_0_10_18=""
AC_DEFINE_UNQUOTED(HAVE_PLUGINS_INSTALL, 1, [We can use the plugins-install methods])
AC_DEFINE_UNQUOTED(HAVE_GST_AUDIO, 1, [We can use the gst-audio library])
fi
AC_DEFINE_UNQUOTED(HAVE_VIDEO_ORIENTATION_INTERFACE, 1, [We can use the videoorientation interface])
AC_SUBST(IGNORE_GST_0_10_13)
......@@ -210,6 +216,7 @@ AC_SUBST(IGNORE_GST_PB_0_10_16)
AC_SUBST(IGNORE_GST_PB_0_10_18)
AC_SUBST(HAVE_VIDEO_ORIENTATION)
AC_SUBST(HAVE_PLUGINS_INSTALL)
AM_CONDITIONAL(HAVE_GST_AUDIO, $HAVE_GST_AUDIO)
dnl check for gstreamer-base; uninstalled is selected preferentially
PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
......
......@@ -105,6 +105,28 @@ CLEANFILES += pbutils.c
EXTRA_DIST += $(PBUTILS_DEFS) $(PBUTILS_OVERRIDES)
pbutils.c: $(PBUTILS_DEFS) $(PBUTILS_OVERRIDES) $(GEN_FILES)
# GStreamer audio bindings
AUDIO_OVERRIDES = audio.override
AUDIO_DEFS = audio.defs
CLEANFILES += audio.c
EXTRA_DIST += $(AUDIO_DEFS) $(AUDIO_OVERRIDES)
defs_DATA += $(AUDIO_DEFS)
GEN_FILES += $(AUDIO_DEFS)
if HAVE_GST_AUDIO
audio_lib = audio.la
pygstexec_LTLIBRARIES += $(audio_lib)
audio_la_CFLAGS = $(common_cflags) $(GST_PLUGINS_BASE_CFLAGS)
audio_la_LIBADD = $(common_libadd) $(GST_PLUGINS_BASE_LIBS) -lgstaudio-0.10
audio_la_LDFLAGS = $(common_ldflags) \
-export-symbols-regex "^(initaudio|_PyGObject_API).*" $(GST_PLUGINS_BASE_LIBS)
audio_la_SOURCES = audiomodule.c gst-argtypes.c pygstminiobject.c
nodist_audio_la_SOURCES = audio.c
audio.c: $(AUDIO_DEFS) $(AUDIO_OVERRIDES) $(GEN_FILES)
endif
.defs.c:
($(PYTHON) $(top_srcdir)/codegen/codegen.py \
--load-types $(srcdir)/arg-types.py \
......
;; -*- scheme -*-
; object definitions ...
(define-object AudioClock
(in-module "Gst")
(parent "GstSystemClock")
(c-name "GstAudioClock")
(gtype-id "GST_TYPE_AUDIO_CLOCK")
)
(define-object AudioFilter
(in-module "Gst")
(parent "GstBaseTransform")
(c-name "GstAudioFilter")
(gtype-id "GST_TYPE_AUDIO_FILTER")
)
(define-object BaseAudioSink
(in-module "Gst")
(parent "GstBaseSink")
(c-name "GstBaseAudioSink")
(gtype-id "GST_TYPE_BASE_AUDIO_SINK")
)
(define-object AudioSink
(in-module "Gst")
(parent "GstBaseAudioSink")
(c-name "GstAudioSink")
(gtype-id "GST_TYPE_AUDIO_SINK")
)
;; (define-object BaseAudioSrc
;; (in-module "Gst")
;; (parent "GstPushSrc")
;; (c-name "GstBaseAudioSrc")
;; (gtype-id "GST_TYPE_BASE_AUDIO_SRC")
;; )
;; (define-object AudioSrc
;; (in-module "Gst")
;; (parent "GstBaseAudioSrc")
;; (c-name "GstAudioSrc")
;; (gtype-id "GST_TYPE_AUDIO_SRC")
;; )
(define-object RingBuffer
(in-module "Gst")
(parent "GstObject")
(c-name "GstRingBuffer")
(gtype-id "GST_TYPE_RING_BUFFER")
)
;; Enumerations and flags ...
(define-enum BaseAudioSinkSlaveMethod
(in-module "Gst")
(c-name "GstBaseAudioSinkSlaveMethod")
(gtype-id "GST_TYPE_BASE_AUDIO_SINK_SLAVE_METHOD")
(values
'("resample" "GST_BASE_AUDIO_SINK_SLAVE_RESAMPLE")
'("skew" "GST_BASE_AUDIO_SINK_SLAVE_SKEW")
'("none" "GST_BASE_AUDIO_SINK_SLAVE_NONE")
)
)
(define-enum BaseAudioSrcSlaveMethod
(in-module "Gst")
(c-name "GstBaseAudioSrcSlaveMethod")
(gtype-id "GST_TYPE_BASE_AUDIO_SRC_SLAVE_METHOD")
(values
'("resample" "GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE")
'("retimestamp" "GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP")
'("skew" "GST_BASE_AUDIO_SRC_SLAVE_SKEW")
'("none" "GST_BASE_AUDIO_SRC_SLAVE_NONE")
)
)
(define-enum RingBufferState
(in-module "Gst")
(c-name "GstRingBufferState")
(gtype-id "GST_TYPE_RING_BUFFER_STATE")
(values
'("stopped" "GST_RING_BUFFER_STATE_STOPPED")
'("paused" "GST_RING_BUFFER_STATE_PAUSED")
'("started" "GST_RING_BUFFER_STATE_STARTED")
)
)
(define-enum RingBufferSegState
(in-module "Gst")
(c-name "GstRingBufferSegState")
(gtype-id "GST_TYPE_RING_BUFFER_SEG_STATE")
(values
'("invalid" "GST_SEGSTATE_INVALID")
'("empty" "GST_SEGSTATE_EMPTY")
'("filled" "GST_SEGSTATE_FILLED")
'("partial" "GST_SEGSTATE_PARTIAL")
)
)
(define-enum BufferFormatType
(in-module "Gst")
(c-name "GstBufferFormatType")
(gtype-id "GST_TYPE_BUFFER_FORMAT_TYPE")
(values
'("linear" "GST_BUFTYPE_LINEAR")
'("float" "GST_BUFTYPE_FLOAT")
'("mu-law" "GST_BUFTYPE_MU_LAW")
'("a-law" "GST_BUFTYPE_A_LAW")
'("ima-adpcm" "GST_BUFTYPE_IMA_ADPCM")
'("mpeg" "GST_BUFTYPE_MPEG")
'("gsm" "GST_BUFTYPE_GSM")
'("iec958" "GST_BUFTYPE_IEC958")
'("ac3" "GST_BUFTYPE_AC3")
'("eac3" "GST_BUFTYPE_EAC3")
'("dts" "GST_BUFTYPE_DTS")
)
)
(define-enum BufferFormat
(in-module "Gst")
(c-name "GstBufferFormat")
(gtype-id "GST_TYPE_BUFFER_FORMAT")
(values
'("unknown" "GST_UNKNOWN")
'("s8" "GST_S8")
'("u8" "GST_U8")
'("s16-le" "GST_S16_LE")
'("s16-be" "GST_S16_BE")
'("u16-le" "GST_U16_LE")
'("u16-be" "GST_U16_BE")
'("s24-le" "GST_S24_LE")
'("s24-be" "GST_S24_BE")
'("u24-le" "GST_U24_LE")
'("u24-be" "GST_U24_BE")
'("s32-le" "GST_S32_LE")
'("s32-be" "GST_S32_BE")
'("u32-le" "GST_U32_LE")
'("u32-be" "GST_U32_BE")
'("s24-3le" "GST_S24_3LE")
'("s24-3be" "GST_S24_3BE")
'("u24-3le" "GST_U24_3LE")
'("u24-3be" "GST_U24_3BE")
'("s20-3le" "GST_S20_3LE")
'("s20-3be" "GST_S20_3BE")
'("u20-3le" "GST_U20_3LE")
'("u20-3be" "GST_U20_3BE")
'("s18-3le" "GST_S18_3LE")
'("s18-3be" "GST_S18_3BE")
'("u18-3le" "GST_U18_3LE")
'("u18-3be" "GST_U18_3BE")
'("float32-le" "GST_FLOAT32_LE")
'("float32-be" "GST_FLOAT32_BE")
'("float64-le" "GST_FLOAT64_LE")
'("float64-be" "GST_FLOAT64_BE")
'("mu-law" "GST_MU_LAW")
'("a-law" "GST_A_LAW")
'("ima-adpcm" "GST_IMA_ADPCM")
'("mpeg" "GST_MPEG")
'("gsm" "GST_GSM")
'("iec958" "GST_IEC958")
'("ac3" "GST_AC3")
'("eac3" "GST_EAC3")
'("dts" "GST_DTS")
)
)
(define-enum AudioChannelPosition
(in-module "Gst")
(c-name "GstAudioChannelPosition")
(gtype-id "GST_TYPE_AUDIO_CHANNEL_POSITION")
(values
'("invalid" "GST_AUDIO_CHANNEL_POSITION_INVALID")
'("front-mono" "GST_AUDIO_CHANNEL_POSITION_FRONT_MONO")
'("front-left" "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT")
'("front-right" "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT")
'("rear-center" "GST_AUDIO_CHANNEL_POSITION_REAR_CENTER")
'("rear-left" "GST_AUDIO_CHANNEL_POSITION_REAR_LEFT")
'("rear-right" "GST_AUDIO_CHANNEL_POSITION_REAR_RIGHT")
'("lfe" "GST_AUDIO_CHANNEL_POSITION_LFE")
'("front-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_CENTER")
'("front-left-of-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT_OF_CENTER")
'("front-right-of-center" "GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT_OF_CENTER")
'("side-left" "GST_AUDIO_CHANNEL_POSITION_SIDE_LEFT")
'("side-right" "GST_AUDIO_CHANNEL_POSITION_SIDE_RIGHT")
'("none" "GST_AUDIO_CHANNEL_POSITION_NONE")
'("num" "GST_AUDIO_CHANNEL_POSITION_NUM")
)
)
;; From audio.h
(define-function frame_byte_size
(c-name "gst_audio_frame_byte_size")
(return-type "int")
(parameters
'("GstPad*" "pad")
)
)
(define-function frame_length
(c-name "gst_audio_frame_length")
(return-type "long")
(parameters
'("GstPad*" "pad")
'("GstBuffer*" "buf")
)
)
(define-function duration_from_pad_buffer
(c-name "gst_audio_duration_from_pad_buffer")
(return-type "GstClockTime")
(parameters
'("GstPad*" "pad")
'("GstBuffer*" "buf")
)
)
(define-function is_buffer_framed
(c-name "gst_audio_is_buffer_framed")
(return-type "gboolean")
(parameters
'("GstPad*" "pad")
'("GstBuffer*" "buf")
)
)
(define-function buffer_clip
(c-name "gst_audio_buffer_clip")
(return-type "GstBuffer*")
(parameters
'("GstBuffer*" "buffer")
'("GstSegment*" "segment")
'("gint" "rate")
'("gint" "frame_size")
)
)
;; From gstaudioclock.h
(define-function gst_audio_clock_get_type
(c-name "gst_audio_clock_get_type")
(return-type "GType")
)
(define-function gst_audio_clock_new
(c-name "gst_audio_clock_new")
(is-constructor-of "GstAudioClock")
(return-type "GstClock*")
(parameters
'("gchar*" "name")
'("GstAudioClockGetTimeFunc" "func")
'("gpointer" "user_data")
)
)
(define-method reset
(of-object "GstAudioClock")
(c-name "gst_audio_clock_reset")
(return-type "none")
(parameters
'("GstClockTime" "time")
)
)
;; From gstaudiofilter.h
(define-function gst_audio_filter_get_type
(c-name "gst_audio_filter_get_type")
(return-type "GType")
)
(define-method add_pad_templates
(of-object "GstAudioFilterClass")
(c-name "gst_audio_filter_class_add_pad_templates")
(return-type "none")
(parameters
'("const-GstCaps*" "allowed_caps")
)
)
(define-virtual setup
(of-object "GstAudioFilter")
(return-type "gboolean")
(parameters
'("GstRingBufferSpec*" "format")
)
)
;; From gstaudiosink.h
(define-function gst_audio_sink_get_type
(c-name "gst_audio_sink_get_type")
(return-type "GType")
)
(define-virtual open
(of-object "GstAudioSink")
(return-type "gboolean")
)
(define-virtual prepare
(of-object "GstAudioSink")
(return-type "gboolean")
(parameters
'("GstRingBufferSpec*" "spec")
)
)
(define-virtual unprepare
(of-object "GstAudioSink")
(return-type "gboolean")
)
(define-virtual close
(of-object "GstAudioSink")
(return-type "gboolean")
)
(define-virtual write
(of-object "GstAudioSink")
(return-type "guint")
(parameters
'("gpointer" "data")
'("guint" "length")
)
)
(define-virtual delay
(of-object "GstAudioSink")
(return-type "guint")
)
(define-virtual reset
(of-object "GstAudioSink")
(return-type "none")
)
;; From gstaudiosrc.h
(define-function gst_audio_src_get_type
(c-name "gst_audio_src_get_type")
(return-type "GType")
)
;; From gstbaseaudiosink.h
(define-function gst_base_audio_sink_get_type
(c-name "gst_base_audio_sink_get_type")
(return-type "GType")
)
(define-method create_ringbuffer
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_create_ringbuffer")
(return-type "GstRingBuffer*")
)
(define-virtual create_ringbuffer
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_create_ringbuffer")
(return-type "GstRingBuffer*")
)
(define-method set_provide_clock
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_set_provide_clock")
(return-type "none")
(parameters
'("gboolean" "provide")
)
)
(define-method get_provide_clock
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_get_provide_clock")
(return-type "gboolean")
)
(define-method set_slave_method
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_set_slave_method")
(return-type "none")
(parameters
'("GstBaseAudioSinkSlaveMethod" "method")
)
)
(define-method get_slave_method
(of-object "GstBaseAudioSink")
(c-name "gst_base_audio_sink_get_slave_method")
(return-type "GstBaseAudioSinkSlaveMethod")
)
;; From gstbaseaudiosrc.h
(define-function gst_base_audio_src_get_type
(c-name "gst_base_audio_src_get_type")
(return-type "GType")
)
(define-method create_ringbuffer
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_create_ringbuffer")
(return-type "GstRingBuffer*")
)
(define-virtual create_ringbuffer
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_create_ringbuffer")
(return-type "GstRingBuffer*")
)
(define-method set_provide_clock
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_set_provide_clock")
(return-type "none")
(parameters
'("gboolean" "provide")
)
)
(define-method get_provide_clock
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_get_provide_clock")
(return-type "gboolean")
)
(define-method set_slave_method
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_set_slave_method")
(return-type "none")
(parameters
'("GstBaseAudioSrcSlaveMethod" "method")
)
)
(define-method get_slave_method
(of-object "GstBaseAudioSrc")
(c-name "gst_base_audio_src_get_slave_method")
(return-type "GstBaseAudioSrcSlaveMethod")
)
;; From gstringbuffer.h
(define-function gst_ring_buffer_get_type
(c-name "gst_ring_buffer_get_type")
(return-type "GType")
)
(define-method set_callback
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_set_callback")
(return-type "none")
(parameters
'("GstRingBufferCallback" "cb")
'("gpointer" "user_data")
)
)
(define-function ring_buffer_parse_caps
(c-name "gst_ring_buffer_parse_caps")
(return-type "gboolean")
(parameters
'("GstRingBufferSpec*" "spec")
'("GstCaps*" "caps")
)
)
(define-function ring_buffer_debug_spec_caps
(c-name "gst_ring_buffer_debug_spec_caps")
(return-type "none")
(parameters
'("GstRingBufferSpec*" "spec")
)
)
(define-function ring_buffer_debug_spec_buff
(c-name "gst_ring_buffer_debug_spec_buff")
(return-type "none")
(parameters
'("GstRingBufferSpec*" "spec")
)
)
(define-method convert
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_convert")
(return-type "gboolean")
(parameters
'("GstFormat" "src_fmt")
'("gint64" "src_val")
'("GstFormat" "dest_fmt")
'("gint64*" "dest_val")
)
)
(define-method open_device
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_open_device")
(return-type "gboolean")
)
(define-method close_device
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_close_device")
(return-type "gboolean")
)
(define-method device_is_open
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_device_is_open")
(return-type "gboolean")
)
(define-method acquire
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_acquire")
(return-type "gboolean")
(parameters
'("GstRingBufferSpec*" "spec")
)
)
(define-method release
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_release")
(return-type "gboolean")
)
(define-method is_acquired
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_is_acquired")
(return-type "gboolean")
)
(define-method activate
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_activate")
(return-type "gboolean")
(parameters
'("gboolean" "active")
)
)
(define-method is_active
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_is_active")
(return-type "gboolean")
)
(define-method set_flushing
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_set_flushing")
(return-type "none")
(parameters
'("gboolean" "flushing")
)
)
(define-method start
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_start")
(return-type "gboolean")
)
(define-method pause
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_pause")
(return-type "gboolean")
)
(define-method stop
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_stop")
(return-type "gboolean")
)
(define-method delay
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_delay")
(return-type "guint")
)
(define-method samples_done
(of-object "GstRingBuffer")
(c-name "gst_ring_buffer_samples_done")