gnomemm r1525 - in gstreamermm/trunk: . examples/ogg_player_gtkmm gstreamer/src tools/m4



Author: jaalburqu
Date: Fri May 23 00:36:32 2008
New Revision: 1525
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1525&view=rev

Log:
2008-05-22  Josà Alburquerque  <jaalburqu svn gnome org>

	* examples/ogg_player_gtkmm/player_window.cc:
	* gstreamer/src/clock.hg: Wrapped GST_SECOND
	* gstreamer/src/childproxy.hg:
	* gstreamer/src/registry.hg:
	* gstreamer/src/xml.hg: Put _WRAP_SIGNAL specific conversions in *.hg
	files
	* gstreamer/src/element.hg:
	* gstreamer/src/elementfactory.hg:
	* gstreamer/src/event.ccg:
	* gstreamer/src/filter.ccg:
	* gstreamer/src/format.hg:
	* gstreamer/src/pad.hg:
	* gstreamer/src/plugin.hg:
	* gstreamer/src/pluginfeature.hg:
	* gstreamer/src/query.hg:
	* gstreamer/src/urihandler.hg:
	* tools/m4/convert_gst.m4: Moved method specific conversions to *.hg
	files

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/examples/ogg_player_gtkmm/player_window.cc
   gstreamermm/trunk/gstreamer/src/childproxy.hg
   gstreamermm/trunk/gstreamer/src/clock.hg
   gstreamermm/trunk/gstreamer/src/element.hg
   gstreamermm/trunk/gstreamer/src/elementfactory.hg
   gstreamermm/trunk/gstreamer/src/event.ccg
   gstreamermm/trunk/gstreamer/src/filter.ccg
   gstreamermm/trunk/gstreamer/src/format.hg
   gstreamermm/trunk/gstreamer/src/pad.hg
   gstreamermm/trunk/gstreamer/src/plugin.hg
   gstreamermm/trunk/gstreamer/src/pluginfeature.hg
   gstreamermm/trunk/gstreamer/src/query.hg
   gstreamermm/trunk/gstreamer/src/registry.hg
   gstreamermm/trunk/gstreamer/src/urihandler.hg
   gstreamermm/trunk/gstreamer/src/xml.hg
   gstreamermm/trunk/tools/m4/convert_gst.m4

Modified: gstreamermm/trunk/examples/ogg_player_gtkmm/player_window.cc
==============================================================================
--- gstreamermm/trunk/examples/ogg_player_gtkmm/player_window.cc	(original)
+++ gstreamermm/trunk/examples/ogg_player_gtkmm/player_window.cc	Fri May 23 00:36:32 2008
@@ -232,8 +232,7 @@
 
 void PlayerWindow::on_button_forward()
 {
-  //TODO: Wrap GST_SECOND:
-  static const gint64 skip_amount = GST_SECOND * 3;
+  static const gint64 skip_amount = Gst::SECOND * 3;
 
   gint64 pos = 0;
   Gst::Format fmt = Gst::FORMAT_TIME;

Modified: gstreamermm/trunk/gstreamer/src/childproxy.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/childproxy.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/childproxy.hg	Fri May 23 00:36:32 2008
@@ -86,7 +86,7 @@
    */
   void child_removed(const Glib::RefPtr<Gst::Object>& child);
 
-#m4 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3, true)')
 
   /** Will be emitted after the object was added to the child_proxy.
    */

Modified: gstreamermm/trunk/gstreamer/src/clock.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/clock.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/clock.hg	Fri May 23 00:36:32 2008
@@ -29,10 +29,22 @@
 
 class Clock;
 
+/** A datatype to hold a time, measured in nanoseconds.
+ */
 typedef GstClockTime ClockTime;
+
+/** A datatype to hold a timedifference, measured in nanoseconds.
+ */
 typedef GstClockTimeDiff ClockTimeDiff;
+
+/** Constant to define an undefined clock time.
+ */
 const ClockTime CLOCK_TIME_NONE = GST_CLOCK_TIME_NONE;
 
+/** Constant that defines one GStreamer second.
+ */
+const ClockTime SECOND = GST_SECOND;
+
 _WRAP_ENUM(ClockEntryType, GstClockEntryType)
 _WRAP_ENUM(ClockReturn, GstClockReturn)
 _WRAP_ENUM(ClockFlags, GstClockFlags)

Modified: gstreamermm/trunk/gstreamer/src/element.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/element.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/element.hg	Fri May 23 00:36:32 2008
@@ -214,6 +214,7 @@
   _WRAP_METHOD(void post_message(MessageType message_type, const Glib::QueryQuark& domain, int code, const Glib::ustring& message, const Glib::ustring& debug, const Glib::ustring& filename, const Glib::ustring& function_name, int line_number), gst_element_message_full)
   _WRAP_METHOD(bool post_message(const Glib::RefPtr<Message>& message), gst_element_post_message)
 
+#m4 _CONVERSION(`const GstQueryType*',`Glib::ArrayHandle<QueryType>',`Glib::ArrayHandle<QueryType>((QueryType*)($3), Glib::OWNERSHIP_SHALLOW)')
   _WRAP_METHOD(Glib::ArrayHandle<QueryType> get_query_types() const, gst_element_get_query_types)
 
   _WRAP_METHOD(bool query(const Glib::RefPtr<Query>& query), gst_element_query)
@@ -315,13 +316,14 @@
   _WRAP_VFUNC(bool send_event(const Glib::RefPtr<Event>& event), "send_event")
 
   //TODO: This vfunc can't be wrapped without getting a compile error in the
-  //TODO: generated code.  The compile error comes about because the code
-  //TODO: assumes that Glib::ArrayHandle<> has a default constructor but it
-  //TODO: does not.  The way the code is generated will have to be tweaked.
-  //TODO:
-  //TODO: /** get the supported GstQueryType of this element
-  //TODO: */
-  //TODO: _WRAP_VFUNC(Glib::ArrayHandle<QueryType> get_query_types(), "get_query_types")
+  //generated code.  The compile error comes about because the code assumes
+  //that Glib::ArrayHandle<> has a default constructor but it does not.  The
+  //way the code is generated will have to be tweaked.
+  //
+//#m4 _CONVERSION(`Glib::ArrayHandle<QueryType>',`const GstQueryType*',`(GstQueryType*)(($3).data())')
+  // /** get the supported GstQueryType of this element
+  // */
+  // _WRAP_VFUNC(Glib::ArrayHandle<QueryType> get_query_types(), "get_query_types")
 
   /** perform a Gst::Query on the element 
    */

Modified: gstreamermm/trunk/gstreamer/src/elementfactory.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/elementfactory.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/elementfactory.hg	Fri May 23 00:36:32 2008
@@ -73,7 +73,7 @@
   _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)
 
