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



Author: jaalburqu
Date: Fri Feb 15 01:06:40 2008
New Revision: 1350
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1350&view=rev

Log:
2008-02-14  Josà Alburquerque  <jaalburqu svn gnome org>

	* gstreamer/src/bin.ccg:
	* gstreamer/src/bin.hg: Wrapped signals; Wrapped methods that could be
	wrapped and removed handwritten definitions; Wrapped property (but
	something to do with GLIBMM_PROPERTIES_ENABLED def is hiding it
	in docs)
	* gstreamer/src/buffer.hg:
	* gstreamer/src/caps.hg:
	* gstreamer/src/childproxy.hg:
	* gstreamer/src/elementfactory.hg:
	* gstreamer/src/plugin.hg:
	* gstreamer/src/structure.hg:
	* tests/test-pipeline-add-element.cc: Reviewed recent method name
	changes and realized that it's best to stick with the C API names for
	now and use prefixes "get_", "is_" and "has_" consistently (Names can
	be reviewed later)

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/bin.ccg
   gstreamermm/trunk/gstreamer/src/bin.hg
   gstreamermm/trunk/gstreamer/src/buffer.hg
   gstreamermm/trunk/gstreamer/src/caps.hg
   gstreamermm/trunk/gstreamer/src/childproxy.hg
   gstreamermm/trunk/gstreamer/src/elementfactory.hg
   gstreamermm/trunk/gstreamer/src/plugin.hg
   gstreamermm/trunk/gstreamer/src/structure.hg
   gstreamermm/trunk/tests/test-pipeline-add-element.cc

Modified: gstreamermm/trunk/gstreamer/src/bin.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/bin.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/bin.ccg	Fri Feb 15 01:06:40 2008
@@ -53,34 +53,4 @@
     throw std::runtime_error("Bin '" + get_name() + "' does not want to remove Element '" + element->get_name() + "'");
 }
 
-Glib::RefPtr<Element> Bin::get_by_name(const Glib::ustring& element_name)
-{
-  GstElement* element = gst_bin_get_by_name(gobj(), element_name.c_str());
-
-  if(element != NULL)
-    return Glib::wrap(element, false);
-  else
-    throw std::runtime_error("Bin '" + get_name() + "' contains no Element '" + element_name + "'");
-}
-
-Glib::RefPtr<Element> Bin::get_by_name_recurse_up(const Glib::ustring& element_name)
-{
-  GstElement* element = gst_bin_get_by_name_recurse_up(gobj(), element_name.c_str());
-
-  if(element != NULL)
-    return Glib::wrap(element, false);
-  else
-    throw std::runtime_error("Bin '" + get_name() + "' contains no Element '" + element_name + "'");
-}
-
-Glib::RefPtr<Pad> Bin::find_unconnected_pad(PadDirection direction)
-{
-  GstPad* pad = gst_bin_find_unconnected_pad(gobj(), GstPadDirection(direction));
-
-  if(pad != NULL)
-    return Glib::wrap(pad, false);
-  else
-    throw std::runtime_error("Bin '" + get_name() + "' contains no unconnected Pad(s)");
-}
-
 } //namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/bin.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/bin.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/bin.hg	Fri Feb 15 01:06:40 2008
@@ -51,17 +51,18 @@
   Glib::RefPtr<Bin> add(const Glib::RefPtr<Element>& element);
   Glib::RefPtr<Bin> remove(const Glib::RefPtr<Element>& element);
 
-  Glib::RefPtr<Element> get_by_name(const Glib::ustring& element_name);
-  Glib::RefPtr<Element> get_by_name_recurse_up(const Glib::ustring& element_name);
-  _WRAP_METHOD(Glib::RefPtr<Element> get_by_interface(GType interface), gst_bin_get_by_interface)
+  _WRAP_METHOD(Glib::RefPtr<Element> get_element(const Glib::ustring& name), gst_bin_get_by_name)
+  _WRAP_METHOD(Glib::RefPtr<Element> get_element_recurse_up(const Glib::ustring& name), gst_bin_get_by_name_recurse_up)
+  _WRAP_METHOD(Glib::RefPtr<Element> get_element(GType interface), gst_bin_get_by_interface)
+  _WRAP_METHOD(Glib::RefPtr<Pad> find_unconnected_pad(PadDirection dir), gst_bin_find_unconnected_pad)
 
