gnomemm r1347 - in gstreamermm/trunk: . gstreamer/src tools/m4



Author: jaalburqu
Date: Wed Feb 13 01:54:08 2008
New Revision: 1347
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1347&view=rev

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

	* gstreamer/src/caps.hg: Added a couple of consts where appropriate
	* gstreamer/src/elementfactory.ccg:
	* gstreamer/src/elementfactory.hg: Wrapped ElementFactory
	* tools/m4/convert_gst.m4: Added conversions for ElementFactory;
	Reordered conversions

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/caps.hg
   gstreamermm/trunk/gstreamer/src/elementfactory.ccg
   gstreamermm/trunk/gstreamer/src/elementfactory.hg
   gstreamermm/trunk/tools/m4/convert_gst.m4

Modified: gstreamermm/trunk/gstreamer/src/caps.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/caps.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/caps.hg	Wed Feb 13 01:54:08 2008
@@ -73,14 +73,14 @@
   _WRAP_METHOD(Glib::RefPtr<Caps> the_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), gst_caps_save_thyself)
+  _WRAP_METHOD(xmlNodePtr save(const xmlNodePtr& parent) const, gst_caps_save_thyself)
   _WRAP_METHOD(static Glib::RefPtr<Caps> load(xmlNodePtr parent), gst_caps_load_thyself)
 
   _WRAP_METHOD(Glib::ustring to_string() const, gst_caps_to_string)
 
   _WRAP_METHOD(static Glib::RefPtr<Caps> from_string(const Glib::ustring& string), gst_caps_from_string)
 
-  _WRAP_METHOD(Glib::RefPtr<Caps> subtract(const Glib::RefPtr<Caps>& subtrahend_caps), gst_caps_subtract)
+  _WRAP_METHOD(Glib::RefPtr<Caps> subtract(const Glib::RefPtr<const Caps>& subtrahend_caps), gst_caps_subtract)
   _WRAP_METHOD(Glib::RefPtr<Caps> make_writable(), gst_caps_make_writable)
   _WRAP_METHOD(void truncate(), gst_caps_truncate)
   

Modified: gstreamermm/trunk/gstreamer/src/elementfactory.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/elementfactory.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/elementfactory.ccg	Wed Feb 13 01:54:08 2008
@@ -19,3 +19,8 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <gst/gstutils.h>
+#include <gstreamermm/caps.h>
+#include <gstreamermm/element.h>
+#include <gstreamermm/padtemplate.h>
+#include <gstreamermm/plugin.h>