-  //TODO: Is the conversion from gchar** to Glb::StringArrayHandle used here valid? Check ownership.
+#m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_SHALLOW)')
   _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)

Modified: gstreamermm/trunk/gstreamer/src/event.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/event.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/event.ccg	Fri May 23 00:36:32 2008
@@ -214,7 +214,7 @@
   gst_event_parse_tag(gobj(), &gst_taglist);
   TagList parsed_taglist(gst_taglist);
 
-  //TODO: What generates the swap() method?
+  //swap() method is generated by _CLASS_BOXEDTYPE class macro.
   taglist.swap(parsed_taglist);
 }
 

Modified: gstreamermm/trunk/gstreamer/src/filter.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/filter.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/filter.ccg	Fri May 23 00:36:32 2008
@@ -56,8 +56,6 @@
 Filter::run(const Glib::ListHandle<Glib::RefPtr<Glib::Object> >& list, const SlotFilter& slot, bool first)
 {
   SlotFilter* slot_copy = new SlotFilter(slot);
-  // TODO: we don't know the ownership of the items, I filed bug #518627 for GStreamer. Siavash
-  // TODO: For now, we'll use OWNERSHIP_SHALLOW (delete the list but not the items) until things clear up. Jose
   return Glib::ListHandle< Glib::RefPtr<Glib::Object> >(gst_filter_run(list.data(), &Filter_Filter_gstreamermm_callback, first, slot_copy), Glib::OWNERSHIP_SHALLOW);
 }
 

Modified: gstreamermm/trunk/gstreamer/src/format.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/format.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/format.hg	Fri May 23 00:36:32 2008
@@ -81,7 +81,7 @@
 Format get_format(const Glib::ustring& nick);
 
 //TODO: first arg is an array of Formats
