[gstreamermm: 7/167] audioringbufferspec class improved



commit c4069d95ee3f97ee00fa654d3b9ae7d87c633621
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Wed Jul 24 11:32:06 2013 +0200

    audioringbufferspec class improved

 gstreamer/src/audioringbuffer.ccg |   18 +---------
 gstreamer/src/audioringbuffer.hg  |   72 +++---------------------------------
 tools/m4/convert_gst.m4           |    2 +-
 3 files changed, 8 insertions(+), 84 deletions(-)
---
diff --git a/gstreamer/src/audioringbuffer.ccg b/gstreamer/src/audioringbuffer.ccg
index f56dd5f..0ae1851 100644
--- a/gstreamer/src/audioringbuffer.ccg
+++ b/gstreamer/src/audioringbuffer.ccg
@@ -64,13 +64,11 @@ AudioRingBufferSpec::AudioRingBufferSpec()
 }
 
 AudioRingBufferSpec::AudioRingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
-  Gst::AudioRingBufferFormatType type, bool sign,
-  bool bigend, int width, int depth, int rate, int channels,
+  Gst::AudioRingBufferFormatType type,
   guint64 latency_time, guint64 buffer_time, int segsize, int segtotal,
   int seglatency)
 : m_spec(g_try_new(GstAudioRingBufferSpec, 1)),
   take_ownership(true)
