[packages/gstreamermm] patches to fix build with gst 1.12 and gcc7; rel 3

atler atler at pld-linux.org
Sat Sep 16 21:45:28 CEST 2017


commit 7584637b6ce2237af40eb51998b56161393861ae
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Sep 16 21:44:26 2017 +0200

    patches to fix build with gst 1.12 and gcc7; rel 3

 gstreamermm-gcc7.patch    | 104 ++++++++++++++++++++++++++++++++++++++++++++++
 gstreamermm-gst1.12.patch |  45 ++++++++++++++++++++
 gstreamermm.spec          |   6 ++-
 3 files changed, 154 insertions(+), 1 deletion(-)
---
diff --git a/gstreamermm.spec b/gstreamermm.spec
index 76da297..2bd6165 100644
--- a/gstreamermm.spec
+++ b/gstreamermm.spec
@@ -8,12 +8,14 @@ Summary:	A C++ bindings for the GStreamer library
 Summary(pl.UTF-8):	Wiązania C++ do biblioteki GStreamera
 Name:		gstreamermm
 Version:	1.8.0
-Release:	2
+Release:	3
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/gstreamermm/1.8/%{name}-%{version}.tar.xz
 # Source0-md5:	31246cf2f37b7ff48d45c8be98425e93
 Patch0:		%{name}-link.patch
+Patch1:		%{name}-gst1.12.patch
+Patch2:		%{name}-gcc7.patch
 URL:		https://gstreamer.freedesktop.org/bindings/cplusplus.html
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake >= 1:1.9
@@ -126,6 +128,8 @@ Szczegółowa dokumentacja gstreamermm.
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
+%patch2 -p1
 
 %build
 %{__libtoolize}
