Hello community, here is the log from the commit of package gstreamermm for openSUSE:Factory checked in at 2018-06-25 11:42:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gstreamermm (Old) and /work/SRC/openSUSE:Factory/.gstreamermm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gstreamermm" Mon Jun 25 11:42:38 2018 rev:5 rq:618799 version:1.10.0 Changes: -------- --- /work/SRC/openSUSE:Factory/gstreamermm/gstreamermm.changes 2017-10-29 20:25:02.085882720 +0100 +++ /work/SRC/openSUSE:Factory/.gstreamermm.new/gstreamermm.changes 2018-06-25 11:42:43.192775354 +0200 @@ -1,0 +2,8 @@ +Sat Jun 23 18:44:50 UTC 2018 - [email protected] + +- Add gstreamermm-copy_metadata_vfunc.patch, + gstreamermm-copy_metadata_vfunc2.patch and + gstreamermm-copy_metadata_vfunc3.patch: Fix several bugs tied to + copy_metadata_vfunc (bgo#794249, bgo#794250). + +------------------------------------------------------------------- New: ---- gstreamermm-copy_metadata_vfunc.patch gstreamermm-copy_metadata_vfunc2.patch gstreamermm-copy_metadata_vfunc3.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gstreamermm.spec ++++++ --- /var/tmp/diff_new_pack.c7gUTe/_old 2018-06-25 11:42:44.024744671 +0200 +++ /var/tmp/diff_new_pack.c7gUTe/_new 2018-06-25 11:42:44.028744522 +0200 @@ -29,6 +29,12 @@ Url: http://www.gstreamer.net/bindings/cplusplus.html Source0: https://ftp.gnome.org/pub/gnome/sources/gstreamermm/%{_sver}/%{name}-%{version}.tar.xz Source99: %{name}-rpmlintrc +# PATCH-FIX-UPSTREAM gstreamermm-copy_metadata_vfunc.patch bgo#794249 -- Fix bug tied to copy_metadata_vfunc +Patch0: gstreamermm-copy_metadata_vfunc.patch +# PATCH-FIX-UPSTREAM gstreamermm-copy_metadata_vfunc.patch bgo#794250 -- Fix bug tied to copy_metadata_vfunc +Patch1: gstreamermm-copy_metadata_vfunc2.patch +# PATCH-FIX-UPSTREAM gstreamermm-copy_metadata_vfunc.patch -- Fix bug tied to copy_metadata_vfunc +Patch2: gstreamermm-copy_metadata_vfunc3.patch BuildRequires: Mesa-libGLESv2-devel BuildRequires: doxygen BuildRequires: gcc-c++ @@ -80,7 +86,7 @@ develop applications that work with multimedia in C++. %prep -%setup -q +%autosetup -p1 %build %configure ++++++ gstreamermm-copy_metadata_vfunc.patch ++++++ >From 4d1efb14d2e99b7525f222a561bb1eb9f4576026 Mon Sep 17 00:00:00 2001 From: Marcin Kolny <[email protected]> Date: Sat, 14 Apr 2018 16:22:47 +0100 Subject: [PATCH] Gst::BaseTransform: fix copy_metadata_vfunc memory leak default_copy_metadata() requires writable output buffer. However, gstreamermm increases refcount (Glib::wrap(outbuf, true)), so the buffer was not writable anymore. This commit fixes this issue. https://bugzilla.gnome.org/show_bug.cgi?id=794249 --- gstreamer/src/basetransform.ccg | 59 +++++++++++++++++++++++++++++++++ gstreamer/src/basetransform.hg | 4 ++- 2 files changed, 62 insertions(+), 1 deletion(-) diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg index 14fc387..9ae7b68 100644 --- a/gstreamer/src/basetransform.ccg +++ b/gstreamer/src/basetransform.ccg @@ -208,6 +208,49 @@ GstFlowReturn BaseTransform_Class::generate_output_vfunc_callback(GstBaseTransfo return RType(); } +gboolean BaseTransform_Class::copy_metadata_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer* outbuf) +{ + const auto obj_base = static_cast<Glib::ObjectBase*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj_base && obj_base->is_derived_()) + { + const auto obj = dynamic_cast<CppObjectType* const>(obj_base); + if(obj) // This can be NULL during destruction. + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + // outbuf must be writable, so we can't increase a refcount: + Glib::RefPtr<Gst::Buffer> cpp_output = Glib::wrap(outbuf, false); + auto res = static_cast<int>(obj->copy_metadata_vfunc(Glib::wrap(input, true), cpp_output)); + IGNORE_RESULT(cpp_output.release()); + return res; + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + } + + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->copy_metadata) + return (*base->copy_metadata)(self, input, outbuf); + + using RType = gboolean; + return RType(); +} + FlowReturn Gst::BaseTransform::generate_output_vfunc(Glib::RefPtr<Gst::Buffer>& outbuf) { BaseClassType *const base = static_cast<BaseClassType*>( @@ -227,6 +270,22 @@ FlowReturn Gst::BaseTransform::generate_output_vfunc(Glib::RefPtr<Gst::Buffer>& return RType(); } +bool Gst::BaseTransform::copy_metadata_vfunc(const Glib::RefPtr<Gst::Buffer>& input, const Glib::RefPtr<Gst::Buffer>& outbuf) +{ + const auto 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->copy_metadata) + { + bool retval((*base->copy_metadata)(gobj(),Glib::unwrap(input),Glib::unwrap(outbuf))); + return retval; + } + + using RType = bool; + return RType(); +} + gboolean BaseTransform_Class::query_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstQuery* query) { const auto obj_base = static_cast<Glib::ObjectBase*>( diff --git a/gstreamer/src/basetransform.hg b/gstreamer/src/basetransform.hg index f845414..46a9b52 100644 --- a/gstreamer/src/basetransform.hg +++ b/gstreamer/src/basetransform.hg @@ -309,7 +309,7 @@ public: /** Optional. Copy the metadata from the input buffer to the output buffer. * The default implementation will copy the flags, timestamps and offsets of the buffer. */ - _WRAP_VFUNC(bool copy_metadata(const Glib::RefPtr<Gst::Buffer>& input, const Glib::RefPtr<Gst::Buffer>& outbuf), "copy_metadata") + virtual bool copy_metadata_vfunc(const Glib::RefPtr<Gst::Buffer>& input, const Glib::RefPtr<Gst::Buffer>& outbuf); /** Optional. Handle a requested query. Subclasses that implement this should must chain up to * the parent if they didn't handle the query @@ -321,6 +321,7 @@ protected: _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS) klass->prepare_output_buffer = &prepare_output_buffer_vfunc_callback; klass->transform = &transform_vfunc_callback; + klass->copy_metadata = ©_metadata_vfunc_callback; klass->generate_output = &generate_output_vfunc_callback; klass->query = &query_vfunc_callback; klass->propose_allocation = &propose_allocation_vfunc_callback; @@ -328,6 +329,7 @@ protected: _SECTION(SECTION_PH_VFUNCS) static GstFlowReturn prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer** buf); static GstFlowReturn transform_vfunc_callback(GstBaseTransform* self, GstBuffer* inbuf, GstBuffer* outbuf); + static gboolean copy_metadata_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer* outbuf); static GstFlowReturn generate_output_vfunc_callback(GstBaseTransform* self, GstBuffer** outbuf); static gboolean query_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstQuery* query); static gboolean propose_allocation_vfunc_callback(GstBaseTransform* self, GstQuery* decide_query, GstQuery* query); -- 2.17.1 ++++++ gstreamermm-copy_metadata_vfunc2.patch ++++++ >From 3f5fe44d45f4c2cefd0731bbd874a9bc9ae2dc5c Mon Sep 17 00:00:00 2001 From: Marcin Kolny <[email protected]> Date: Sat, 14 Apr 2018 16:31:39 +0100 Subject: [PATCH] Gst::BaseTransform: pass writable buffer to transform_ip function transform_ip_vfunc should get writable buffer as an argument. However, gstreamermm increases refcount (Glib::wrap(outbuf, true)), so the buffer was not writable anymore. This commit fixes this issue. https://bugzilla.gnome.org/show_bug.cgi?id=794250 --- gstreamer/src/basetransform.ccg | 58 +++++++++++++++++++++++++++++++++ gstreamer/src/basetransform.hg | 4 ++- 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/gstreamer/src/basetransform.ccg b/gstreamer/src/basetransform.ccg index 9ae7b68..04b01e6 100644 --- a/gstreamer/src/basetransform.ccg +++ b/gstreamer/src/basetransform.ccg @@ -147,6 +147,48 @@ GstFlowReturn BaseTransform_Class::transform_vfunc_callback(GstBaseTransform* se return RType(); } +GstFlowReturn BaseTransform_Class::transform_ip_vfunc_callback(GstBaseTransform* self, GstBuffer* buf) +{ + const auto obj_base = static_cast<Glib::ObjectBase*>( + Glib::ObjectBase::_get_current_wrapper((GObject*)self)); + + // Non-gtkmmproc-generated custom classes implicitly call the default + // Glib::ObjectBase constructor, which sets is_derived_. But gtkmmproc- + // generated classes can use this optimisation, which avoids the unnecessary + // parameter conversions if there is no possibility of the virtual function + // being overridden: + if(obj_base && obj_base->is_derived_()) + { + const auto obj = dynamic_cast<CppObjectType* const>(obj_base); + if(obj) // This can be NULL during destruction. + { + try // Trap C++ exceptions which would normally be lost because this is a C callback. + { + // Call the virtual member method, which derived classes might override. + Glib::RefPtr<Gst::Buffer> cpp_buf = Glib::wrap(buf, false); + GstFlowReturn ret = (GstFlowReturn)obj->transform_ip_vfunc(cpp_buf); + IGNORE_RESULT(cpp_buf.release()); + return ret; + } + catch(...) + { + Glib::exception_handlers_invoke(); + } + } + } + + BaseClassType *const base = static_cast<BaseClassType*>( + g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class). + ); + + // Call the original underlying C function: + if(base && base->transform_ip) + return (*base->transform_ip)(self, buf); + + using RType = GstFlowReturn; + return RType(); +} + FlowReturn Gst::BaseTransform::transform_vfunc(const Glib::RefPtr<Gst::Buffer>& inbuf, const Glib::RefPtr<Gst::Buffer>& outbuf) { BaseClassType *const base = static_cast<BaseClassType*>( @@ -163,6 +205,22 @@ FlowReturn Gst::BaseTransform::transform_vfunc(const Glib::RefPtr<Gst::Buffer>& return RType(); } +FlowReturn Gst::BaseTransform::transform_ip_vfunc(const Glib::RefPtr<Gst::Buffer>& buf) +{ + const auto 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->transform_ip) + { + FlowReturn retval(((FlowReturn)((*base->transform_ip)(gobj(),Glib::unwrap(buf))))); + return retval; + } + + using RType = FlowReturn; + return RType(); +} + GstFlowReturn BaseTransform_Class::generate_output_vfunc_callback(GstBaseTransform* self, GstBuffer** outbuf) { Glib::ObjectBase *const obj_base = static_cast<Glib::ObjectBase*>( diff --git a/gstreamer/src/basetransform.hg b/gstreamer/src/basetransform.hg index 46a9b52..6830bd1 100644 --- a/gstreamer/src/basetransform.hg +++ b/gstreamer/src/basetransform.hg @@ -217,7 +217,7 @@ public: /** Required if the element operates in-place. Transform the incoming buffer * in-place. */ - _WRAP_VFUNC(FlowReturn transform_ip(const Glib::RefPtr<Gst::Buffer>& buf), "transform_ip") + virtual FlowReturn transform_ip_vfunc(const Glib::RefPtr<Gst::Buffer>& buf); /** Optional. Subclasses can override this to do their own allocation of * output buffers. Elements that only do analysis can return a subbuffer or @@ -321,6 +321,7 @@ protected: _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS) klass->prepare_output_buffer = &prepare_output_buffer_vfunc_callback; klass->transform = &transform_vfunc_callback; + klass->transform_ip = &transform_ip_vfunc_callback; klass->copy_metadata = ©_metadata_vfunc_callback; klass->generate_output = &generate_output_vfunc_callback; klass->query = &query_vfunc_callback; @@ -329,6 +330,7 @@ protected: _SECTION(SECTION_PH_VFUNCS) static GstFlowReturn prepare_output_buffer_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer** buf); static GstFlowReturn transform_vfunc_callback(GstBaseTransform* self, GstBuffer* inbuf, GstBuffer* outbuf); + static GstFlowReturn transform_ip_vfunc_callback(GstBaseTransform* self, GstBuffer* buf); static gboolean copy_metadata_vfunc_callback(GstBaseTransform* self, GstBuffer* input, GstBuffer* outbuf); static GstFlowReturn generate_output_vfunc_callback(GstBaseTransform* self, GstBuffer** outbuf); static gboolean query_vfunc_callback(GstBaseTransform* self, GstPadDirection direction, GstQuery* query); -- 2.17.1 ++++++ gstreamermm-copy_metadata_vfunc3.patch ++++++ >From 20090e4db48fa30e193be2637e881add4cb6d3d4 Mon Sep 17 00:00:00 2001 From: Marcin Kolny <[email protected]> Date: Sat, 5 May 2018 13:01:44 +0100 Subject: [PATCH] Gst::AudioBaseSink: increase refcount of returned buffer in create_ring_buffer() --- gstreamer/src/audiobasesink.hg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gstreamer/src/audiobasesink.hg b/gstreamer/src/audiobasesink.hg index 7b6e57f..7809c40 100644 --- a/gstreamer/src/audiobasesink.hg +++ b/gstreamer/src/audiobasesink.hg @@ -109,7 +109,7 @@ public: /** vfunc to create and return a Gst::AudioRingBuffer to write to. */ - _WRAP_VFUNC(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(), "create_ringbuffer") + _WRAP_VFUNC(Glib::RefPtr<Gst::AudioRingBuffer> create_ring_buffer(), "create_ringbuffer", refreturn_ctype) /** vfunc to payload data in a format suitable to write to the sink. If no * payloading is required, returns a reffed copy of the original -- 2.17.1
