[gstreamermm] Use copies of the underlying objects of Gst::Structure where necessary.



commit 94768e6c488c5c3d52196ca2f3b539a2e2b483c2
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Tue Jun 23 20:58:09 2009 -0400

    Use copies of the underlying objects of Gst::Structure where necessary.

 ChangeLog               |    6 ++++++
 gstreamer/src/event.ccg |    4 +++-
 gstreamer/src/query.ccg |    4 +++-
 3 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b0b38ca..c6adfb2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-06-18  José Alburquerque  <jaalburqu svn gnome org>
 
+	* gstreamer/src/event.ccg:
+	* gstreamer/src/query.ccg: Use copies of the underlying objects of
+	Gst::Structure when C API wants ownership of them.
+
+2009-06-18  José Alburquerque  <jaalburqu svn gnome org>
+
 	* configure.ac:
 	* gstreamer/src/Makefile_list_of_hg.am_fragment: Added appsrc and
 	appsink plug-ins.
diff --git a/gstreamer/src/event.ccg b/gstreamer/src/event.ccg
index 11c85d9..33adc1c 100644
--- a/gstreamer/src/event.ccg
+++ b/gstreamer/src/event.ccg
@@ -197,7 +197,9 @@ Event(castitem)
 
 Glib::RefPtr<Gst::Event> EventNavigation::create(Gst::Structure& structure)
 {
-  GstEvent* event = gst_event_new_navigation(structure.gobj());
+  // Make copy because event takes ownership of structure:
+  GstStructure* copy = gst_structure_copy(structure.gobj());
+  GstEvent* event = gst_event_new_navigation(copy);
   return Gst::Event::wrap(event, false);
 }
 
diff --git a/gstreamer/src/query.ccg b/gstreamer/src/query.ccg
index 9c7c45d..f33ec13 100644
--- a/gstreamer/src/query.ccg
+++ b/gstreamer/src/query.ccg
@@ -87,8 +87,10 @@ Query(castitem)
 
 Glib::RefPtr<Gst::Query> QueryApplication::create(QueryType type, Gst::Structure& structure)
 {
+  // Create copy because query takes ownership of structure:
+  GstStructure* copy_struct = gst_structure_copy(structure.gobj());
   GstQuery* query = gst_query_new_application(GstQueryType(type),
-    structure.gobj()); 
+    copy_struct); 
   return Gst::Query::wrap(query);
 }
 



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