gnomemm r1811 - in gstreamermm/trunk: . build_shared gstreamer/src gstreamerbase/src tests tools/extra_defs_gen tools/m4



Author: jaalburqu
Date: Tue Nov 25 23:11:25 2008
New Revision: 1811
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1811&view=rev

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

	* build_shared/Makefile_gensrc.am_fragment: Use BUILT_SOURCES only
	when not in maintainer mode (e.g. when running a distcheck) because
	it is only needed when tarball is distributed and plug-ins need to be
	generated on build machine.

	* tools/m4/convert.m4:
	* tools/m4/ctocpp_base.m4: Added _CPPTYPE() and _CTOCPP() macros for
	defining ways to translate from a C type to a C++ type (both when
	used as a parameter and as a return type) and then translating from a
	C type to a C++ type.  If successful, the macros will include ways of
	automatically including the correct header file if the include header
	file is specified in the translation specification.

	* tools/extra_defs_gen/Makefile.am:
	* tools/extra_defs_gen/get_plugin_defs.cc:
	* tools/extra_defs_gen/get_plugin_defs.h:
	* gstreamer/src/generate-extra-defs.sh: Renamed generate_extra_defs to
	generate_defs_gst (to complement generate_defs_gstbase).  Factored out
	get_plugin_defs() so that generate_defs_gstbase can also generate
	plug-in defs for gstreamerbase branch.
	* tools/extra_defs_gen/generate_defs_gst.cc: Added `filesrc' to the
	list of plug-ins to generate defs for.
	* tools/extra_defs_gen/generate_defs_gstbase.cc:  Added `audioconvert'
	and `oggmux' to the list of plug-ins to generate defs for.
	* gstreamer/src/gst_signals.defs:
	* gstreamerbase/src/gstbase_signals.defs: Regenerated to include
	additional plug-in defs.

	* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: Modified
	plug-in generation tool to wrap plug-in properties using the _CTOCPP
	marco described above (property iteration was adapted from glibmm's
	extra defs generation utility).  Made the GType of the plug-in global
	for easy access.

	* gstreamer/src/Makefile_list_of_hg.am_fragment:
	* tests/test-plugin-gen.cc:
	* gstreamerbase/src/Makefile_list_of_hg.am_fragment: Used Gst::FileSrc
	instead of Gst::FakeSrc in the gstreamer branch and GstBase::OggDemux
	instead of GstBase::AudioConvert in the gstreamerbase branch to test
	plug-in generation because property generation does not quite work
	with the `fakesrc' and `audioconvert' plug-ins just yet because
	special care must be used in dealing with enums and boxed types.

Added:
   gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.cc
   gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.h
   gstreamermm/trunk/tools/m4/ctocpp_base.m4
Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
   gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamer/src/generate-extra-defs.sh
   gstreamermm/trunk/gstreamer/src/gst_signals.defs
   gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs
   gstreamermm/trunk/tests/test-plugin-gen.cc
   gstreamermm/trunk/tools/extra_defs_gen/Makefile.am
   gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gst.cc
   gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gstbase.cc
   gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
   gstreamermm/trunk/tools/m4/convert.m4

Modified: gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment	(original)
+++ gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment	Tue Nov 25 23:11:25 2008
@@ -61,9 +61,6 @@
 EXTRA_DIST	= Makefile_list_of_hg.am_fragment \
 		  $(files_defs) $(files_all_hg) $(files_all_ccg)
 
