[gstreamermm] Fix build with gstreamer < 1.12 Revert "Gst::AudioClock: auto generate some audioclock methods"



commit 179dde54a859915a6279e150fda9651b359f5a17
Author: Marcin Kolny <marcin kolny gmail com>
Date:   Thu Oct 19 20:39:19 2017 +0100

    Fix build with gstreamer < 1.12
    Revert "Gst::AudioClock: auto generate some audioclock methods"
    
    This reverts commit 167eeba7757027e5faf8cdb59030ca094af04763.

 gstreamer/src/audioclock.ccg |   22 ++++++++++++++++++++++
 gstreamer/src/audioclock.hg  |   13 ++++++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/gstreamer/src/audioclock.ccg b/gstreamer/src/audioclock.ccg
index cb04fb0..cb7c34d 100644
--- a/gstreamer/src/audioclock.ccg
+++ b/gstreamer/src/audioclock.ccg
@@ -21,6 +21,13 @@
 
 _PINCLUDE(gstreamermm/private/systemclock_p.h)
 
+// TODO: remove this check after we require at least gstreamer 1.12
+#if GST_VERSION_MINOR < 12
+#define GSTMM_AUDIO_CLOCK_CAST(obj) GST_CLOCK(obj)
+#else
+#define GSTMM_AUDIO_CLOCK_CAST(obj) GST_AUDIO_CLOCK(obj)
+#endif
+
 namespace
 {
 
@@ -64,4 +71,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(GSTMM_AUDIO_CLOCK_CAST(gobj()), 
static_cast<GstClockTime>(time)));
+}
+
+Gst::ClockTime AudioClock::get_time() const
+{
+  return static_cast<Gst::ClockTime>(gst_audio_clock_get_time(GSTMM_AUDIO_CLOCK_CAST(gobj())));
+}
+
+void AudioClock::invalidate()
+{
+  gst_audio_clock_invalidate(GSTMM_AUDIO_CLOCK_CAST(gobj()));
+}
+
 } //namespace Gst
diff --git a/gstreamer/src/audioclock.hg b/gstreamer/src/audioclock.hg
index af0d578..e7b7187 100644
--- a/gstreamer/src/audioclock.hg
+++ b/gstreamer/src/audioclock.hg
@@ -66,11 +66,18 @@ public:
 
   _WRAP_METHOD(void reset(Gst::ClockTime time), gst_audio_clock_reset)
 
-  _WRAP_METHOD(Gst::ClockTime adjust(Gst::ClockTime time), gst_audio_clock_adjust)
+  // 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(Gst::ClockTime get_time() const, gst_audio_clock_get_time)
+  _WRAP_METHOD_DOCS_ONLY(gst_audio_clock_get_time)
+  Gst::ClockTime get_time() const;
 
-  _WRAP_METHOD(void invalidate(), gst_audio_clock_invalidate)
+  _WRAP_METHOD_DOCS_ONLY(gst_audio_clock_invalidate)
+  void invalidate();
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 private:


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