[gstreamermm] Gst::AudioClock: wrap missing methods



commit cae75d427c9a38dcd564a827ee6edf0ca074dbfb
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Sat Apr 23 15:55:06 2016 +0200

    Gst::AudioClock: wrap missing methods
    
        * gstreamer/src/audioclock.{ccg|hg}: wrap reset(), adjust(),
          get_time() and invalidate() methods. Most of them have to be wrapped
          manually, because GStreamer use GstClock object as first arugment
          for this methods.

 gstreamer/src/audioclock.ccg |   17 ++++++++++++++++-
 gstreamer/src/audioclock.hg  |   25 ++++++++++++++++++++-----
 2 files changed, 36 insertions(+), 6 deletions(-)
---
diff --git a/gstreamer/src/audioclock.ccg b/gstreamer/src/audioclock.ccg
index 5a30e16..986dba7 100644
--- a/gstreamer/src/audioclock.ccg
+++ b/gstreamer/src/audioclock.ccg
@@ -1,6 +1,6 @@
 /* gstreamermm - a C++ wrapper for gstreamer
  *
- * Copyright 2008 The gstreamermm Development Team
+ * Copyright 2008-2016 The gstreamermm Development Team
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -64,4 +64,19 @@ AudioClock::AudioClock(const Glib::ustring& name, const SlotGetTime& time_slot)
   gobj()->user_data = m_slot.get();
 }
 
+Gst::ClockTime AudioClock::adjust(Gst::ClockTime time)
+{
+  return static_cast<Gst::ClockTime>(gst_audio_clock_adjust(GST_CLOCK_CAST(gobj()), 
static_cast<GstClockTime>(time)));
+}
+
+Gst::ClockTime AudioClock::get_time() const
+{
+  return static_cast<Gst::ClockTime>(gst_audio_clock_get_time(GST_CLOCK_CAST(gobj())));
+}
+
+void AudioClock::invalidate()
+{
+  gst_audio_clock_invalidate(GST_CLOCK_CAST(gobj()));
+}
+
 } //namespace Gst
diff --git a/gstreamer/src/audioclock.hg b/gstreamer/src/audioclock.hg
index 74f0280..e7b7187 100644
--- a/gstreamer/src/audioclock.hg
+++ b/gstreamer/src/audioclock.hg
@@ -1,6 +1,6 @@
 /* gstreamermm - a C++ wrapper for gstreamer
  *
- * Copyright 2008 The gstreamermm Development Team
+ * Copyright 2008-2016 The gstreamermm Development Team
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -32,7 +32,7 @@ namespace Gst
  * This object is internally used to implement the clock in
  * Gst::AudioBaseSink.
  *
- * Last reviewed on 2015-10-15 (1.5.2).
+ * Last reviewed on 2016-04-23 (1.8.0).
  */
 class AudioClock : public Gst::SystemClock
 {
@@ -57,16 +57,31 @@ public:
    * be calculated it will call @a time_slot. When @a time_slot returns
    * Gst::CLOCK_TIME_NONE, the clock will return the last reported time.
    * 
-   * param name The name of the clock.
-   * param time_slot A slot that returns the time.
+   * @param name The name of the clock.
+   * @param time_slot A slot that returns the time.
    *
    * @return a new Gst::AudioClock.
    */
   _WRAP_CREATE(const Glib::ustring& name, const SlotGetTime& time_slot)
 
+  _WRAP_METHOD(void reset(Gst::ClockTime time), gst_audio_clock_reset)
+
+  // TODO methods below get GstClock as a first argument,
+  // so have to be wrapped manually. It has been fixed in
+  // GStreamer (https://bugzilla.gnome.org/show_bug.cgi?id=756628)
+  // but patch is not available in 1.8.0 version.
+  _WRAP_METHOD_DOCS_ONLY(gst_audio_clock_adjust)
+  Gst::ClockTime adjust(Gst::ClockTime time);
+
+  _WRAP_METHOD_DOCS_ONLY(gst_audio_clock_get_time)
+  Gst::ClockTime get_time() const;
+
+  _WRAP_METHOD_DOCS_ONLY(gst_audio_clock_invalidate)
+  void invalidate();
+
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 private:
-  // todo this slot should be moved in move constructor, but for now it's
+  // TODO this slot should be moved in move constructor, but for now it's
   // impossible to provide custom move constructor
   // (see https://bugzilla.gnome.org/show_bug.cgi?id=756593).
   // However, task should be managed by RefPtr class, so move constructor


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