-  
 {
   // Handle possible memory allocation failure.
   if(!m_spec)
@@ -88,12 +86,6 @@ AudioRingBufferSpec::AudioRingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
     caps->reference();
 
   spec->type = static_cast<GstAudioRingBufferFormatType>(type);
-  spec->sign = static_cast<int>(sign);
-  spec->bigend = static_cast<int>(bigend);
-  spec->width = width;
-  spec->depth = depth;
-  spec->rate = rate;
-  spec->channels = channels;
   spec->latency_time = latency_time;
   spec->buffer_time = buffer_time;
   spec->segsize = segsize;
@@ -129,18 +121,10 @@ AudioRingBufferSpec::AudioRingBufferSpec(const AudioRingBufferSpec& other)
     gst_caps_ref(m_spec->caps);
 
   m_spec->type = other.m_spec->type;
-  m_spec->format = other.m_spec->format;
-  m_spec->sign = other.m_spec->sign;
-  m_spec->bigend = other.m_spec->bigend;
-  m_spec->width = other.m_spec->width;
-  m_spec->depth = other.m_spec->depth;
-  m_spec->rate = other.m_spec->rate;
-  m_spec->channels = other.m_spec->channels;
   m_spec->latency_time = other.m_spec->latency_time;
   m_spec->buffer_time = other.m_spec->buffer_time;
   m_spec->segsize = other.m_spec->segsize;
   m_spec->segtotal = other.m_spec->segtotal;
-  m_spec->bytes_per_sample = other.m_spec->bytes_per_sample;
   m_spec->seglatency = other.m_spec->seglatency;
 
   std::copy(other.m_spec->silence_sample, other.m_spec->silence_sample + 
GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE, m_spec->silence_sample);
diff --git a/gstreamer/src/audioringbuffer.hg b/gstreamer/src/audioringbuffer.hg
index 87fa77a..227255e 100644
--- a/gstreamer/src/audioringbuffer.hg
+++ b/gstreamer/src/audioringbuffer.hg
@@ -28,8 +28,7 @@ _DEFS(gstreamermm,gst)
 
 namespace Gst
 {
-
-_WRAP_ENUM(AudioRingBufferSegState, GstAudioRingBufferSegState)
+_WRAP_ENUM(AudioChannelPosition, GstAudioChannelPosition)
 _WRAP_ENUM(AudioRingBufferState, GstAudioRingBufferState)
 _WRAP_ENUM(AudioRingBufferFormatType, GstAudioRingBufferFormatType)
 
@@ -76,9 +75,8 @@ public:
    */
   AudioRingBufferSpec(const Glib::RefPtr<Gst::Caps>& caps,
     Gst::AudioRingBufferFormatType type = Gst::AUDIO_RING_BUFFER_FORMAT_TYPE_RAW,
-    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,
+    guint64 latency_time = 0,
+    guint64 buffer_time = 0,
     int segsize = 0, int segtotal = 0, int seglatency = 0);
 
   /// Construct a Gst::AudioRingBufferSpec from a GstAudioRingBufferSpec.
@@ -120,57 +118,6 @@ public:
    */
   _MEMBER_SET(type, type, Gst::AudioRingBufferFormatType, GstAudioRingBufferFormatType)
 
-  /** Get the sample format (in/out).
-   */
-
-  /** Get the sample sign (in/out).
-   */
-  _MEMBER_GET(sign, sign, bool, gboolean)
-
-  /** Set the sample sign (in/out).
-   */
-  _MEMBER_SET(sign, sign, bool, gboolean)
-
-  /** Get the endianness of the samples (in/out).
-   */
-  _MEMBER_GET(bigend, bigend, bool, gboolean)
-
-  /** Set the endianness of the samples (in/out).
-   */
-  _MEMBER_SET(bigend, bigend, bool, gboolean)
-
-  /** Get the width of the samples (in/out).
-   */
-  _MEMBER_GET(width, width, int, gint)
-
-  /** Set the width of the samples (in/out).
-   */
-  _MEMBER_SET(width, width, int, gint)
-
-  /** Get the depth of the samples (in/out).
-   */
-  _MEMBER_GET(depth, depth, int, gint)
-
-  /** Set the depth of the samples (in/out).
-   */
-  _MEMBER_SET(depth, depth, int, gint)
-
-  /** Get the samplerate (in/out).
-   */
-  _MEMBER_GET(rate, rate, int, gint)
-
-  /** Set the samplerate (in/out).
-   */
-  _MEMBER_SET(rate, rate, int, gint)
-
-  /** Get the number of channels (in/out).
-   */
-  _MEMBER_GET(channels, channels, int, gint)
-
-  /** Set the number of channels (in/out).
-   */
-  _MEMBER_SET(channels, channels, int, gint)
-
   /** Get the latency in microseconds (in/out).
    */
   _MEMBER_GET(latency_time, latency_time, guint64, guint64)
@@ -213,16 +160,6 @@ public:
    */
   _MEMBER_SET(seglatency, seglatency, int, gint)
 
-  /** Get the number of bytes of one sample (out).  This is set by the call to
-   * 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::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
 // GstAudioRingBufferSpec structure definition.
 #define GSTREAMERMM_RING_BUFFER_SPEC_SILENCE_SAMPLE 32
@@ -294,6 +231,9 @@ public:
   _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)
+  _WRAP_METHOD(void set_channel_position(const Gst::AudioChannelPosition& position), 
gst_audio_ring_buffer_set_channel_positions)
+  _WRAP_METHOD(gboolean is_flushing(), gst_audio_ring_buffer_is_flushing)
+  _WRAP_METHOD(void set_timestamp(gint readseg, ClockTime timestamp), gst_audio_ring_buffer_set_timestamp)
 
 #m4 _CONVERSION(`const std::vector<guint8>&', `guint8*', 
`Glib::ArrayHandler<guint8>::vector_to_array($3).data()')
 
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index a9ee76c..f7cef0c 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -243,7 +243,7 @@ _CONVERSION(`GstState*',`State&',`*reinterpret_cast<Gst::State*>($3)')
 _CONVERSION(`GstTagFlag',`TagFlag',`(TagFlag)($3)')
 _CONVERSION(`guint64',`ClockTime',`(ClockTime)($3)')
 _CONVERSION(`const URIType',`const GstURIType',`(GstURIType)($3)')
-
+_CONVERSION(`const Gst::AudioChannelPosition&',`const GstAudioChannelPosition*',`(const 
GstAudioChannelPosition*)(&$3)')
 dnl C++ Conversions
 _CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]