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



Author: jaalburqu
Date: Tue Feb 12 02:56:43 2008
New Revision: 1344
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1344&view=rev

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

	* gstreamer/src/enums.hg: Added PluginError
	* gstreamer/src/plugin.ccg:
	* gstreamer/src/plugin.hg: Wrapped Plugin
	* gstreamer/src/pluginfeature.hg: Added const for methods where
	appropriate
	* tools/m4/convert_gst.m4: Added Plugin conversions

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/gstreamer/src/enums.hg
   gstreamermm/trunk/gstreamer/src/plugin.ccg
   gstreamermm/trunk/gstreamer/src/plugin.hg
   gstreamermm/trunk/gstreamer/src/pluginfeature.hg
   gstreamermm/trunk/tools/m4/convert_gst.m4

Modified: gstreamermm/trunk/gstreamer/src/enums.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/enums.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/enums.hg	Tue Feb 12 02:56:43 2008
@@ -69,6 +69,7 @@
 _WRAP_ENUM(PadDirection, GstPadDirection)
 _WRAP_ENUM(PadLinkReturn, GstPadLinkReturn)
 _WRAP_ENUM(PadPresence, GstPadPresence)
+_WRAP_ENUM(PluginError, GstPluginError)
 _WRAP_ENUM(QueryType, GstQueryType)
 _WRAP_ENUM(Rank, GstRank)
 _WRAP_ENUM(SeekFlags, GstSeekFlags)

Modified: gstreamermm/trunk/gstreamer/src/plugin.ccg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/plugin.ccg	(original)
+++ gstreamermm/trunk/gstreamer/src/plugin.ccg	Tue Feb 12 02:56:43 2008
@@ -19,3 +19,34 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+static gboolean SignalProxy_Init_gstreamermm_callback(GstPlugin* plugin, void* data)
+{
+  Gst::Plugin::SlotInit* the_slot = static_cast<Gst::Plugin::SlotInit*>(data);
+
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  try
+  {
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+    return (*the_slot)(Glib::wrap(plugin, true));
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
+  }
+  catch(...)
+  {
+    Glib::exception_handlers_invoke();
+  }
+
+  return 0; // arbitrary value
+  #endif //GLIBMM_EXCEPTIONS_ENABLED
+}
+
+namespace Gst
+{
+
+/*
+bool Plugin::register_static(int major_version, int minor_version, const Glib::ustring& name, const Glib::ustring& description, SlotInit init_slot, const Glib::ustring& version, const Glib::ustring& license, const Glib::ustring& source, const Glib::ustring& package, const Glib::ustring& origin)
+{
+  return gst_plugin_register_static(major_version, minor_version, name.c_str(), description.c_str(), init_slot, version.c_str(), license.c_str(), source.c_str(), package.c_str(), origin.c_str());
+}
+*/
+
+} //namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/plugin.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/plugin.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/plugin.hg	Tue Feb 12 02:56:43 2008
@@ -28,6 +28,8 @@
 namespace Gst
 {
 
+//TODO: Deal with struct PluginDesc and SlotInit
+
 //TODO: Edit references below to use gstreamermm classes/methods
 
 /** Plugin â Container for features loaded from a shared object module.
@@ -50,15 +52,46 @@
  * statically link plugins to an app or even use GStreamer without a plugin
  * repository in which case gst_plugin_load() can be needed to bring the plugin
  * into memory.
- *
- * @newin2p16
  */
 class Plugin : public Object
 {
   _CLASS_GOBJECT(Plugin, GstPlugin, GST_PLUGIN, Object, GstObject)
 
 public:
+  /** For example,
+   * bool on_plugin_init(const Glib::RefPtr<Plugin>& plugin);
+   */
+  typedef sigc::slot< bool, const Glib::RefPtr<Plugin>& > SlotInit;
+
+  /** For example,
+   * bool on_plugin_filter(const Glib::RefPtr<Plugin>& plugin);
+   */
+
+  typedef sigc::slot< bool, const Glib::RefPtr<Plugin>& > SlotFilter;
+
+  _WRAP_METHOD(static Glib::QueryQuark error_quark(), gst_plugin_error_quark)
+  _WRAP_METHOD(Glib::ustring get_name() const, gst_plugin_get_name)
+  _WRAP_METHOD(Glib::ustring get_description() const, gst_plugin_get_description)
+  _WRAP_METHOD(Glib::ustring get_filename() const, gst_plugin_get_filename)
+  _WRAP_METHOD(Glib::ustring get_license() const, gst_plugin_get_license)
+  _WRAP_METHOD(Glib::ustring get_package() const, gst_plugin_get_package)
+  _WRAP_METHOD(Glib::ustring get_origin() const, gst_plugin_get_origin)
+  _WRAP_METHOD(Glib::ustring get_source() const, gst_plugin_get_source)
+  _WRAP_METHOD(Glib::ustring get_version() const, gst_plugin_get_version)
+
+  _WRAP_METHOD(GModule* get_module() const, gst_plugin_get_module)
+
+  _WRAP_METHOD(bool 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)
+
+  _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)
+  _WRAP_METHOD(static void free(Glib::ListHandle< Glib::RefPtr<Plugin> >), gst_plugin_list_free)
 
+  //TODO: Does this need to be wrapped?  How do I handle the slot since the GstPluginInitFunc type doesn't have a "gpointer* data" parameter?
+  //static bool register_static(int major_version, int minor_version, const Glib::ustring& name, const Glib::ustring& description, SlotInit init_slot, const Glib::ustring& version, const Glib::ustring& license, const Glib::ustring& source, const Glib::ustring& package, const Glib::ustring& origin);
 };
 
 } // namespace Gst

Modified: gstreamermm/trunk/gstreamer/src/pluginfeature.hg
==============================================================================
--- gstreamermm/trunk/gstreamer/src/pluginfeature.hg	(original)
+++ gstreamermm/trunk/gstreamer/src/pluginfeature.hg	Tue Feb 12 02:56:43 2008
@@ -46,14 +46,14 @@
    */
   typedef sigc::slot< bool, const Glib::RefPtr<PluginFeature>& > SlotFeatureFilter;
 
-  _WRAP_METHOD(bool type_name_filter(const TypeNameData& data), gst_plugin_feature_type_name_filter)
+  _WRAP_METHOD(bool type_name_filter(const TypeNameData& data) const, gst_plugin_feature_type_name_filter)
   _WRAP_METHOD(void set_rank(guint rank), gst_plugin_feature_set_rank)
   _WRAP_METHOD(void set_name(const Glib::ustring& name), gst_plugin_feature_set_name)
-  _WRAP_METHOD(guint get_rank(), gst_plugin_feature_get_rank)
-  _WRAP_METHOD(Glib::ustring get_name(), gst_plugin_feature_get_name)
+  _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)
   _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), gst_plugin_feature_check_version)
+  _WRAP_METHOD(bool check_version(guint min_major, guint min_minor, guint min_micro) const, gst_plugin_feature_check_version)
 };
 
 } // 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	Tue Feb 12 02:56:43 2008
@@ -58,10 +58,15 @@
 _CONVERSION(`const va_list&',`va_list',`const_cast<va_list&>($3)')
 _CONVERSION(`GstBus*',`Glib::RefPtr<Bus>',`Glib::wrap($3)')
 
+#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()')
+
 _CONVERSION(`Format&',`GstFormat*',`(($2) &($3))')
 _CONVERSION(`const gint64&',`gint64',`$3')
 _CONVERSION(`gint64&',`gint64*',`&($3)')



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