[gstreamermm] BaseAudio[Sink|Src], RingBuffer: Rename as was done in the C API.
- From: José Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gstreamermm] BaseAudio[Sink|Src], RingBuffer: Rename as was done in the C API.
- Date: Fri, 19 Jul 2013 18:33:26 +0000 (UTC)
commit 40c445aabf9957a7a075a617ed23ee2397a7089d
Author: José Alburquerque <jaalburquerque gmail com>
Date: Wed Jun 19 15:31:37 2013 -0400
BaseAudio[Sink|Src],RingBuffer: Rename as was done in the C API.
* gstreamer/src/baseaudiosink.{ccg,hg}: Rename these files/classes to:
* gstreamer/src/audiobasesink.{ccg,hg}:
* gstreamer/src/baseaudiosrc.{ccg,hg}: Rename these files/classes to:
* gstreamer/src/audiobasesrc.{ccg,hg}:
* gstreamer/src/ringbuffer.{ccg,hg}: Rename these files/classes to:
* gstreamer/src/audioringbuffer.{ccg,hg}:
* gstreamer/src/filelist.am: Rename the files here also.
* gstreamer/src/gst_vfuncs.defs: Rename the types here also.
* tools/m4/convert_gst.m4: Rename the types here also.
ChangeLog | 14 ++
.../src/{baseaudiosrc.ccg => audiobasesink.ccg} | 5 +-
.../src/{baseaudiosink.hg => audiobasesink.hg} | 33 +++--
.../src/{baseaudiosink.ccg => audiobasesrc.ccg} | 5 +-
gstreamer/src/{baseaudiosrc.hg => audiobasesrc.hg} | 27 ++--
.../src/{ringbuffer.ccg => audioringbuffer.ccg} | 69 +++++-----
.../src/{ringbuffer.hg => audioringbuffer.hg} | 147 ++++++++++----------
gstreamer/src/filelist.am | 6 +-
gstreamer/src/gst_vfuncs.defs | 48 +++---
tools/m4/convert_gst.m4 | 14 +-
10 files changed, 192 insertions(+), 176 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3cc01ab..206a45c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2013-06-19 José Alburquerque <jaalburquerque gmail com>
+
+ BaseAudio[Sink|Src],RingBuffer: Rename as was done in the C API.
+
+ * gstreamer/src/baseaudiosink.{ccg,hg}: Rename these files/classes to:
+ * gstreamer/src/audiobasesink.{ccg,hg}:
+ * gstreamer/src/baseaudiosrc.{ccg,hg}: Rename these files/classes to:
+ * gstreamer/src/audiobasesrc.{ccg,hg}:
+ * gstreamer/src/ringbuffer.{ccg,hg}: Rename these files/classes to:
+ * gstreamer/src/audioringbuffer.{ccg,hg}:
+ * gstreamer/src/filelist.am: Rename the files here also.
+ * gstreamer/src/gst_vfuncs.defs: Rename the types here also.
+ * tools/m4/convert_gst.m4: Rename the types here also.
+
2013-06-18 José Alburquerque <jaalburquerque gmail com>
Correct some general method parameter changes in existing source files.
diff --git a/gstreamer/src/baseaudiosrc.ccg b/gstreamer/src/audiobasesink.ccg
similarity index 87%
rename from gstreamer/src/baseaudiosrc.ccg
rename to gstreamer/src/audiobasesink.ccg
index c79c025..c18ad71 100644
--- a/gstreamer/src/baseaudiosrc.ccg
+++ b/gstreamer/src/audiobasesink.ccg
@@ -17,6 +17,5 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/gstbaseaudiosrc.h>
-#include <gstreamermm/ringbuffer.h>
-_PINCLUDE(gstreamermm/private/pushsrc_p.h)
+#include <gst/audio/audio.h>
+#include <gstreamermm/audioringbuffer.h>
diff --git a/gstreamer/src/baseaudiosink.hg b/gstreamer/src/audiobasesink.hg
similarity index 60%
rename from gstreamer/src/baseaudiosink.hg
rename to gstreamer/src/audiobasesink.hg
index 6eface9..d2b2895 100644
--- a/gstreamer/src/baseaudiosink.hg
+++ b/gstreamer/src/audiobasesink.hg
@@ -17,17 +17,18 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/gstringbuffer.h>
+#include <gst/audio/audio.h>
#include <gstreamermm/basesink.h>
+_PINCLUDE(gstreamermm/private/basesink_p.h)
_DEFS(gstreamermm,gst)
namespace Gst
{
-class RingBuffer;
+class AudioRingBuffer;
-_WRAP_ENUM(BaseAudioSinkSlaveMethod, GstBaseAudioSinkSlaveMethod)
+_WRAP_ENUM(AudioBaseSinkSlaveMethod, GstAudioBaseSinkSlaveMethod)
/** The base class for audio sinks.
* This is the base class for audio sinks. Subclasses need to implement the
@@ -38,24 +39,24 @@ _WRAP_ENUM(BaseAudioSinkSlaveMethod, GstBaseAudioSinkSlaveMethod)
*
* @ingroup GstBaseClasses
*/
-class BaseAudioSink : public Gst::BaseSink
+class AudioBaseSink : public Gst::BaseSink
{
- _CLASS_GOBJECT(BaseAudioSink, GstBaseAudioSink, GST_BASE_AUDIO_SINK, Gst::BaseSink, GstBaseSink)
+ _CLASS_GOBJECT(AudioBaseSink, GstAudioBaseSink, GST_AUDIO_BASE_SINK, Gst::BaseSink, GstBaseSink)
public:
- /** Get the Gst::Clock of the Gst::BaseAudioSink.
+ /** Get the Gst::Clock of the Gst::AudioBaseSink.
*/
_MEMBER_GET_GOBJECT(provided_clock, provided_clock, Gst::Clock, GstClock*)
- _WRAP_METHOD(Glib::RefPtr<Gst::RingBuffer> create_ring_buffer(), gst_base_audio_sink_create_ringbuffer)
- _WRAP_METHOD(void set_provide_clock(bool provide), gst_base_audio_sink_set_provide_clock)
- _WRAP_METHOD(bool get_provide_clock() const, gst_base_audio_sink_get_provide_clock)
+ _WRAP_METHOD(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(),
gst_audio_base_sink_create_ringbuffer)
+ _WRAP_METHOD(void set_provide_clock(bool provide), gst_audio_base_sink_set_provide_clock)
+ _WRAP_METHOD(bool get_provide_clock() const, gst_audio_base_sink_get_provide_clock)
- _WRAP_METHOD(void set_slave_method(Gst::BaseAudioSinkSlaveMethod method),
gst_base_audio_sink_set_slave_method)
- _WRAP_METHOD(Gst::BaseAudioSinkSlaveMethod get_slave_method() const, gst_base_audio_sink_get_slave_method)
+ _WRAP_METHOD(void set_slave_method(Gst::AudioBaseSinkSlaveMethod method),
gst_audio_base_sink_set_slave_method)
+ _WRAP_METHOD(Gst::AudioBaseSinkSlaveMethod get_slave_method() const, gst_audio_base_sink_get_slave_method)
- _WRAP_METHOD(gint64 get_drift_tolerance() const, gst_base_audio_sink_get_drift_tolerance)
- _WRAP_METHOD(void set_drift_tolerance(gint64 drift_tolerance), gst_base_audio_sink_set_drift_tolerance)
+ _WRAP_METHOD(gint64 get_drift_tolerance() const, gst_audio_base_sink_get_drift_tolerance)
+ _WRAP_METHOD(void set_drift_tolerance(gint64 drift_tolerance), gst_audio_base_sink_set_drift_tolerance)
_WRAP_PROPERTY("alignment-threshold", guint64)
_WRAP_PROPERTY("buffer-time", gint64)
@@ -64,11 +65,11 @@ public:
_WRAP_PROPERTY("drift-tolerance", gint64)
_WRAP_PROPERTY("latency-time", gint64)
_WRAP_PROPERTY("provide-clock", bool)
- _WRAP_PROPERTY("slave-method", Gst::BaseAudioSinkSlaveMethod)
+ _WRAP_PROPERTY("slave-method", Gst::AudioBaseSinkSlaveMethod)
- /** vfunc to create and return a Gst::RingBuffer to write to.
+ /** vfunc to create and return a Gst::AudioRingBuffer to write to.
*/
- _WRAP_VFUNC(Glib::RefPtr<Gst::RingBuffer> create_ring_buffer(), "create_ringbuffer")
+ _WRAP_VFUNC(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(), "create_ringbuffer")
};
} // namespace Gst
diff --git a/gstreamer/src/baseaudiosink.ccg b/gstreamer/src/audiobasesrc.ccg
similarity index 87%
rename from gstreamer/src/baseaudiosink.ccg
rename to gstreamer/src/audiobasesrc.ccg
index f1ef70f..c18ad71 100644
--- a/gstreamer/src/baseaudiosink.ccg
+++ b/gstreamer/src/audiobasesrc.ccg
@@ -17,6 +17,5 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/gstbaseaudiosink.h>
-#include <gstreamermm/ringbuffer.h>
-_PINCLUDE(gstreamermm/private/basesink_p.h)
+#include <gst/audio/audio.h>
+#include <gstreamermm/audioringbuffer.h>
diff --git a/gstreamer/src/baseaudiosrc.hg b/gstreamer/src/audiobasesrc.hg
similarity index 63%
rename from gstreamer/src/baseaudiosrc.hg
rename to gstreamer/src/audiobasesrc.hg
index beddade..8a70d3f 100644
--- a/gstreamer/src/baseaudiosrc.hg
+++ b/gstreamer/src/audiobasesrc.hg
@@ -17,17 +17,18 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/gstringbuffer.h>
+#include <gst/audio/audio.h>
#include <gstreamermm/pushsrc.h>
+_PINCLUDE(gstreamermm/private/pushsrc_p.h)
_DEFS(gstreamermm,gst)
namespace Gst
{
-class RingBuffer;
+class AudioRingBuffer;
-_WRAP_ENUM(BaseAudioSrcSlaveMethod, GstBaseAudioSrcSlaveMethod)
+_WRAP_ENUM(AudioBaseSrcSlaveMethod, GstAudioBaseSrcSlaveMethod)
/** The base class for audio sources.
* This is the base class for audio sources. Subclasses need to implement the
@@ -38,21 +39,21 @@ _WRAP_ENUM(BaseAudioSrcSlaveMethod, GstBaseAudioSrcSlaveMethod)
*
* @ingroup GstBaseClasses
*/
-class BaseAudioSrc : public Gst::PushSrc
+class AudioBaseSrc : public Gst::PushSrc
{
- _CLASS_GOBJECT(BaseAudioSrc, GstBaseAudioSrc, GST_BASE_AUDIO_SRC, Gst::PushSrc, GstPushSrc)
+ _CLASS_GOBJECT(AudioBaseSrc, GstAudioBaseSrc, GST_AUDIO_BASE_SRC, Gst::PushSrc, GstPushSrc)
public:
/** Get the Gst::Clock of the Gst::AudioSrc.
*/
_MEMBER_GET_GOBJECT(clock, clock, Gst::Clock, GstClock*)
- _WRAP_METHOD(Glib::RefPtr<Gst::RingBuffer> create_ring_buffer(), gst_base_audio_src_create_ringbuffer)
+ _WRAP_METHOD(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(), gst_audio_base_src_create_ringbuffer)
- _WRAP_METHOD(void set_provide_clock(bool provide), gst_base_audio_src_set_provide_clock)
- _WRAP_METHOD(bool get_provide_clock() const, gst_base_audio_src_get_provide_clock)
- _WRAP_METHOD(void set_slave_method(Gst::BaseAudioSrcSlaveMethod method),
gst_base_audio_src_set_slave_method)
- _WRAP_METHOD(Gst::BaseAudioSrcSlaveMethod get_slave_method() const, gst_base_audio_src_get_slave_method)
+ _WRAP_METHOD(void set_provide_clock(bool provide), gst_audio_base_src_set_provide_clock)
+ _WRAP_METHOD(bool get_provide_clock() const, gst_audio_base_src_get_provide_clock)
+ _WRAP_METHOD(void set_slave_method(Gst::AudioBaseSrcSlaveMethod method),
gst_audio_base_src_set_slave_method)
+ _WRAP_METHOD(Gst::AudioBaseSrcSlaveMethod get_slave_method() const, gst_audio_base_src_get_slave_method)
_WRAP_PROPERTY("actual-buffer-time", gint64)
_WRAP_PROPERTY("actual-latency-time", gint64)
@@ -60,11 +61,11 @@ public:
_WRAP_PROPERTY("latency-time", gint64)
_WRAP_PROPERTY("provide-clock", bool)
- _WRAP_PROPERTY("slave-method", BaseAudioSrcSlaveMethod)
+ _WRAP_PROPERTY("slave-method", AudioBaseSrcSlaveMethod)
- /** vfunc to create and return a Gst::RingBuffer to read from.
+ /** vfunc to create and return a Gst::AudioRingBuffer to read from.
*/
- _WRAP_VFUNC(Glib::RefPtr<Gst::RingBuffer> create_ring_buffer(), "create_ringbuffer")
+ _WRAP_VFUNC(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(), "create_ringbuffer")
};
} // namespace Gst
diff --git a/gstreamer/src/ringbuffer.ccg b/gstreamer/src/audioringbuffer.ccg
similarity index 75%
rename from gstreamer/src/ringbuffer.ccg
rename to gstreamer/src/audioringbuffer.ccg
index 91a740b..2868f5e 100644
--- a/gstreamer/src/ringbuffer.ccg
+++ b/gstreamer/src/audioringbuffer.ccg
@@ -17,7 +17,6 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/audio-enumtypes.h>
#include <gstreamermm/handle_error.h>
_PINCLUDE(gstreamermm/private/object_p.h)
@@ -27,10 +26,11 @@ namespace
extern "C"
{
-static void RingBuffer_Fill_gstreamermm_callback(GstRingBuffer*, guint8* data, guint len,
- gpointer user_data)
+static void AudioRingBuffer_Fill_gstreamermm_callback(GstAudioRingBuffer*,
+ guint8* data, guint len, gpointer user_data)
{
- Gst::RingBuffer::SlotFill& slot_fill = *static_cast<Gst::RingBuffer::SlotFill*>(user_data);
+ Gst::AudioRingBuffer::SlotFill& slot_fill =
+ *static_cast<Gst::AudioRingBuffer::SlotFill*>(user_data);
try
{
@@ -50,35 +50,36 @@ static void RingBuffer_Fill_gstreamermm_callback(GstRingBuffer*, guint8* data, g
namespace Gst
{
-RingBufferSpec::RingBufferSpec()
-: m_spec(g_try_new(GstRingBufferSpec, 1)),
+AudioRingBufferSpec::AudioRingBufferSpec()
+: m_spec(g_try_new(GstAudioRingBufferSpec, 1)),
take_ownership(true)
{
// Handle possible memory allocation failure.
if(!m_spec)
{
- gstreamermm_handle_error("Failed to allocate a new Gst::RingBufferSpec.");
+ gstreamermm_handle_error(
+ "Failed to allocate a new Gst::AudioRingBufferSpec.");
return;
}
}
-RingBufferSpec::RingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
+AudioRingBufferSpec::AudioRingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
Gst::BufferFormatType type, Gst::BufferFormat format, bool sign,
bool bigend, int width, int depth, int rate, int channels,
guint64 latency_time, guint64 buffer_time, int segsize, int segtotal,
int seglatency)
-: m_spec(g_try_new(GstRingBufferSpec, 1)),
+: m_spec(g_try_new(GstAudioRingBufferSpec, 1)),
take_ownership(true)
{
// Handle possible memory allocation failure.
if(!m_spec)
{
- gstreamermm_handle_error("Failed to allocate a new Gst::RingBufferSpec.");
+ gstreamermm_handle_error("Failed to allocate a new Gst::AudioRingBufferSpec.");
return;
}
- GstRingBufferSpec* spec = gobj();
+ GstAudioRingBufferSpec* spec = gobj();
spec->caps = Glib::unwrap(caps);
@@ -102,7 +103,7 @@ RingBufferSpec::RingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
}
-RingBufferSpec::RingBufferSpec(GstRingBufferSpec& castitem, bool take_ownership)
+AudioRingBufferSpec::AudioRingBufferSpec(GstAudioRingBufferSpec& castitem, bool take_ownership)
: m_spec(&castitem),
take_ownership(take_ownership)
{
@@ -111,14 +112,14 @@ RingBufferSpec::RingBufferSpec(GstRingBufferSpec& castitem, bool take_ownership)
gst_caps_ref(castitem.caps);
}
-RingBufferSpec::RingBufferSpec(const RingBufferSpec& other)
-: m_spec(g_try_new(GstRingBufferSpec, 1)),
+AudioRingBufferSpec::AudioRingBufferSpec(const AudioRingBufferSpec& other)
+: m_spec(g_try_new(GstAudioRingBufferSpec, 1)),
take_ownership(true)
{
// Handle possible memory allocation failure.
if(!m_spec)
{
- gstreamermm_handle_error("Failed to allocate a new Gst::RingBufferSpec.");
+ gstreamermm_handle_error("Failed to allocate a new Gst::AudioRingBufferSpec.");
return;
}
@@ -146,14 +147,14 @@ RingBufferSpec::RingBufferSpec(const RingBufferSpec& other)
std::copy(other.m_spec->silence_sample, other.m_spec->silence_sample +
GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE, m_spec->silence_sample);
}
-RingBufferSpec& RingBufferSpec::operator=(const RingBufferSpec& other)
+AudioRingBufferSpec& AudioRingBufferSpec::operator=(const AudioRingBufferSpec& other)
{
- RingBufferSpec temp(other);
+ AudioRingBufferSpec temp(other);
swap(temp);
return *this;
}
-RingBufferSpec::~RingBufferSpec()
+AudioRingBufferSpec::~AudioRingBufferSpec()
{
// Unref existing reference to caps.
if(m_spec->caps)
@@ -164,9 +165,9 @@ RingBufferSpec::~RingBufferSpec()
g_free(m_spec);
}
-void RingBufferSpec::swap(RingBufferSpec& other)
+void AudioRingBufferSpec::swap(AudioRingBufferSpec& other)
{
- GstRingBufferSpec* spec_temp = m_spec;
+ GstAudioRingBufferSpec* spec_temp = m_spec;
m_spec = other.m_spec;
other.m_spec = spec_temp;
@@ -175,31 +176,32 @@ void RingBufferSpec::swap(RingBufferSpec& other)
other.take_ownership = take_temp;
}
-void RingBufferSpec::set_silence_sample(const Glib::ArrayHandle<guint8>& silence_sample)
+void AudioRingBufferSpec::set_silence_sample(const Glib::ArrayHandle<guint8>& silence_sample)
{
std::copy(silence_sample.data(),
silence_sample.data() + GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE,
m_spec->silence_sample);
}
-void RingBuffer::set_fill_slot(const SlotFill& slot)
+void AudioRingBuffer::set_fill_slot(const SlotFill& slot)
{
// The slot is dynamically allocated because according to the
- // gst_ring_buffer_set_callback() docs, the slot may be called several times.
+ // gst_audio_ring_buffer_set_callback() docs, the slot may be called several
+ // times.
// A copy is hence created to avoid losing the slot. The copy is kept in an
// auto_ptr<> so that is released upon the ring buffer's destruction.
m_slot.reset(new SlotFill(slot));
- gst_ring_buffer_set_callback(gobj(), &RingBuffer_Fill_gstreamermm_callback,
+ gst_audio_ring_buffer_set_callback(gobj(), &AudioRingBuffer_Fill_gstreamermm_callback,
m_slot.get());
}
-bool RingBuffer::prepare_read(int& segment, std::vector<guint8>& readptr,
+bool AudioRingBuffer::prepare_read(int& segment, std::vector<guint8>& readptr,
int& len)
{
guint8* c_readptr = 0;
- const bool result = static_cast<bool>(gst_ring_buffer_prepare_read(gobj(), &segment, &c_readptr, &len));
+ const bool result = static_cast<bool>(gst_audio_ring_buffer_prepare_read(gobj(), &segment, &c_readptr,
&len));
readptr.assign(c_readptr, c_readptr + len);
if (c_readptr)
@@ -208,7 +210,7 @@ bool RingBuffer::prepare_read(int& segment, std::vector<guint8>& readptr,
return result;
}
-gboolean RingBuffer_Class::acquire_vfunc_callback(GstRingBuffer* self, GstRingBufferSpec* spec)
+gboolean AudioRingBuffer_Class::acquire_vfunc_callback(GstAudioRingBuffer* self, GstAudioRingBufferSpec*
spec)
{
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -225,7 +227,7 @@ gboolean RingBuffer_Class::acquire_vfunc_callback(GstRingBuffer* self, GstRingBu
{
try // Trap C++ exceptions which would normally be lost because this is a C callback.
{
- Gst::RingBufferSpec cpp_spec(*spec);
+ Gst::AudioRingBufferSpec cpp_spec(*spec);
// Call the virtual member method, which derived classes might override.
return static_cast<int>(obj->acquire_vfunc(cpp_spec));
@@ -250,7 +252,7 @@ gboolean RingBuffer_Class::acquire_vfunc_callback(GstRingBuffer* self, GstRingBu
typedef gboolean RType;
return RType();
}
-bool Gst::RingBuffer::acquire_vfunc(Gst::RingBufferSpec& spec)
+bool Gst::AudioRingBuffer::acquire_vfunc(Gst::AudioRingBufferSpec& spec)
{
BaseClassType *const base = static_cast<BaseClassType*>(
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class
(The original underlying C class).
@@ -262,7 +264,7 @@ bool Gst::RingBuffer::acquire_vfunc(Gst::RingBufferSpec& spec)
typedef bool RType;
return RType();
}
-guint RingBuffer_Class::commit_vfunc_callback(GstRingBuffer* self, guint64* sample, guchar* data, gint
in_samples, gint out_samples, gint* accum)
+guint AudioRingBuffer_Class::commit_vfunc_callback(GstAudioRingBuffer* self, guint64* sample, guchar* data,
gint in_samples, gint out_samples, gint* accum)
{
Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>(
Glib::ObjectBase::_get_current_wrapper((GObject*)self));
@@ -287,8 +289,7 @@ guint RingBuffer_Class::commit_vfunc_callback(GstRingBuffer* self, guint64* samp
// Declare the ArrayHandle for the C++ vfunc.
Glib::ArrayHandle<guchar> cpp_data(data, data_length, Glib::OWNERSHIP_NONE);
// Call the virtual member method, which derived classes might override.
- return obj->commit_vfunc(*(sample), cpp_data, in_samples, out_samples,
- *(accum));
+ return obj->commit_vfunc(*(sample), Glib::ArrayHandler<guint8>::array_to_vector(data, data_length,
Glib::OWNERSHIP_NONE), in_samples, out_samples, *(accum));
}
catch(...)
{
@@ -309,14 +310,14 @@ guint RingBuffer_Class::commit_vfunc_callback(GstRingBuffer* self, guint64* samp
typedef guint RType;
return RType();
}
-guint Gst::RingBuffer::commit_vfunc(guint64& sample, const Glib::ArrayHandle<guchar>& data, int in_samples,
int out_samples, int& accum)
+guint Gst::AudioRingBuffer::commit_vfunc(guint64& sample, const std::vector<guint8>& data, int in_samples,
int out_samples, int& accum)
{
BaseClassType *const base = static_cast<BaseClassType*>(
g_type_class_peek_parent(G_OBJECT_GET_CLASS(gobject_)) // Get the parent class of the object class
(The original underlying C class).
);
if(base && base->commit)
- return (*base->commit)(gobj(),&sample,const_cast<guchar*>(data.data()),in_samples,out_samples,&accum);
+ return
(*base->commit)(gobj(),&sample,Glib::ArrayHandler<guint8>::vector_to_array(data).data(),,in_samples,out_samples,&accum);
typedef guint RType;
return RType();
diff --git a/gstreamer/src/ringbuffer.hg b/gstreamer/src/audioringbuffer.hg
similarity index 67%
rename from gstreamer/src/ringbuffer.hg
rename to gstreamer/src/audioringbuffer.hg
index ebcd437..ab39807 100644
--- a/gstreamer/src/ringbuffer.hg
+++ b/gstreamer/src/audioringbuffer.hg
@@ -17,7 +17,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <gst/audio/gstringbuffer.h>
+#include <gst/audio/audio.h>
#include <gstreamermm/caps.h>
#include <gstreamermm/object.h>
#include <gstreamermm/format.h>
@@ -29,33 +29,33 @@ _DEFS(gstreamermm,gst)
namespace Gst
{
-_WRAP_ENUM(RingBufferSegState, GstRingBufferSegState)
-_WRAP_ENUM(RingBufferState, GstRingBufferState)
+_WRAP_ENUM(AudioRingBufferSegState, GstAudioRingBufferSegState)
+_WRAP_ENUM(AudioRingBufferState, GstAudioRingBufferState)
_WRAP_ENUM(BufferFormat, GstBufferFormat)
_WRAP_ENUM(BufferFormatType, GstBufferFormatType)
-/** A class containing the format specification of a Gst::RingBuffer.
- * Gst::RingBufferSpec contains the format specification of a Gst::RingBuffer.
- * The "in" members should be specified by the caller of the
- * Gst::RingBuffer::acquire() method while the "in/out" members may be set by
- * the caller but are also modifiable by Gst::RingBuffer::acquire(). The
- * "out" members are generated as a result of the call to
- * Gst::RingBuffer::acquire().
- * @see Gst::RingBuffer::acquire().
+/** A class containing the format specification of a Gst::AudioRingBuffer.
+ * Gst::AudioRingBufferSpec contains the format specification of a
+ * Gst::AudioRingBuffer. The "in" members should be specified by the caller of
+ * the Gst::AudioRingBuffer::acquire() method while the "in/out" members may be
+ * set by the caller but are also modifiable by
+ * Gst::AudioRingBuffer::acquire(). The "out" members are generated as a
+ * result of the call to Gst::AudioRingBuffer::acquire().
+ * @see Gst::AudioRingBuffer::acquire().
*/
-class RingBufferSpec
+class AudioRingBufferSpec
{
- _CLASS_GENERIC(RingBufferSpec, GstRingBufferSpec)
+ _CLASS_GENERIC(AudioRingBufferSpec, GstAudioRingBufferSpec)
public:
/** Default constructor.
* @throw std::runtime_error if memory is unavailable for the new
- * Gst::RingBufferSpec.
+ * Gst::AudioRingBufferSpec.
*/
- RingBufferSpec();
+ AudioRingBufferSpec();
- /** Fully construct a Gst::RingBufferSpec. Only the "(in)" parameters are
- * required. The "(in/out)" parameters are optional and may be modified by
- * the call to the Gst::RingBuffer::acquire() method.
+ /** Fully construct a Gst::AudioRingBufferSpec. Only the "(in)" parameters
+ * are required. The "(in/out)" parameters are optional and may be modified
+ * by the call to the Gst::AudioRingBuffer::acquire() method.
* @param caps The caps of the buffer (in).
* @param type The sample type (in/out).
* @param format The sample format (in/out).
@@ -73,39 +73,39 @@ public:
* defaults to @a segtotal in the C API (in/out).
*
* @throw std::runtime_error if memory is unavailable for the new
- * Gst::RingBufferSpec.
+ * Gst::AudioRingBufferSpec.
*/
- RingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
+ AudioRingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
Gst::BufferFormatType type = Gst::BUFTYPE_LINEAR,
Gst::BufferFormat format = Gst::UNKNOWN, bool sign = false,
bool bigend = false, int width = 0, int depth = 0, int rate = 0,
int channels = 0, guint64 latency_time = 0, guint64 buffer_time = 0,
int segsize = 0, int segtotal = 0, int seglatency = 0);
- /// Construct a Gst::RingBufferSpec from a GstRingBufferSpec.
- explicit RingBufferSpec(GstRingBufferSpec& castitem,
+ /// Construct a Gst::AudioRingBufferSpec from a GstAudioRingBufferSpec.
+ explicit AudioRingBufferSpec(GstAudioRingBufferSpec& castitem,
bool take_ownership = false);
/** Copy constructor.
*
* @throw std::runtime_error if memory is unavailable for the new
- * Gst::RingBufferSpec.
+ * Gst::AudioRingBufferSpec.
*/
- RingBufferSpec(const RingBufferSpec& other);
+ AudioRingBufferSpec(const AudioRingBufferSpec& other);
/// Assignment operator.
- RingBufferSpec& operator=(const RingBufferSpec& other);
+ AudioRingBufferSpec& operator=(const AudioRingBufferSpec& other);
/// Destructor.
- virtual ~RingBufferSpec();
+ virtual ~AudioRingBufferSpec();
- void swap(RingBufferSpec& other);
+ void swap(AudioRingBufferSpec& other);
/// Gets the underlying gobject.
- GstRingBufferSpec* gobj() { return m_spec; };
+ GstAudioRingBufferSpec* gobj() { return m_spec; };
/// Gets the underlying gobject.
- const GstRingBufferSpec* gobj() const { return m_spec; };
+ const GstAudioRingBufferSpec* gobj() const { return m_spec; };
/** Get the caps of the buffer (in). */
_MEMBER_GET_GOBJECT(caps, caps, Gst::Caps, GstCaps*)
@@ -220,33 +220,33 @@ public:
_MEMBER_SET(seglatency, seglatency, int, gint)
/** Get the number of bytes of one sample (out). This is set by the call to
- * Gst::RingBuffer::acquire().
+ * Gst::AudioRingBuffer::acquire().
*/
_MEMBER_GET(bytes_per_sample, bytes_per_sample, int, gint)
/** Set the number of bytes of one sample (out). This is set by the call to
- * Gst::RingBuffer::acquire() and should probably not be set.
+ * Gst::AudioRingBuffer::acquire() and should probably not be set.
*/
_MEMBER_SET(bytes_per_sample, bytes_per_sample, int, gint)
// This constant is obtained from the "silence_sample" member in the
-// GstRingBufferSpec structure definition.
+// GstAudioRingBufferSpec structure definition.
#define GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE 32
#m4 _CONVERSION(`guint8*', `Glib::ArrayHandle<guint8>', `Glib::ArrayHandle<guint8>($3,
GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE, Glib::OWNERSHIP_NONE)')
/** Get the bytes representing one sample of silence (out). This is set by
- * the call to Gst::RingBuffer::acquire().
+ * the call to Gst::AudioRingBuffer::acquire().
*/
_MEMBER_GET(silence_sample, silence_sample, Glib::ArrayHandle<guint8>, guint8*)
/** Sets the bytes representing one sample of silence (out). This is set by
- * the call to Gst::RingBuffer::acquire() and probably should not be set.
+ * the call to Gst::AudioRingBuffer::acquire() and probably should not be set.
*/
void set_silence_sample(const Glib::ArrayHandle<guint8>& silence_sample);
protected:
#ifndef DOXYGEN_SHOULD_SKIP_THIS
- GstRingBufferSpec* m_spec;
+ GstAudioRingBufferSpec* m_spec;
// Tells whether the m_spec member should be freed upon destruction.
bool take_ownership;
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
@@ -264,13 +264,13 @@ protected:
* Last reviewed on 2006-02-02 (0.10.4).
* @ingroup GstBaseClasses
*/
-class RingBuffer : public Gst::Object
+class AudioRingBuffer : public Gst::Object
{
- _CLASS_GOBJECT(RingBuffer, GstRingBuffer, GST_RING_BUFFER, Gst::Object, GstObject)
+ _CLASS_GOBJECT(AudioRingBuffer, GstAudioRingBuffer, GST_RING_BUFFER, Gst::Object, GstObject)
public:
/** For example,
- * bool on_fill(const Glib::RefPtr<Gst::RingBuffer>& rbuf,
+ * bool on_fill(const Glib::RefPtr<Gst::AudioRingBuffer>& rbuf,
* const std::vector<guint8>& data, guint len);.
* This slot is set with set_fill_slot() and is called to fill the memory at
* data with len bytes of samples.
@@ -287,40 +287,40 @@ public:
* @param slot The fill slot to set.
*/
void set_fill_slot(const SlotFill& slot);
- _IGNORE(gst_ring_buffer_set_callback)
-
- _WRAP_METHOD(bool acquire(Gst::RingBufferSpec& spec), gst_ring_buffer_acquire)
- _WRAP_METHOD(bool release(), gst_ring_buffer_release)
- _WRAP_METHOD(bool is_acquired() const, gst_ring_buffer_is_acquired)
- _WRAP_METHOD(bool activate(bool active), gst_ring_buffer_activate)
- _WRAP_METHOD(bool is_active() const, gst_ring_buffer_is_active)
- _WRAP_METHOD(bool start(), gst_ring_buffer_start)
- _WRAP_METHOD(bool pause(), gst_ring_buffer_pause)
- _WRAP_METHOD(bool stop(), gst_ring_buffer_stop)
- _WRAP_METHOD(guint get_delay() const, gst_ring_buffer_delay)
- _WRAP_METHOD(guint64 get_samples_done() const, gst_ring_buffer_samples_done)
- _WRAP_METHOD(void set_sample(guint64 sample), gst_ring_buffer_set_sample)
-
-#m4 _CONVERSION(`const Glib::ArrayHandle<guchar>&', `guchar*', `const_cast<guchar*>($3.data())')
- _WRAP_METHOD(guint commit(guint64 sample, const Glib::ArrayHandle<guchar>& data, guint len),
gst_ring_buffer_commit)
- _WRAP_METHOD(guint commit(guint64& sample, const Glib::ArrayHandle<guchar>& data, int in_samples, int
out_samples, int& accum), gst_ring_buffer_commit_full)
-
- _WRAP_METHOD(bool convert(Gst::Format src_fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val)
const, gst_ring_buffer_convert)
-
- _WRAP_METHOD_DOCS_ONLY(gst_ring_buffer_prepare_read)
+ _IGNORE(gst_audio_ring_buffer_set_callback)
+
+ _WRAP_METHOD(bool acquire(Gst::AudioRingBufferSpec& spec), gst_audio_ring_buffer_acquire)
+ _WRAP_METHOD(bool release(), gst_audio_ring_buffer_release)
+ _WRAP_METHOD(bool is_acquired() const, gst_audio_ring_buffer_is_acquired)
+ _WRAP_METHOD(bool activate(bool active), gst_audio_ring_buffer_activate)
+ _WRAP_METHOD(bool is_active() const, gst_audio_ring_buffer_is_active)
+ _WRAP_METHOD(bool start(), gst_audio_ring_buffer_start)
+ _WRAP_METHOD(bool pause(), gst_audio_ring_buffer_pause)
+ _WRAP_METHOD(bool stop(), gst_audio_ring_buffer_stop)
+ _WRAP_METHOD(guint get_delay() const, gst_audio_ring_buffer_delay)
+ _WRAP_METHOD(guint64 get_samples_done() const, gst_audio_ring_buffer_samples_done)
+ _WRAP_METHOD(void set_sample(guint64 sample), gst_audio_ring_buffer_set_sample)
+
+#m4 _CONVERSION(`const std::vector<guint8>&', `guint8*',
`Glib::ArrayHandler<guint8>::vector_to_array($3).data()')
+
+ _WRAP_METHOD(guint commit(guint64& sample, const std::vector<guint8>& data, int in_samples, int
out_samples, int& accum), gst_audio_ring_buffer_commit)
+
+ _WRAP_METHOD(bool convert(Gst::Format src_fmt, gint64 src_val, Gst::Format dest_fmt, gint64& dest_val)
const, gst_audio_ring_buffer_convert)
+
+ _WRAP_METHOD_DOCS_ONLY(gst_audio_ring_buffer_prepare_read)
bool prepare_read(int& segment, std::vector<guint8>& readptr, int& len);
- _WRAP_METHOD(guint read(guint64 sample, const Glib::ArrayHandle<guchar>& data, guint len),
gst_ring_buffer_read)
+ _WRAP_METHOD(guint read(guint64 sample, const std::vector<guint8>& data, guint len, ClockTime& timestamp),
gst_audio_ring_buffer_read)
- _WRAP_METHOD(void clear(int segment), gst_ring_buffer_clear)
- _WRAP_METHOD(void clear_all(), gst_ring_buffer_clear_all)
- _WRAP_METHOD(void advance(guint advance), gst_ring_buffer_advance)
- _WRAP_METHOD(bool close_device(), gst_ring_buffer_close_device)
- _WRAP_METHOD(bool open_device(), gst_ring_buffer_open_device)
- _WRAP_METHOD(bool device_is_open() const, gst_ring_buffer_device_is_open)
- _WRAP_METHOD(void set_may_start(bool allowed), gst_ring_buffer_may_start)
- _WRAP_METHOD(static bool parse_caps(Gst::RingBufferSpec&, const Glib::RefPtr<Gst::Caps>& caps),
gst_ring_buffer_parse_caps)
- _WRAP_METHOD(void set_flushing(bool flushing), gst_ring_buffer_set_flushing)
+ _WRAP_METHOD(void clear(int segment), gst_audio_ring_buffer_clear)
+ _WRAP_METHOD(void clear_all(), gst_audio_ring_buffer_clear_all)
+ _WRAP_METHOD(void advance(guint advance), gst_audio_ring_buffer_advance)
+ _WRAP_METHOD(bool close_device(), gst_audio_ring_buffer_close_device)
+ _WRAP_METHOD(bool open_device(), gst_audio_ring_buffer_open_device)
+ _WRAP_METHOD(bool device_is_open() const, gst_audio_ring_buffer_device_is_open)
+ _WRAP_METHOD(void set_may_start(bool allowed), gst_audio_ring_buffer_may_start)
+ _WRAP_METHOD(static bool parse_caps(Gst::AudioRingBufferSpec&, const Glib::RefPtr<Gst::Caps>& caps),
gst_audio_ring_buffer_parse_caps)
+ _WRAP_METHOD(void set_flushing(bool flushing), gst_audio_ring_buffer_set_flushing)
/** Virtual function to open the device. Don't set any params or allocate
* anything.
@@ -330,7 +330,7 @@ public:
/** Virtual function to allocate the resources for the ring buffer using the
* given spec.
*/
- virtual bool acquire_vfunc(Gst::RingBufferSpec& spec);
+ virtual bool acquire_vfunc(Gst::AudioRingBufferSpec& spec);
/** Virtual function to free resources of the ring buffer.
*/
@@ -367,7 +367,8 @@ public:
/** Virtual function to write samples into the ring buffer.
*/
- virtual guint commit_vfunc(guint64& sample, const Glib::ArrayHandle<guchar>& data, int in_samples, int
out_samples, int& accum);
+ virtual guint commit_vfunc(guint64& sample, const std::vector<guint8>& data,
+ int in_samples, int out_samples, int& accum);
/** Virtual function to clear the entire ringbuffer Since 0.10.24.
*/
@@ -379,8 +380,8 @@ protected:
klass->acquire = &acquire_vfunc_callback;
klass->commit = &commit_vfunc_callback;
_SECTION(SECTION_PH_VFUNCS)
- static gboolean acquire_vfunc_callback(GstRingBuffer* self, GstRingBufferSpec* spec);
- static guint commit_vfunc_callback(GstRingBuffer* self, guint64* sample, guchar* data, gint in_samples,
gint out_samples, gint* accum);
+ static gboolean acquire_vfunc_callback(GstAudioRingBuffer* self, GstAudioRingBufferSpec* spec);
+ static guint commit_vfunc_callback(GstAudioRingBuffer* self, guint64* sample, guchar* data, gint
in_samples, gint out_samples, gint* accum);
_POP()
#m4end
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 6e3b168..ff45dc9 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -84,12 +84,13 @@ plugins_hg = \
plugins_ccg = $(plugins_hg:.hg=.ccg)
files_hg = \
+ audiobasesink.hg \
+ audiobasesrc.hg \
audioclock.hg \
audiofilter.hg \
+ audioringbuffer.hg \
audiosink.hg \
audiosrc.hg \
- baseaudiosink.hg \
- baseaudiosrc.hg \
basesink.hg \
basesrc.hg \
basetransform.hg \
@@ -134,7 +135,6 @@ files_hg = \
pushsrc.hg \
query.hg \
registry.hg \
- ringbuffer.hg \
segment.hg \
streamvolume.hg \
structure.hg \
diff --git a/gstreamer/src/gst_vfuncs.defs b/gstreamer/src/gst_vfuncs.defs
index 6b19145..ba1d9ea 100644
--- a/gstreamer/src/gst_vfuncs.defs
+++ b/gstreamer/src/gst_vfuncs.defs
@@ -9,7 +9,7 @@
(of-object "GstAudioFilter")
(return-type "gboolean")
(parameters
- '("GstRingBufferSpec*" "format")
+ '("GstAudioRingBufferSpec*" "format")
)
)
@@ -24,7 +24,7 @@
(of-object "GstAudioSink")
(return-type "gboolean")
(parameters
- '("GstRingBufferSpec*" "spec")
+ '("GstAudioRingBufferSpec*" "spec")
)
)
@@ -68,7 +68,7 @@
(of-object "GstAudioSrc")
(return-type "gboolean")
(parameters
- '("GstRingBufferSpec*" "spec")
+ '("GstAudioRingBufferSpec*" "spec")
)
)
@@ -101,18 +101,18 @@
(return-type "void")
)
-; GstBaseAudioSink
+; GstAudioBaseSink
(define-vfunc create_ringbuffer
- (of-object "GstBaseAudioSink")
- (return-type "GstRingBuffer*")
+ (of-object "GstAudioBaseSink")
+ (return-type "GstAudioRingBuffer*")
)
-; GstBaseAudioSrc
+; GstAudioBaseSrc
(define-vfunc create_ringbuffer
- (of-object "GstBaseAudioSrc")
- (return-type "GstRingBuffer*")
+ (of-object "GstAudioBaseSrc")
+ (return-type "GstAudioRingBuffer*")
)
; GstBaseSink
@@ -971,58 +971,58 @@
)
)
-; GstRingBuffer
+; GstAudioRingBuffer
(define-vfunc open_device
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc acquire
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
(parameters
- '("GstRingBufferSpec*" "spec")
+ '("GstAudioRingBufferSpec*" "spec")
)
)
(define-vfunc release
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc close_device
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc start
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc pause
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc resume
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc stop
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
)
(define-vfunc delay
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "guint")
)
(define-vfunc activate
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "gboolean")
(parameters
'("gboolean" "active")
@@ -1030,11 +1030,11 @@
)
(define-vfunc commit
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "guint")
(parameters
'("guint64*" "sample")
- '("guchar*" "data")
+ '("guint8*" "data")
'("gint" "in_samples")
'("gint" "out_samples")
'("gint*" "accum")
@@ -1042,7 +1042,7 @@
)
(define-vfunc clear_all
- (of-object "GstRingBuffer")
+ (of-object "GstAudioRingBuffer")
(return-type "void")
)
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 1c25abb..03fc7f9 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -3,8 +3,8 @@ dnl Copyright 2008 The gstreamermm Development Team
dnl Enums
_CONV_ENUM(Gst,AssocFlags)
_CONV_ENUM(Gst,AutoplugSelectResult)
-_CONV_ENUM(Gst,BaseAudioSinkSlaveMethod)
-_CONV_ENUM(Gst,BaseAudioSrcSlaveMethod)
+_CONV_ENUM(Gst,AudioBaseSinkSlaveMethod)
+_CONV_ENUM(Gst,AudioBaseSrcSlaveMethod)
_CONV_ENUM(Gst,BufferCopyFlags)
_CONV_ENUM(Gst,BufferFlag)
_CONV_ENUM(Gst,BufferFormat)
@@ -176,12 +176,12 @@ _CONVERSION(`const Glib::RefPtr<Gst::Query>&',`GstQuery*', `Gst::unwrap($3)')
dnl Registry
_CONVERSION(`GstRegistry*',`Glib::RefPtr<Gst::Registry>', `Glib::wrap($3)')
-dnl RingBuffer
-_CONVERSION(`GstRingBuffer*',`Glib::RefPtr<Gst::RingBuffer>',`Glib::wrap($3)')
-_CONVERSION(`Glib::RefPtr<Gst::RingBuffer>',`GstRingBuffer*',`Glib::unwrap($3)')
+dnl AudioRingBuffer
+_CONVERSION(`GstAudioRingBuffer*',`Glib::RefPtr<Gst::AudioRingBuffer>',`Glib::wrap($3)')
+_CONVERSION(`Glib::RefPtr<Gst::AudioRingBuffer>',`GstAudioRingBuffer*',`Glib::unwrap($3)')
-dnl RingBufferSpec
-_CONVERSION(`Gst::RingBufferSpec&', `GstRingBufferSpec*', `$3.gobj()')
+dnl AudioRingBufferSpec
+_CONVERSION(`Gst::AudioRingBufferSpec&', `GstAudioRingBufferSpec*', `$3.gobj()')
dnl Structure
_CONVERSION(`Gst::Structure&',`GstStructure*',`$3.gobj()')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]