-  Glib::RefPtr<Pad> find_unconnected_pad(PadDirection direction);
-
-  _IGNORE(gst_bin_add, gst_bin_remove, gst_bin_get_by_name, gst_bin_get_by_name_recurse_up)
+  _IGNORE(gst_bin_add, gst_bin_remove)
 
 #m4 _CONVERSION(`GstElement*',`const Glib::RefPtr<Element>&', `Glib::wrap($3, true)')
-  //TODO: When wrap() works: _WRAP_SIGNAL(void element_added(const Glib::RefPtr<Element>& element), "element-added")
-  //TODO: When wrap() works: _WRAP_SIGNAL(void element_removed(const Glib::RefPtr<Element>& element), "element-removed")
+  _WRAP_SIGNAL(void element_added(const Glib::RefPtr<Element>& element), "element-added")
+  _WRAP_SIGNAL(void element_removed(const Glib::RefPtr<Element>& element), "element-removed")
+
+  _WRAP_PROPERTY("async-handling", bool)
 };
 
 } //namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/buffer.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/buffer.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/buffer.hg	Fri Feb 15 01:06:40 2008
@@ -39,10 +39,10 @@
 public:
   static Glib::RefPtr<Buffer> create(const guint& size);
 
-  _WRAP_METHOD(guint flags() const, GST_BUFFER_FLAGS)
-  _WRAP_METHOD(bool flag_is_set(BufferFlag flag) const, GST_BUFFER_FLAG_IS_SET)
-  _WRAP_METHOD(void flag_set(BufferFlag flag), GST_BUFFER_FLAG_SET)
-  _WRAP_METHOD(void flag_unset(BufferFlag flag), GST_BUFFER_FLAG_UNSET)
+  _WRAP_METHOD(guint get_flags() const, GST_BUFFER_FLAGS)
+  _WRAP_METHOD(bool is_set_flag(BufferFlag flag) const, GST_BUFFER_FLAG_IS_SET)
+  _WRAP_METHOD(void set_flag(BufferFlag flag), GST_BUFFER_FLAG_SET)
+  _WRAP_METHOD(void unset_flag(BufferFlag flag), GST_BUFFER_FLAG_UNSET)
 
   _WRAP_METHOD(Glib::RefPtr<Buffer> copy() const, gst_buffer_copy)
 

Modified: gstreamermm/trunk/gstreamer/src/caps.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/caps.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/caps.hg	Fri Feb 15 01:06:40 2008
@@ -52,7 +52,7 @@
   _WRAP_METHOD(Structure* get_structure(guint idx), gst_caps_get_structure)
 
   _WRAP_METHOD(void remove_structure(guint idx), gst_caps_remove_structure)
-  _WRAP_METHOD(guint size() const, gst_caps_get_size)
+  _WRAP_METHOD(guint get_size() const, gst_caps_get_size)
 
   //TODO: Want to return RefPtr to Caps but using RefPtr in expressions such
   //TODO: as 'caps->set_simple(name1, value1)->set_simple(name2, value2)' a
@@ -63,14 +63,14 @@
   _WRAP_METHOD(void set_simple_valist(char* field, const va_list& varargs), gst_caps_set_simple_valist)
 
   _WRAP_METHOD(bool is_any() const, gst_caps_is_any)