Modified: gstreamermm/trunk/gstreamer/src/elementfactory.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/elementfactory.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/elementfactory.hg	Wed Feb 13 01:54:08 2008
@@ -31,6 +31,19 @@
 namespace Gst
 {
 
+struct ElementDetails
+{
+  Glib::ustring         long_name;
+  Glib::ustring         klass;
+  Glib::ustring         description;
+  Glib::ustring         author;
+};
+
+class Caps;
+class Element;
+class PadTemplate;
+class Plugin;
+
 /** ElementFactory â Create Elements from a factory.
  * ElementFactory is used to create instances of elements. A Elementfactory can
  * be added to a Plugin as it is also a PluginFeature.
@@ -42,14 +55,30 @@
  *
  * TODO: Add code example from GStreamer docs
  *
- * @newin2p16
  */
 class ElementFactory : public PluginFeature
 {
   _CLASS_GOBJECT(ElementFactory, GstElementFactory, GST_ELEMENT_FACTORY, PluginFeature, GstPluginFeature)
 
 public:
+  _WRAP_METHOD(static bool register_factory(const Glib::RefPtr<Plugin>& plugin, const Glib::ustring& name, guint rank, GType type), gst_element_register)
+  _WRAP_METHOD(static Glib::RefPtr<ElementFactory> find(const Glib::ustring& name), gst_element_factory_find)
+  _WRAP_METHOD(GType get_element_type() const, gst_element_factory_get_element_type)
+  _WRAP_METHOD(Glib::ustring get_long_name() const, gst_element_factory_get_longname)
+  _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(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)
+  _WRAP_METHOD(bool can_sink_caps(const Glib::RefPtr<const Caps>& caps) const, gst_element_factory_can_sink_caps)
+  _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)
 };
 
 } // namespace Gst

Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4	Wed Feb 13 01:54:08 2008
@@ -8,80 +8,102 @@
 _CONVERSION(`$1', `GST$1', ((GST$1)(__ARG3__)))
 ')dnl
 
+#Gst::Object
 _CONVERSION(`GstObject*',`Glib::RefPtr<Gst::Object>',`Glib::wrap($3)')
 _CONVERSION(`GstObject*',`Glib::RefPtr<const Gst::Object>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<Gst::Object>&',`GstObject*',`Glib::unwrap($3)')
 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3)')
 
-#_CONVERSION(`Glib::RefPtr<Object>&',`GstObject*', `Glib::unwrap($3)')
-_CONVERSION(`State&',`GstState*',`((GstState*) (&($3)))')
-_CONVERSION(`GstClockTime',`ClockTime',`$3')
-_CONVERSION(`ClockTime',`GstClockTime',`(GstClockTime ($3))')
-_CONVERSION(`guint64',`ClockTime',`(ClockTime ($3))')
+#Buffer
+_CONVERSION(`GstBuffer*',`Glib::RefPtr<Buffer>',`wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Buffer>&',`GstBuffer*', `Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<Buffer>&',`const GstBuffer*', `Glib::unwrap($3)')
+_CONVERSION(`Glib::RefPtr<Buffer>',`GstBuffer*', `Glib::unwrap($3)')
+
+#Bus
+_CONVERSION(`const Glib::RefPtr<Bus>&',`GstBus*', `Glib::unwrap($3)')
+_CONVERSION(`GstBus*',`Glib::RefPtr<Bus>',`Glib::wrap($3)')
+
+#Caps
+_CONVERSION(`GstCaps*',`Glib::RefPtr<Caps>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Caps>&',`GstCaps*', `Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<Caps>&',`const GstCaps*', `Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<const Caps>&',`const GstCaps*', `Glib::unwrap($3)')
+
+#Clock
+_CONVERSION(`GstClock*',`Glib::RefPtr<Clock>',`Glib::wrap($3)')
+_CONVERSION(`GstClock*',`Glib::RefPtr<const Clock>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Clock>&',`GstClock*', `Glib::unwrap($3)')
+_CONVERSION(`const Clock&',`GstClock*',`((GstClock*) (&($3)))')
+
+#ClockID
 _CONVERSION(`GstClockID',`Glib::RefPtr<ClockID>',`$3')
 _CONVERSION(`Glib::RefPtr<ClockID>',`GstClockID',`(GstClockID ($3))')
-_CONVERSION(`GstClock*',`Clock',`Glib::wrap($3)')
-_CONVERSION(`const Clock&',`GstClock*',`((GstClock*) (&($3)))')
-_CONVERSION(`const Format&',`GstFormat*',`((GstFormat*) (&($3)))')
-_CONVERSION(`const gint64&',`gint64*',`((gint64*) (&($3)))')
-_CONVERSION(`const std::string&',`const guchar*',`(const guchar*) ($3.c_str())')
+
+#Element
 _CONVERSION(`Glib::RefPtr<Element>',`GstElement*', `Glib::unwrap($3)')
-_CONVERSION(`GstPad*',`Glib::RefPtr<Pad>',`Glib::wrap($3)')
-_CONVERSION(`GstPad*',`Glib::RefPtr<const Pad>',`Glib::wrap($3)')
-_CONVERSION(`GstCaps*',`Glib::RefPtr<Caps>',`Glib::wrap($3)')
 _CONVERSION(`GstElement*',`Glib::RefPtr<Element>',`Glib::wrap($3)')
 _CONVERSION(`GstElement*',`Glib::RefPtr<const Element>',`Glib::wrap($3)')
-_CONVERSION(`GstClock*',`Glib::RefPtr<Clock>',`Glib::wrap($3)')
-_CONVERSION(`GstClock*',`Glib::RefPtr<const Clock>',`Glib::wrap($3)')
-#_CONVERSION(`Glib::RefPtr<Pad>',`GstPad*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Pad>&',`GstPad*', `Glib::unwrap($3)')
 _CONVERSION(`const Glib::RefPtr<Element>&',`GstElement*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Clock>&',`GstClock*', `Glib::unwrap($3)')
-_CONVERSION(`GstMessage*',`Glib::RefPtr<Message>',`Gst::Message::wrap($3)')
-_CONVERSION(`GstMessage*',`Glib::RefPtr<const Message>',`Gst::Message::wrap($3)')
-_CONVERSION(`const Glib::RefPtr<Message>&',`GstMessage*', `Glib::unwrap($3)')
+_CONVERSION(`State&',`GstState*',`((GstState*) (&($3)))')
+
+#ElementFactory
+_CONVERSION(`GstElementFactory*',`Glib::RefPtr<ElementFactory>',`Glib::wrap($3)')
+
+#Event
 _CONVERSION(`const Glib::RefPtr<Event>&',`GstEvent*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Query>&',`GstQuery*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Caps>&',`GstCaps*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Bus>&',`GstBus*', `Glib::unwrap($3)')
-_CONVERSION(`GstBuffer*',`Glib::RefPtr<Buffer>',`wrap($3)')
-_CONVERSION(`const Glib::RefPtr<Buffer>&',`GstBuffer*', `Glib::unwrap($3)')
-_CONVERSION(`const Glib::RefPtr<Buffer>&',`const GstBuffer*', `Glib::unwrap($3)')
-_CONVERSION(`Glib::RefPtr<Buffer>',`GstBuffer*', `Glib::unwrap($3)')
+
+#Index
 _CONVERSION(`GstIndexEntry*',`IndexEntry',`Glib::wrap($3)')
 _CONVERSION(`const IndexAssociation&',`const GstIndexAssociation*',`((GstIndexAssociation*)(&($3)))')
 
-_CONVERSION(`Structure&',`GstStructure*',`((GstStructure*)(&($3)))')
-_CONVERSION(`GstStructure*',`Structure*',`((Structure*) ($3))')
-_CONVERSION(`const Glib::RefPtr<Caps>&',`const GstCaps*', `Glib::unwrap($3)')
-_CONVERSION(`const xmlNodePtr&',`xmlNodePtr',`$3')
-_CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
-_CONVERSION(`GstBus*',`Glib::RefPtr<Bus>',`Glib::wrap($3)')
+#Message
+_CONVERSION(`GstMessage*',`Glib::RefPtr<Message>',`Gst::Message::wrap($3)')
+_CONVERSION(`GstMessage*',`Glib::RefPtr<const Message>',`Gst::Message::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Message>&',`GstMessage*', `Glib::unwrap($3)')
+
+#Pad
+_CONVERSION(`GstPad*',`Glib::RefPtr<Pad>',`Glib::wrap($3)')
+_CONVERSION(`GstPad*',`Glib::RefPtr<const Pad>',`Glib::wrap($3)')
+#_CONVERSION(`Glib::RefPtr<Pad>',`GstPad*', `Glib::unwrap($3)')
+_CONVERSION(`const Glib::RefPtr<Pad>&',`GstPad*', `Glib::unwrap($3)')
+
+#Plugin
+_CONVERSION(`const Glib::RefPtr<Plugin>&',`GstPlugin*',`Glib::unwrap($3)')
+_CONVERSION(`GstPlugin*',`Glib::RefPtr<Plugin>',`Glib::wrap($3)')
+_CONVERSION(`Glib::ListHandle< Glib::RefPtr<Plugin> >',`GList*',`($3).data()')
 
 #PluginFeature
 _CONVERSION(`const TypeNameData&',`GstTypeNameData*',`($2)(&($3))')
 _CONVERSION(`GstPluginFeature*',`Glib::RefPtr<PluginFeature>',`Glib::wrap($3)')
 _CONVERSION(`Glib::ListHandle< Glib::RefPtr<PluginFeature> >',`GList*',`($3).data()')
 
-#Plugin
-_CONVERSION(`GstPlugin*',`Glib::RefPtr<Plugin>',`Glib::wrap($3)')
-_CONVERSION(`Glib::ListHandle< Glib::RefPtr<Plugin> >',`GList*',`($3).data()')
+#Query
+_CONVERSION(`const Glib::RefPtr<Query>&',`GstQuery*', `Glib::unwrap($3)')
 
+#Structure
+_CONVERSION(`Structure&',`GstStructure*',`((GstStructure*)(&($3)))')
+_CONVERSION(`GstStructure*',`Structure*',`((Structure*) ($3))')
+
+#General Conversions
+_CONVERSION(`guint64',`ClockTime',`(ClockTime ($3))')
 _CONVERSION(`Format&',`GstFormat*',`(($2) &($3))')
-_CONVERSION(`const gint64&',`gint64',`$3')
 _CONVERSION(`gint64&',`gint64*',`&($3)')
-_CONVERSION(`const double&',`gdouble',`$3')
 _CONVERSION(`const guint&',`guint',`$3')
 _CONVERSION(`const guint32&',`guint32',`$3')
-
+_CONVERSION(`const std::string&',`const guchar*',`(const guchar*) ($3.c_str())')
+_CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
+_CONVERSION(`const xmlNodePtr&',`xmlNodePtr',`$3')
 _CONVERSION(`GQuark',`Glib::QueryQuark',`Glib::QueryQuark($3)')
 _CONVERSION(`const Glib::QueryQuark&',`GQuark',`$3')
+_CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3)')
 
 _CONV_ENUM(Gst,AssocFlags)
 _CONV_ENUM(Gst,BufferCopyFlags)
 _CONV_ENUM(Gst,BufferFlag)
 _CONV_ENUM(Gst,ClockEntryType)
 _CONV_ENUM(Gst,ClockReturn)
+_CONV_ENUM(Gst,ClockTime)
 _CONV_ENUM(Gst,EventType)
 _CONV_ENUM(Gst,Format)
 _CONV_ENUM(Gst,IndexCertainty)



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