-BUILT_SOURCES = $(foreach plugin,$(files_plugin_hg:.hg=),\
-		$(stamp_plugin_dir)/stamp-$(plugin)-plugin)
-
 CLEANFILES = $(files_plugin_hg) $(files_plugin_hg:%.hg=%.ccg) \
 	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc \
 	$(foreach plugin,$(files_plugin_hg:.hg=), \
@@ -110,6 +107,9 @@
 if MAINTAINER_MODE
 all-local: create-stamp-dir $(files_stamp) $(files_plugin_stamp) \
 	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc
+else
+BUILT_SOURCES = $(foreach plugin,$(files_plugin_hg:.hg=),\
+		$(stamp_plugin_dir)/stamp-$(plugin)-plugin)
 endif
 
 maintainer-clean-local:

Modified: gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	(original)
+++ gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment	Tue Nov 25 23:11:25 2008
@@ -17,6 +17,6 @@
 
 files_general_deprecated_hg =
 
-files_plugin_hg = fakesrc.hg dvbsrc.hg fakesink.hg
+files_plugin_hg = filesrc.hg
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment

Modified: gstreamermm/trunk/gstreamer/src/generate-extra-defs.sh
==============================================================================
--- gstreamermm/trunk/gstreamer/src/generate-extra-defs.sh	(original)
+++ gstreamermm/trunk/gstreamer/src/generate-extra-defs.sh	Tue Nov 25 23:11:25 2008
@@ -5,7 +5,7 @@
 
 DIR=`dirname "$0"`
 
-"$DIR"/../../tools/extra_defs_gen/generate_extra_defs > "$DIR/gst_signals.defs"
+"$DIR"/../../tools/extra_defs_gen/generate_defs_gst > "$DIR/gst_signals.defs"
 
 #Patch generated file.
 (cd "$DIR" && patch -p0 < gst_signals.defs.patch)

Modified: gstreamermm/trunk/gstreamer/src/gst_signals.defs
==============================================================================
--- gstreamermm/trunk/gstreamer/src/gst_signals.defs	(original)
+++ gstreamermm/trunk/gstreamer/src/gst_signals.defs	Tue Nov 25 23:11:25 2008
@@ -49,6 +49,12 @@
   )
 )
 