diff --git a/gstreamermm-gcc7.patch b/gstreamermm-gcc7.patch
new file mode 100644
index 0000000..b723204
--- /dev/null
+++ b/gstreamermm-gcc7.patch
@@ -0,0 +1,104 @@
+Author: Marcin Kolny <marcin.kolny at gmail.com>
+Description: Gst::Iterator: fix iterator build - Fixes build with GCC 7
+Origin: https://bugzilla.gnome.org/show_bug.cgi?id=783678
+Last-update: 2017-07-02
+--- gstreamermm-1.8.0.orig/gstreamer/gstreamermm/iterator.h	
++++ gstreamermm-1.8.0.orig/gstreamer/gstreamermm/iterator.h	
+@@ -220,9 +220,6 @@ private:
+   GstIterator* cobject_;    // The underlying  C object.
+   bool take_ownership;      // Whether to destroy C object with the wrapper.
+ #endif /* DOXYGEN_SHOULD_SKIP_THIS */
+-
+-private:
+-  void swap(IteratorBase<CppType>& other);
+ };
+ 
+ /**  A class used to retrieve multiple elements in a thread safe way.
+@@ -338,18 +335,25 @@ template<class CppType>
+ IteratorBase<CppType>::IteratorBase()
+ : current(G_VALUE_INIT),
+   current_result(Gst::ITERATOR_OK),
+-  cobject_(0),
++  cobject_(nullptr),
+   take_ownership(true)
+ {
+ }
+ 
+ template<class CppType>
+ IteratorBase<CppType>::IteratorBase(const IteratorBase<CppType>& other)
+-  : current(other.current),
++  : current(G_VALUE_INIT),
+     current_result(other.current_result),
+-    cobject_(const_cast<GstIterator*>(other.cobj())),
+-    take_ownership((other.cobj()) ? false : true)
+-{}
++    take_ownership(other.take_ownership)
++{
++  cobject_ = other.take_ownership ? gst_iterator_copy(other.cobject_) : other.cobject_;
++
++  if (G_IS_VALUE (&other.current))
++  {
++    g_value_init(&current, G_VALUE_TYPE(&other.current));
++    g_value_copy(&other.current, &current);
++  }
++}
+ 
+ template<class CppType>
+ IteratorBase<CppType>::IteratorBase(GstIterator* castitem, bool take_ownership)
+@@ -362,8 +366,25 @@ IteratorBase<CppType>::IteratorBase(GstI
+ template<class CppType>
+ IteratorBase<CppType>& IteratorBase<CppType>::operator=(const IteratorBase<CppType>& other)
+ {
+-  IteratorBase temp(other);
+-  swap(temp);
++  if (cobject_ && take_ownership)
++  {
++    gst_iterator_free(cobject_);
++  }
++
++  if (G_IS_VALUE(&current))
++  {
++    g_value_unset(&current);
++  }
++
++  current_result = other.current_result;
++  cobject_ = other.take_ownership ? gst_iterator_copy(other.cobject_) : other.cobject_;
++
++  if (G_IS_VALUE (&other.current))
++  {
++    g_value_init(&current, G_VALUE_TYPE(&other.current));
++    g_value_copy(&other.current, &current);
++  }
++
+   return *this;
+ }
+ 
+@@ -410,28 +431,6 @@ IteratorBase<CppType>::operator bool() c
+   return (! G_VALUE_HOLDS_OBJECT(&current));
+ }
+ 
+-template<class CppType>
+-void IteratorBase<CppType>::swap(IteratorBase<CppType>& other)
+-{
+-  GstIterator *const temp_obj = cobject_;
+-  cobject_ = other.cobject_;
+-  other.cobject_ = temp_obj;
+-
+-  const bool temp_take_ownership = take_ownership;
+-  take_ownership = other.take_ownership;
+-  other.take_ownership = temp_take_ownership;
+-
+-  GValue temp_current = G_VALUE_INIT;
+-  g_value_init(&temp_current, G_VALUE_TYPE(current));
+-  g_value_copy(&current, &temp_current);
+-  g_value_copy(other.current, &current);
+-  g_value_copy(&temp_current, other.current);
+-
+-  const IteratorResult temp_result = current_result;
+-  current_result = other.current_result;
+-  other.current_result = temp_result;
+-}
+-
+ //virtual
+ template<class CppType>
+ IteratorBase<CppType>::~IteratorBase()
diff --git a/gstreamermm-gst1.12.patch b/gstreamermm-gst1.12.patch
new file mode 100644
index 0000000..7e009d7
--- /dev/null
+++ b/gstreamermm-gst1.12.patch
@@ -0,0 +1,45 @@
+Author: Marcin Kolny <marcin.kolny at gmail.com>
+Description: Gst::AudioClock: auto generate some audioclock methods
+Origin: https://bugzilla.gnome.org/show_bug.cgi?id=783628
+Last-update: 2017-07-01
+
+--- gstreamermm-1.8.0.orig/gstreamer/gstreamermm/audioclock.cc
++++ gstreamermm-1.8.0/gstreamer/gstreamermm/audioclock.cc
+@@ -2,6 +2,7 @@
+ 
+ 
+ #include <glibmm.h>
++#include <gst/gstversion.h>
+ 
+ #include <gstreamermm/audioclock.h>
+ #include <gstreamermm/private/audioclock_p.h>
+@@ -76,17 +77,29 @@ AudioClock::AudioClock(const Glib::ustri
+ 
+ Gst::ClockTime AudioClock::adjust(Gst::ClockTime time)
+ {
++#if GST_VERSION_MAJOR == 1 && GST_VERSION_MINOR >= 12
++  return ((Gst::ClockTime)(gst_audio_clock_adjust(gobj(), ((GstClockTime)(time)))));
++#else
+   return static_cast<Gst::ClockTime>(gst_audio_clock_adjust(GST_CLOCK_CAST(gobj()), static_cast<GstClockTime>(time)));
++#endif
+ }
+ 
+ Gst::ClockTime AudioClock::get_time() const
+ {
++#if GST_VERSION_MAJOR == 1 && GST_VERSION_MINOR >= 12
++  return ((Gst::ClockTime)(gst_audio_clock_get_time(const_cast<GstAudioClock*>(gobj()))));
++#else
+   return static_cast<Gst::ClockTime>(gst_audio_clock_get_time(GST_CLOCK_CAST(gobj())));
++#endif
+ }
+ 
+ void AudioClock::invalidate()
+ {
++#if GST_VERSION_MAJOR == 1 && GST_VERSION_MINOR >= 12
++  gst_audio_clock_invalidate(gobj());
++#else
+   gst_audio_clock_invalidate(GST_CLOCK_CAST(gobj()));
++#endif
+ }
+ 
+ } //namespace Gst
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gstreamermm.git/commitdiff/7584637b6ce2237af40eb51998b56161393861ae



More information about the pld-cvs-commit mailing list