-//TODO: bool formats_contain_format(const Format& formats, Format format);
+//bool formats_contain_format(const Format& formats, Format format);
 
 /** Get details about the given format.
  *

Modified: gstreamermm/trunk/gstreamer/src/pad.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pad.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/pad.hg	Fri May 23 00:36:32 2008
@@ -242,6 +242,7 @@
    _WRAP_METHOD(bool query_peer_duration(Format& format, gint64& duration) const, gst_pad_query_peer_duration)
    _WRAP_METHOD(bool query_peer_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const, gst_pad_query_peer_convert)
 
+#m4 _CONVERSION(`const GstQueryType*',`Glib::ArrayHandle<QueryType>',`Glib::ArrayHandle<QueryType>((QueryType*)($3), Glib::OWNERSHIP_SHALLOW)')
   _WRAP_METHOD(Glib::ArrayHandle<QueryType> get_query_types() const, gst_pad_get_query_types)
   _WRAP_METHOD(Glib::ArrayHandle<QueryType> get_query_types_default() const, gst_pad_get_query_types_default)
 

Modified: gstreamermm/trunk/gstreamer/src/plugin.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/plugin.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/plugin.hg	Fri May 23 00:36:32 2008
@@ -91,6 +91,9 @@
 
   _WRAP_METHOD(Glib::RefPtr<Plugin> load(), gst_plugin_load)
   _WRAP_METHOD(static Glib::RefPtr<Plugin> load_by_name(const Glib::ustring& name), gst_plugin_load_by_name)
+
+
+#m4 _CONVERSION(`Glib::ListHandle< Glib::RefPtr<Plugin> >',`GList*',`($3).data()')
   _WRAP_METHOD(static void free(Glib::ListHandle< Glib::RefPtr<Plugin> >), gst_plugin_list_free)
 
   _IGNORE(gst_plugin_name_filter)

Modified: gstreamermm/trunk/gstreamer/src/pluginfeature.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pluginfeature.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/pluginfeature.hg	Fri May 23 00:36:32 2008
@@ -49,7 +49,10 @@
   _WRAP_METHOD(guint get_rank() const, gst_plugin_feature_get_rank)
   _WRAP_METHOD(Glib::ustring get_name() const, gst_plugin_feature_get_name)
   _WRAP_METHOD(Glib::RefPtr<PluginFeature> load(), gst_plugin_feature_load)
+
+#m4 _CONVERSION(`Glib::ListHandle< Glib::RefPtr<PluginFeature> >',`GList*',`($3).data()')
   _WRAP_METHOD(static void free(Glib::ListHandle< Glib::RefPtr<PluginFeature> >), gst_plugin_feature_list_free)
+
   _WRAP_METHOD(bool check_version(guint min_major, guint min_minor, guint min_micro) const, gst_plugin_feature_check_version)
 
   _IGNORE(gst_plugin_feature_type_name_filter)

Modified: gstreamermm/trunk/gstreamer/src/query.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/query.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/query.hg	Fri May 23 00:36:32 2008
@@ -67,6 +67,8 @@
 
   _WRAP_METHOD(static QueryType register_query_type(const Glib::ustring& nick, const Glib::ustring& description), gst_query_type_register)
   _WRAP_METHOD(static QueryType get_query_type(const Glib::ustring& nick), gst_query_type_get_by_nick)
+
+#m4 _CONVERSION(`const Glib::ArrayHandle<QueryType>&',`GstQueryType*',`(GstQueryType*)(($3).data())')
   _WRAP_METHOD(static bool query_types_contains(const Glib::ArrayHandle<QueryType>& types, QueryType type), gst_query_types_contains)
 
   bool get_details(QueryType type, QueryTypeDefinition& def);

Modified: gstreamermm/trunk/gstreamer/src/registry.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/registry.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/registry.hg	Fri May 23 00:36:32 2008
@@ -99,8 +99,6 @@
   _WRAP_METHOD(Glib::ListHandle< Glib::RefPtr<PluginFeature> > get_feature_list(const Glib::ustring& name), gst_registry_get_feature_list_by_plugin)
 
 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::ustring >',`$2($3, Glib::OWNERSHIP_DEEP)')
-
-  //TODO: Make sure returned list is valid.  gst_registry_get_path_list actually returns a GList* of gchar*
   _WRAP_METHOD(Glib::ListHandle< Glib::ustring > get_path_list(), gst_registry_get_path_list)
 
 #m4 _CONVERSION(`GList*',`Glib::ListHandle< Glib::RefPtr<Plugin> >',`$2($3, Glib::OWNERSHIP_DEEP)')
@@ -175,11 +173,16 @@
   _WRAP_METHOD(void add_feature(const Glib::RefPtr<PluginFeature>& feature), gst_registry_add_feature)
   _WRAP_METHOD(static bool check_feature_version(const Glib::ustring& feature_name, guint min_major, guint min_minor, guint min_micro), gst_default_registry_check_feature_version)
 
+#m4 _CONVERSION(`GstPluginFeature*',`const Glib::RefPtr<PluginFeature>&',`Glib::wrap($3, true)')
+
   /** Signals that a feature has been added to the registry (possibly replacing
    * a previously-added one by the same name)
    */
   _WRAP_SIGNAL(void feature_added(const Glib::RefPtr<PluginFeature>& feature), "feature-added")
 
