gnomemm r1400 - in gstreamermm/trunk: . gstreamer/src tests



Author: jaalburqu
Date: Mon Mar 10 18:13:28 2008
New Revision: 1400
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1400&view=rev

Log:
2008-03-10  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/caps.hg:
	* gstreamer/src/event.hg:
	* gstreamer/src/message.hg:
	* gstreamer/src/query.hg: Added get_structure() docs commenting that
	assigning structures engenders a copy and not the original

	* tests/test-structure.cc: Modified test to create a structure and not
	use one from a Query

	* gstreamer/src/clock.hg: Moved ClockTime, ClockTimeDiff and
	CLOCK_TIME_NONE to:
	* gstreamer/src/enums.hg:

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/caps.hg
   gstreamermm/trunk/gstreamer/src/clock.hg
   gstreamermm/trunk/gstreamer/src/enums.hg
   gstreamermm/trunk/gstreamer/src/event.hg
   gstreamermm/trunk/gstreamer/src/message.hg
   gstreamermm/trunk/gstreamer/src/query.hg
   gstreamermm/trunk/tests/test-structure.cc

Modified: gstreamermm/trunk/gstreamer/src/caps.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/caps.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/caps.hg	Mon Mar 10 18:13:28 2008
@@ -90,6 +90,11 @@
    * @param index the index of the structure
    * @return the Structure corresponding to index
    */
+
+  /** (Please note that when Structures are assigned, the original is copied
+   * which means that the copy may be modifiable but the original never is.
+   * Also, if the original changes for any reason, the copy will not.)
+   */
   const Structure& get_structure(guint idx) const;
 
   _WRAP_METHOD(void remove_structure(guint idx), gst_caps_remove_structure)

Modified: gstreamermm/trunk/gstreamer/src/clock.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/clock.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/clock.hg	Mon Mar 10 18:13:28 2008
@@ -35,10 +35,6 @@
   _IGNORE(gst_clock_id_ref, gst_clock_id_unref)
 };
 
-typedef GstClockTime ClockTime;
-typedef GstClockTimeDiff ClockTimeDiff;
-const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
-
 //Note that ClockTime is an enum.  That's why these are not member functions of a class
 
 guint get_hours(ClockTime time);

Modified: gstreamermm/trunk/gstreamer/src/enums.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/enums.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/enums.hg	Mon Mar 10 18:13:28 2008
@@ -27,6 +27,11 @@
 
 namespace Gst
 {
+
+typedef GstClockTime ClockTime;
+typedef GstClockTimeDiff ClockTimeDiff;
+const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
+
 _WRAP_ENUM(AssocFlags, GstAssocFlags)
 _WRAP_ENUM(BufferCopyFlags, GstBufferCopyFlags)
 _WRAP_ENUM(BufferFlag, GstBufferFlag)

Modified: gstreamermm/trunk/gstreamer/src/event.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/event.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/event.hg	Mon Mar 10 18:13:28 2008
@@ -35,6 +35,13 @@
   _CLASS_GSTMINIOBJECT(Event, GstEvent, GST_EVENT, Gst::MiniObject, GstMiniObject)
 
 public:
+  /** Get the structure of an event.  Please note that when Structures are
+   * assigned, the original is copied which means that the copy may be
+   * modifiable but the original never is.  Also, if the original changes for
+   * any reason, the copy will not.
+   *
+   * @return The Structure of the event (unmodifiable)
+   */
   const Structure& get_structure();
 
 public:

Modified: gstreamermm/trunk/gstreamer/src/message.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/message.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/message.hg	Mon Mar 10 18:13:28 2008
@@ -35,10 +35,16 @@
  _CLASS_GSTMINIOBJECT(Message, GstMessage, GST_MESSAGE, Gst::MiniObject, GstMiniObject)
  _IGNORE(gst_message_ref, gst_message_unref)
 public:
+  /** Get the structure of a message.  Please note that when Structures are
+   * assigned, the original is copied which means that the copy may be
+   * modifiable but the original never is.  Also, if the original changes for
+   * any reason, the copy will not.
+   *
+   * @return The Structure of the message (unmodifiable)
+   */
   const Structure& get_structure();
 
 public:
-
   /** Wrap a GstMessage* in a C++ instance, creating an instance of a
    *  derived Gst::Message.  Gst::wrap() would just create a Gst::Message
    *  (rather than a derived one) because the derived Gst::Message classes

Modified: gstreamermm/trunk/gstreamer/src/query.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/query.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/query.hg	Mon Mar 10 18:13:28 2008
@@ -43,6 +43,13 @@
   _CLASS_GSTMINIOBJECT(Query, GstQuery, GST_QUERY, Gst::MiniObject, GstMiniObject)
 
 public:
+  /** Get the structure of a query.  Please note that when Structures are
+   * assigned, the original is copied which means that the copy may be
+   * modifiable but the original never is.  Also, if the original changes for
+   * any reason, the copy will not.
+   *
+   * @return The Structure of the query (unmodifiable)
+   */
   const Structure& get_structure();
 
 public:

Modified: gstreamermm/trunk/tests/test-structure.cc
==============================================================================
--- gstreamermm/trunk/tests/test-structure.cc	(original)
+++ gstreamermm/trunk/tests/test-structure.cc	Mon Mar 10 18:13:28 2008
@@ -26,8 +26,7 @@
 {
   Gst::init(argc, argv);
 
-  Glib::RefPtr<Gst::Query> latencyQuery = Gst::QueryLatency::create();
-  Gst::Structure structure = latencyQuery->get_structure();
+  Gst::Structure structure("my_structure");
 
   Glib::Value<Glib::ustring> stringValue;
   stringValue.init(Glib::Value<Glib::ustring>::value_type());
@@ -39,9 +38,13 @@
 
   structure.set_field(Glib::Quark("string"), stringValue).set_field("integer", intValue);
 
-  Glib::Value<Glib::ustring> value;
-  structure.get_field("string", value);
-  std::cout << "value = '" << value.get() << "'" << std::endl;
+  Glib::Value<Glib::ustring> value1;
+  structure.get_field("string", value1);
+  std::cout << "value1 = '" << value1.get() << "'" << std::endl;
+
+  Glib::Value<int> value2;
+  structure.get_field("integer", value2);
+  std::cout << "value2 = '" << value2.get() << "'" << std::endl;
 
   return 0;
 }



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