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



Author: jaalburqu
Date: Wed Sep 17 06:27:03 2008
New Revision: 1702
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1702&view=rev

Log:
2008-09-17  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/caps.ccg:
	* gstreamer/src/caps.hg: Made Glib::Value< Glib::RefPtr<Gst::Caps> >
	template specialization derive from Glib::ValueBase_Boxed instead of
	Value_Boxed<Gst::Caps>.  Moved the specialization set() method
	implementation to .hg file. Also added get() method (for getting
	properties) and custom value_type() definition (all in .hg file as in
	glibmm/value.h).

	* tests/test-property-caps.cc: Modified caps property test to get
	property before and after setting the property.

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/caps.ccg
   gstreamermm/trunk/gstreamer/src/caps.hg
   gstreamermm/trunk/tests/test-property-caps.cc

Modified: gstreamermm/trunk/gstreamer/src/caps.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/caps.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/caps.ccg	Wed Sep 17 06:27:03 2008
@@ -118,13 +118,3 @@
 }
 
 } //namespace Gst
-
-namespace Glib
-{
-
-void Value< Glib::RefPtr<Gst::Caps> >::set(const Glib::RefPtr<Gst::Caps>& caps)
-{
-  Value_Boxed<Gst::Caps>::set(*(caps.operator->()));
-}
-
-}

Modified: gstreamermm/trunk/gstreamer/src/caps.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/caps.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/caps.hg	Wed Sep 17 06:27:03 2008
@@ -205,10 +205,12 @@
 {
 
 template <>
-class Value< Glib::RefPtr<Gst::Caps> > : public Value_Boxed<Gst::Caps>
+class Value< Glib::RefPtr<Gst::Caps> > : public ValueBase_Boxed
 {
 public:
-  void set(const Glib::RefPtr<Gst::Caps>& caps);
+  static GType value_type() { return Gst::Caps::get_type(); }
+  void set(const Glib::RefPtr<Gst::Caps>& caps) { set_boxed(caps->gobj()); }
+  Glib::RefPtr<Gst::Caps> get()                 { return Glib::RefPtr<Gst::Caps>(reinterpret_cast<Gst::Caps*>(get_boxed())); }
 };
 
 }

Modified: gstreamermm/trunk/tests/test-property-caps.cc
==============================================================================
--- gstreamermm/trunk/tests/test-property-caps.cc	(original)
+++ gstreamermm/trunk/tests/test-property-caps.cc	Wed Sep 17 06:27:03 2008
@@ -17,11 +17,21 @@
     return -1;
   }
 
-  Glib::RefPtr<Gst::Caps> caps =
-          Gst::Caps::create_from_string("image/jpeg,framerate=2/1");
- 
-  // Verify that setting "caps" property compiles:
-  source->set_property("caps", caps);
+  Glib::RefPtr<Gst::Caps> caps;
+
+  source->get_property("caps", caps);
+
+  if (!caps)
+    std::cout << "`caps' property is null before setting property." <<
+      std::endl;
+
+  source->set_property("caps", Gst::Caps::create_from_string("image/jpeg,framerate=2/1"));
+
+  source->get_property("caps", caps);
+
+  if (caps)
+    std::cout << "`caps' property after setting and getting is '" <<
+      caps->to_string() << "'." << std::endl;
 
   return 0;
 }



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