-  _WRAP_METHOD(bool empty() const, gst_caps_is_empty)
-  _WRAP_METHOD(bool fixed() const, gst_caps_is_fixed)
-  _WRAP_METHOD(bool equals(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_equal)
-  _WRAP_METHOD(bool equals_fixed(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_equal_fixed)
-  _WRAP_METHOD(bool always_compatible(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_always_compatible)
-  _WRAP_METHOD(bool subset(const Glib::RefPtr<Caps>& superset_caps) const, gst_caps_is_subset)
-  _WRAP_METHOD(Glib::RefPtr<Caps> the_intersect(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_intersect)
-  _WRAP_METHOD(Glib::RefPtr<Caps> the_union(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_union)
+  _WRAP_METHOD(bool is_empty() const, gst_caps_is_empty)
+  _WRAP_METHOD(bool is_fixed() const, gst_caps_is_fixed)
+  _WRAP_METHOD(bool is_equal(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_equal)
+  _WRAP_METHOD(bool is_equal_fixed(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_equal_fixed)
+  _WRAP_METHOD(bool is_always_compatible(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_is_always_compatible)
+  _WRAP_METHOD(bool is_subset(const Glib::RefPtr<Caps>& superset_caps) const, gst_caps_is_subset)
+  _WRAP_METHOD(Glib::RefPtr<Caps> get_intersect(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_intersect)
+  _WRAP_METHOD(Glib::RefPtr<Caps> get_union(const Glib::RefPtr<Caps>& other_caps) const, gst_caps_union)
   _WRAP_METHOD(Glib::RefPtr<Caps> normalize(), gst_caps_normalize)
   _WRAP_METHOD(bool simplify(), gst_caps_do_simplify)
   _WRAP_METHOD(xmlNodePtr save(const xmlNodePtr& parent) const, gst_caps_save_thyself)

Modified: gstreamermm/trunk/gstreamer/src/childproxy.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/childproxy.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/childproxy.hg	Fri Feb 15 01:06:40 2008
@@ -46,7 +46,7 @@
   _CLASS_INTERFACE(ChildProxy, GstChildProxy, GST_CHILD_PROXY, GstChildProxyInterface)
 
 public:
-  _WRAP_METHOD(guint children_count(), gst_child_proxy_get_children_count)
+  _WRAP_METHOD(guint get_children_count(), gst_child_proxy_get_children_count)
   _WRAP_METHOD(Glib::RefPtr<Gst::Object> get_child(const Glib::ustring& name), gst_child_proxy_get_child_by_name)
   _WRAP_METHOD(Glib::RefPtr<Gst::Object> get_child(guint index), gst_child_proxy_get_child_by_index)
 

Modified: gstreamermm/trunk/gstreamer/src/elementfactory.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/elementfactory.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/elementfactory.hg	Fri Feb 15 01:06:40 2008
@@ -66,9 +66,9 @@
   _WRAP_METHOD(Glib::ustring get_kclass() const, gst_element_factory_get_klass)
   _WRAP_METHOD(Glib::ustring get_description() const, gst_element_factory_get_description)
   _WRAP_METHOD(Glib::ustring get_author() const, gst_element_factory_get_author)
-  _WRAP_METHOD(guint num_pad_templates() const, gst_element_factory_get_num_pad_templates)
-  _WRAP_METHOD(int uri_type() const, gst_element_factory_get_uri_type)
-  _WRAP_METHOD(Glib::StringArrayHandle uri_protocols() const, gst_element_factory_get_uri_protocols)
+  _WRAP_METHOD(guint get_num_pad_templates() const, gst_element_factory_get_num_pad_templates)
+  _WRAP_METHOD(int get_uri_type() const, gst_element_factory_get_uri_type)
+  _WRAP_METHOD(Glib::StringArrayHandle get_uri_protocols() const, gst_element_factory_get_uri_protocols)
   _WRAP_METHOD(bool has_interface(const Glib::ustring& name) const, gst_element_factory_has_interface)
   _WRAP_METHOD(Glib::RefPtr<Element> create(const Glib::ustring& name), gst_element_factory_create)
   _WRAP_METHOD(static Glib::RefPtr<Element> make(const Glib::ustring& factory_name, const Glib::ustring& name), gst_element_factory_make)
@@ -76,7 +76,7 @@
   _WRAP_METHOD(bool can_src_caps(const Glib::RefPtr<const Caps>& caps) const, gst_element_factory_can_src_caps)
 
 #m4 _CONVERSION(`const GList*', `Glib::ListHandle< Glib::RefPtr<const PadTemplate> >', `$2(const_cast<GList*>($3), Glib::OWNERSHIP_NONE)')
-  _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const PadTemplate> > static_pad_templates(), gst_element_factory_get_static_pad_templates)
+  _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<const PadTemplate> > get_static_pad_templates(), gst_element_factory_get_static_pad_templates)
 };
 
 } // namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/plugin.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/plugin.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/plugin.hg	Fri Feb 15 01:06:40 2008
@@ -80,7 +80,7 @@
 
   _WRAP_METHOD(GModule* get_module() const, gst_plugin_get_module)
 
-  _WRAP_METHOD(bool loaded() const, gst_plugin_is_loaded)
+  _WRAP_METHOD(bool is_loaded() const, gst_plugin_is_loaded)
   _WRAP_METHOD(bool name_filter(const Glib::ustring& name) const, gst_plugin_name_filter)
 
   _WRAP_METHOD(static Glib::RefPtr<Plugin> load_file(const Glib::ustring& name), gst_plugin_load_file, errthrow)

Modified: gstreamermm/trunk/gstreamer/src/structure.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/structure.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/structure.hg	Fri Feb 15 01:06:40 2008
@@ -27,6 +27,21 @@
 namespace Gst
 {
 
+/** Structure â Generic structure containing fields of names and values.
+ * A Structure is a collection of key/value pairs. The keys are expressed as
+ * GQuarks and the values can be of any GType.
+ *
+ * In addition to the key/value pairs, a Structure also has a name. The name
+ * starts with a letter and can be folled by letters, numbers and any of
+ * "/-_.:".
+ *
+ * Structure is used by various GStreamer subsystems to store information in a
+ * flexible and extensible way. A Structure does not have a refcount because it
+ * usually is part of a higher level object such as Caps. It provides a means
+ * to enforce mutability using the refcount of the parent.
+ *
+ * Last reviewed on 2007-10-16 (0.10.15)
+ */
 class Structure
 {
   _CLASS_BOXEDTYPE(Structure, GstStructure, NONE, gst_structure_copy, gst_structure_free)
@@ -38,8 +53,8 @@
 public:
   Structure(const Glib::ustring& name);
 
-  _WRAP_METHOD(int size() const, gst_structure_n_fields)
-  _WRAP_METHOD(void clear(), gst_structure_remove_all_fields)
+  _WRAP_METHOD(int get_size() const, gst_structure_n_fields)
+  _WRAP_METHOD(void remove_all_fields(), gst_structure_remove_all_fields)
 
   _WRAP_METHOD(void set_field(const Glib::ustring& fieldname, const Glib::ValueBase& value), gst_structure_set_value)
 
@@ -53,6 +68,8 @@
   _WRAP_METHOD(bool has_field(const Glib::ustring& fieldname) const, gst_structure_has_field)
   _WRAP_METHOD(bool has_field(const Glib::ustring& fieldname, GType type) const, gst_structure_has_field_typed)
 
+  /**
+   */
   bool get_boolean(const Glib::ustring& fieldname, Glib::ValueBase& value) const;
 
   bool get_int(const Glib::ustring& fieldname, Glib::ValueBase& value) const;

Modified: gstreamermm/trunk/tests/test-pipeline-add-element.cc
==============================================================================
--- gstreamermm/trunk/tests/test-pipeline-add-element.cc	(original)
+++ gstreamermm/trunk/tests/test-pipeline-add-element.cc	Fri Feb 15 01:06:40 2008
@@ -31,7 +31,7 @@
 
   pipeline->add(source);
 
-  Glib::RefPtr<Gst::Element> sourceCopy = pipeline->get_by_name("source");
+  Glib::RefPtr<Gst::Element> sourceCopy = pipeline->get_element("source");
 
   if (sourceCopy)
     std::cout << "Successfully added element '" << sourceCopy->get_name() <<



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