+(define-signal do-latency
+  (of-object "GstBin")
+  (return-type "gboolean")
+  (when "last")
+)
+
 (define-property name
   (of-object "GstBin")
   (prop-type "GParamString")
@@ -1112,3 +1118,104 @@
   (construct-only #f)
 )
 
+;; From GstFileSrc
+
+(define-property name
+  (of-object "GstFileSrc")
+  (prop-type "GParamString")
+  (docs "The name of the object")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property blocksize
+  (of-object "GstFileSrc")
+  (prop-type "GParamULong")
+  (docs "Size in bytes to read per buffer (-1 = default)")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property num-buffers
+  (of-object "GstFileSrc")
+  (prop-type "GParamInt")
+  (docs "Number of buffers to output before sending EOS (-1 = unlimited)")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property typefind
+  (of-object "GstFileSrc")
+  (prop-type "GParamBoolean")
+  (docs "Run typefind before negotiating")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property do-timestamp
+  (of-object "GstFileSrc")
+  (prop-type "GParamBoolean")
+  (docs "Apply current stream time to buffers")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property location
+  (of-object "GstFileSrc")
+  (prop-type "GParamString")
+  (docs "Location of the file to read")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property fd
+  (of-object "GstFileSrc")
+  (prop-type "GParamInt")
+  (docs "File-descriptor for the file being mmap()d")
+  (readable #t)
+  (writable #f)
+  (construct-only #f)
+)
+
+(define-property mmapsize
+  (of-object "GstFileSrc")
+  (prop-type "GParamULong")
+  (docs "Size in bytes of mmap()d regions")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property sequential
+  (of-object "GstFileSrc")
+  (prop-type "GParamBoolean")
+  (docs "Whether to use madvise to hint to the kernel that access to mmap pages will be sequential")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property touch
+  (of-object "GstFileSrc")
+  (prop-type "GParamBoolean")
+  (docs "Touch mmapped data regions to force them to be read from disk")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property use-mmap
+  (of-object "GstFileSrc")
+  (prop-type "GParamBoolean")
+  (docs "Whether to use mmap() instead of read()")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+

Modified: gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment	(original)
+++ gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment	Tue Nov 25 23:11:25 2008
@@ -8,6 +8,6 @@
 
 files_general_deprecated_hg =
 
-files_plugin_hg = audioconvert.hg
+files_plugin_hg = oggmux.hg
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment

Modified: gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs	(original)
+++ gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs	Tue Nov 25 23:11:25 2008
@@ -23,3 +23,70 @@
 
 ;; From GstXOverlay
 
+;; From GstAudioConvert
+
+(define-property name
+  (of-object "GstAudioConvert")
+  (prop-type "GParamString")
+  (docs "The name of the object")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property qos
+  (of-object "GstAudioConvert")
+  (prop-type "GParamBoolean")
+  (docs "Handle Quality-of-Service events")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property dithering
+  (of-object "GstAudioConvert")
+  (prop-type "GParamEnum")
+  (docs "Selects between different dithering methods.")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property noise-shaping
+  (of-object "GstAudioConvert")
+  (prop-type "GParamEnum")
+  (docs "Selects between different noise shaping methods.")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+;; From GstOggMux
+
+(define-property name
+  (of-object "GstOggMux")
+  (prop-type "GParamString")
+  (docs "The name of the object")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property max-delay
+  (of-object "GstOggMux")
+  (prop-type "GParamUInt64")
+  (docs "Maximum delay in multiplexing streams")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+
+(define-property max-page-delay
+  (of-object "GstOggMux")
+  (prop-type "GParamUInt64")
+  (docs "Maximum delay for sending out a page")
+  (readable #t)
+  (writable #t)
+  (construct-only #f)
+)
+

Modified: gstreamermm/trunk/tests/test-plugin-gen.cc
==============================================================================
--- gstreamermm/trunk/tests/test-plugin-gen.cc	(original)
+++ gstreamermm/trunk/tests/test-plugin-gen.cc	Tue Nov 25 23:11:25 2008
@@ -1,23 +1,26 @@
 #include <gstreamermm.h>
-#include <gstreamermm/fakesrc.h>
+#include <gstreamermm/filesrc.h>
 #include <iostream>
 
 int main(int argc, char* argv[])
 {
   Gst::init(argc, argv);
 
-  Glib::RefPtr<Gst::FakeSrc> fakesrc = Gst::FakeSrc::create();
+  Glib::RefPtr<Gst::Element> element =
+          Gst::ElementFactory::create_element("filesrc");
 
-  if (fakesrc)
-    std::cout << "fakesrc is valid." << std::endl;
+  Glib::RefPtr<Gst::FileSrc> filesrc = Gst::FileSrc::create();
+
+  if (filesrc)
+    std::cout << "filesrc is valid." << std::endl;
   else
-    std::cout << "fakesrc is invalid." << std::endl;
+    std::cout << "filesrc is invalid." << std::endl;
 
-  int sizemax = 0;
-  GstFakeSrc* obj = fakesrc->gobj();
-  g_object_get(obj, "sizemax", &sizemax, NULL);
+  gulong mmapsize = 0;
+  GstFileSrc* obj = filesrc->gobj();
+  g_object_get(obj, "mmapsize", &mmapsize, NULL);
 
-  std::cout << "sizemax = "  << sizemax << std::endl;
+  std::cout << "mmapsize = "  << mmapsize << std::endl;
 
   return 0;
 }

Modified: gstreamermm/trunk/tools/extra_defs_gen/Makefile.am
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/Makefile.am	(original)
+++ gstreamermm/trunk/tools/extra_defs_gen/Makefile.am	Tue Nov 25 23:11:25 2008
@@ -4,10 +4,10 @@
 INCLUDES = $(GSTREAMERMM_CFLAGS) $(GSTREAMERBASEMM_CFLAGS)
 LIBS = $(GSTREAMERMM_LIBS) $(GSTREAMERBASEMM_LIBS) -lglibmm_generate_extra_defs-2.4
 
-noinst_PROGRAMS = generate_extra_defs generate_defs_gstbase \
+noinst_PROGRAMS = generate_defs_gst generate_defs_gstbase \
 		  generate_plugin_gmmproc_file
 
-generate_extra_defs_SOURCES = generate_defs_gst.cc
-generate_defs_gstbase_SOURCES = generate_defs_gstbase.cc
+generate_defs_gst_SOURCES = generate_defs_gst.cc get_plugin_defs.cc
+generate_defs_gstbase_SOURCES = generate_defs_gstbase.cc get_plugin_defs.cc
 
 generate_plugin_gmmproc_file_SOURCES = generate_plugin_gmmproc_file.cc

Modified: gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gst.cc
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gst.cc	(original)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gst.cc	Tue Nov 25 23:11:25 2008
@@ -18,6 +18,7 @@
  */
 
 #include "glibmm_generate_extra_defs/generate_extra_defs.h"
+#include "get_plugin_defs.h"
 
 #include <gst/gst.h>
 #include <gst/base/gstbasesrc.h>
@@ -28,29 +29,6 @@
 #include <gst/base/gstcollectpads.h>
 #include <gst/base/gstdataqueue.h>
 
-std::string get_plugin_defs(const std::string& pluginName)
-{
-  GType type = 0;
-  GstElementFactory* factory = 0;
-  std::string result;
-
-  factory = gst_element_factory_find(pluginName.c_str());
-
-  // Make sure that the feature is actually loaded:
-  if (factory)
-  {
-    GstPluginFeature* loaded_feature =
-            gst_plugin_feature_load(GST_PLUGIN_FEATURE(factory));
-
-    g_object_unref(factory);
-    factory = GST_ELEMENT_FACTORY(loaded_feature);
-    type = gst_element_factory_get_element_type(factory);
-    result = get_defs(type);
-    g_object_unref(factory);
-  }
-  return result;
-}
-
 int main (int argc, char *argv[])
 {
   gst_init (&argc, &argv);
@@ -103,6 +81,7 @@
 
   // GStreamer core plugin types:
             << get_plugin_defs("fakesrc")
+            << get_plugin_defs("filesrc")
             ;
   return 0;
 }

Modified: gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gstbase.cc
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gstbase.cc	(original)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_defs_gstbase.cc	Tue Nov 25 23:11:25 2008
@@ -18,6 +18,7 @@
  */
 
 #include "glibmm_generate_extra_defs/generate_extra_defs.h"
+#include "get_plugin_defs.h"
 
 #include <gst/gst.h>
 #include <gst/interfaces/colorbalance.h>
@@ -27,9 +28,16 @@
 int main (int argc, char *argv[])
 {
   gst_init (&argc, &argv);
+
+  // gst-plugins-base (GStreamer base) types
   std::cout << get_defs(GST_TYPE_COLOR_BALANCE)
             << get_defs(GST_TYPE_COLOR_BALANCE_CHANNEL)
-            << get_defs(GST_TYPE_X_OVERLAY);
+            << get_defs(GST_TYPE_X_OVERLAY)
+
+  // gst-plugins-base (GStreamer base) plugin types
+            << get_plugin_defs("audioconvert")
+            << get_plugin_defs("oggmux")
+            ;
 
   return 0;
 }

Modified: gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc
==============================================================================
--- gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc	(original)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc	Tue Nov 25 23:11:25 2008
@@ -37,6 +37,8 @@
 static Glib::ustring includeRoot;
 static Glib::ustring parentNameSpace;
 
+GType type = 0;
+
 Glib::ustring get_cast_macro(const Glib::ustring& typeName)
 {
   Glib::ustring result;
@@ -58,8 +60,59 @@
   return result;
 }
 
+void get_property_wrap_statements(Glib::ustring& wrapStatements,
+  Glib::ustring& enumDefinitions)
+{
+  std::string strResult;
+  std::string strObjectName = g_type_name(type);
+
+  //Get the list of properties:
+  GParamSpec** ppParamSpec = 0;
+  guint iCount = 0;
+  if(G_TYPE_IS_OBJECT(type))
+  {
+    GObjectClass* pGClass = G_OBJECT_CLASS(g_type_class_ref(type));
+    ppParamSpec = g_object_class_list_properties (pGClass, &iCount);
+    g_type_class_unref(pGClass);
+  }
+  else if (G_TYPE_IS_INTERFACE(type))
+  {
+    gpointer pGInterface = g_type_default_interface_ref(type);
+    if(pGInterface) //We check because this fails for G_TYPE_VOLUME, for some reason.
+    {
+      ppParamSpec = g_object_interface_list_properties(pGInterface, &iCount);
+      g_type_default_interface_unref(pGInterface);
+    }
+  }
+
+  //This extra check avoids an occasional crash, for instance for GVolume
+  if(!ppParamSpec)
+    iCount = 0;
+
+  for(guint i = 0; i < iCount; i++)
+  {
+    GParamSpec* pParamSpec = ppParamSpec[i];
+    if(pParamSpec)
+    {
+      //Name and type:
+      Glib::ustring propertyName = g_param_spec_get_name(pParamSpec);
+      Glib::ustring  propertyCType = G_PARAM_SPEC_TYPE_NAME(pParamSpec);
+
+      wrapStatements += "  _WRAP_PROPERTY(\"" + propertyName + "\", " +
+        "_CTOCPP(" + propertyCType + ") )\n";
+    }
+  }
+
+  g_free(ppParamSpec);
+}
+
 void generate_hg_file()
 {
+  Glib::ustring propertyWrapStatements;
+  Glib::ustring enumDefinitions;
+
+  get_property_wrap_statements(propertyWrapStatements, enumDefinitions);
+
   std::cout << "#include <" << includeRoot << "/" <<
     cppParentTypeName.lowercase() << ".h>" << std::endl << std::endl;
 
@@ -92,7 +145,11 @@
 
   std::cout << "/** Creates a new " << pluginName << " plugin with the given name." << std::endl;
   std::cout << " */" << std::endl;
-  std::cout << "  _WRAP_CREATE(const Glib::ustring& name)" << std::endl;
+  std::cout << "  _WRAP_CREATE(const Glib::ustring& name)" << std::endl <<
+    std::endl;
+
+  std::cout << propertyWrapStatements;
+
   std::cout << "};" << std::endl;
 
   std::cout << std::endl << "} //namespace " << nmspace << std::endl;
@@ -199,7 +256,6 @@
     return -1;
   }
 
-  GType type = 0;
   GstElementFactory* factory = 0;
 
   factory = gst_element_factory_find(argv[1]);

Added: gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.cc
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.cc	Tue Nov 25 23:11:25 2008
@@ -0,0 +1,46 @@
+/* get_plugin_defs.cc
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include "glibmm_generate_extra_defs/generate_extra_defs.h"
+#include "get_plugin_defs.h"
+
+#include <gst/gst.h>
+
+std::string get_plugin_defs(const std::string& pluginName)
+{
+  GType type = 0;
+  GstElementFactory* factory = 0;
+  std::string result;
+
+  factory = gst_element_factory_find(pluginName.c_str());
+
+  // Make sure that the feature is actually loaded:
+  if (factory)
+  {
+    GstPluginFeature* loaded_feature =
+            gst_plugin_feature_load(GST_PLUGIN_FEATURE(factory));
+
+    g_object_unref(factory);
+    factory = GST_ELEMENT_FACTORY(loaded_feature);
+    type = gst_element_factory_get_element_type(factory);
+    result = get_defs(type);
+    g_object_unref(factory);
+  }
+  return result;
+}

Added: gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.h
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/extra_defs_gen/get_plugin_defs.h	Tue Nov 25 23:11:25 2008
@@ -0,0 +1,22 @@
+/* get_plugin_defs.h
+ *
+ * Copyright (C) 2008 The Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <string>
+
+std::string get_plugin_defs(const std::string& pluginName);

Modified: gstreamermm/trunk/tools/m4/convert.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert.m4	(original)
+++ gstreamermm/trunk/tools/m4/convert.m4	Tue Nov 25 23:11:25 2008
@@ -1,5 +1,6 @@
 include(convert_base.m4)
 include(convert_glib.m4)
+include(ctocpp_base.m4)
 include(convert_gst.m4)
 include(convert_gstbase.m4)
 include(class_gstminiobject.m4)

Added: gstreamermm/trunk/tools/m4/ctocpp_base.m4
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/m4/ctocpp_base.m4	Tue Nov 25 23:11:25 2008
@@ -0,0 +1,36 @@
+dnl
+dnl Macros to convert from C to C++ types
+dnl
+
+m4_define(`_CPPTYPE',`dnl
+m4_define(`TFP'__HASH(`$1'),`$2')'`dnl
+m4_ifelse(`$3',,`dnl
+m4_define(`TFR'__HASH(`$1'),`$2')',`dnl
+m4_define(`TFR'__HASH(`$1'),`$3')dnl
+')dnl
+m4_ifelse(`$4',,,`m4_define(`IF'__HASH(`$1'),`$4')')dnl
+')dnl
+
+m4_define(`_CTOCPP',`dnl
+m4_ifelse(`$2',,`dnl
+m4_ifdef(`TFP'__HASH(`$1'), `m4_indir(`TFP'__HASH(`$1'))',`dnl
+m4_errprint(`No C++ parameter conversion from $1 defined.
+')`'dnl
+m4_m4exit(1)`'dnl
+')',`dnl
+m4_ifdef(`TFR'__HASH(`$1'), `m4_indir(`TFR'__HASH(`$1'))',`dnl
+m4_errprint(`No C++ return conversion from $1 defined.
+')`'dnl
+m4exit(1)`'dnl
+')`'dnl
+')`'dnl
+')`'dnl
+
+_CPPTYPE(`GParamBoolean',`bool')
+_CPPTYPE(`GParamInt',`int')
+_CPPTYPE(`GParamULong',`unsigned long')
+_CPPTYPE(`GParamUInt64',`guint64',,`<glib.h>')
+_CPPTYPE(`GParamString',`Glib::ustring')
+
+dnl _CPPTYPE(`GstElement*',`const Glib::RefPtr<Gst::Element>&',`Glib::RefPtr<Gst::Element>',`<gstreamermm/element.h>')
+dnl _CPPTYPE(`GstElementFactory*',`const Glib::RefPtr<Gst::ElementFactory>&',`Glib::RefPtr<Gst::ElementFactory>',`<gstreamermm/elementfactory.h>')



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