+
+#m4 _CONVERSION(`GstPlugin*',`const Glib::RefPtr<Plugin>&',`Glib::wrap($3, true)')
+
   /** Signals that a plugin has been added to the registry (possibly replacing
    * a previously-added one by the same name)
    */

Modified: gstreamermm/trunk/gstreamer/src/urihandler.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/urihandler.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/urihandler.hg	Fri May 23 00:36:32 2008
@@ -63,7 +63,10 @@
   _WRAP_METHOD(static Glib::RefPtr<Element> make_element_from_uri(const URIType type, const Glib::ustring& uri, const Glib::ustring& name), gst_element_make_from_uri)
 
   _WRAP_METHOD(guint get_uri_type(), gst_uri_handler_get_uri_type)
+
+#m4 _CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3, Glib::OWNERSHIP_SHALLOW)')
   _WRAP_METHOD(Glib::StringArrayHandle get_protocols(), gst_uri_handler_get_protocols)
+
   _WRAP_METHOD(Glib::ustring get_uri(), gst_uri_handler_get_uri)
   _WRAP_METHOD(bool set_uri(const Glib::ustring& uri), gst_uri_handler_set_uri)
   _WRAP_METHOD(void new_uri(const Glib::ustring& uri), gst_uri_handler_new_uri)

Modified: gstreamermm/trunk/gstreamer/src/xml.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/xml.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/xml.hg	Fri May 23 00:36:32 2008
@@ -63,7 +63,7 @@
 
   _IGNORE(gst_xml_parse_memory)
 
-#m4 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3)')
+#m4 _CONVERSION(`GstObject*',`const Glib::RefPtr<Gst::Object>&',`Glib::wrap($3, true)')
   _WRAP_SIGNAL(void object_loaded(const Glib::RefPtr<Gst::Object>& object, xmlNode* xml_node), "object-loaded")
 };
 

Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4	Fri May 23 00:36:32 2008
@@ -23,7 +23,6 @@
 _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)')
@@ -98,12 +97,10 @@
 #Plugin
 _CONVERSION(`const Glib::RefPtr<Plugin>&',`GstPlugin*',`Glib::unwrap($3)')
 _CONVERSION(`GstPlugin*',`Glib::RefPtr<Plugin>',`Glib::wrap($3)')
-_CONVERSION(`GstPlugin*',`const Glib::RefPtr<Plugin>&',`Glib::wrap($3)')
 
 #PluginFeature
 _CONVERSION(`GstPluginFeature*',`Glib::RefPtr<PluginFeature>',`Glib::wrap($3)')
 _CONVERSION(`const Glib::RefPtr<PluginFeature>&',`GstPluginFeature*',`Glib::unwrap($3)')
-_CONVERSION(`GstPluginFeature*',`const Glib::RefPtr<PluginFeature>&',`Glib::wrap($3)')
 
 #Query
 _CONVERSION(`const Glib::RefPtr<Query>&',`GstQuery*', `Gst::unwrap($3)')
@@ -152,14 +149,6 @@
 _CONVERSION(`const Glib::QueryQuark&',`GQuark',`$3')
 _CONVERSION(`Glib::StaticRecMutex&',`GStaticRecMutex*',`($3).gobj()')
 
-#List Conversions
-_CONVERSION(`Glib::ListHandle< Glib::RefPtr<Plugin> >',`GList*',`($3).data()')
-_CONVERSION(`Glib::ListHandle< Glib::RefPtr<PluginFeature> >',`GList*',`($3).data()')
-_CONVERSION(`gchar**',`Glib::StringArrayHandle',`Glib::StringArrayHandle($3)')
-_CONVERSION(`const GstQueryType*',`Glib::ArrayHandle<QueryType>',`Glib::ArrayHandle<QueryType>((QueryType*)($3), Glib::OWNERSHIP_SHALLOW)')
-_CONVERSION(`const Glib::ArrayHandle<QueryType>&',`GstQueryType*',`(GstQueryType*)(($3).data())')
-_CONVERSION(`Glib::ArrayHandle<QueryType>',`const GstQueryType*',`(GstQueryType*)(($3).data())')
-
 #String Conversions
 _CONVERSION(`const std::string&',`const guchar*',`(const guchar*) ($3.c_str())')
 _CONVERSION(`gchar*',`const Glib::ustring&',__GCHARP_TO_USTRING)



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