gnomemm r1875 - in gstreamermm/trunk: . build_shared gstreamer/src gstreamerbase/gstreamerbasemm gstreamerbase/src tools/extra_defs_gen



Author: jaalburqu
Date: Thu Dec 18 05:03:35 2008
New Revision: 1875
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1875&view=rev

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

	* gstreamer/src/Makefile_list_of_hg.am_fragment:
	* gstreamerbase/src/Makefile_list_of_hg.am_fragment:
	* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc:
	* build_shared/Makefile_gensrc.am_fragment: Modified plug-in
	generation so that the required parameter of the generation tool (the
	plug-in name) is passed using camel casing so that this can be used as
	the C++ class name.  This ensures that the C++ class name remains
	constant even if the plug-in's underlying C type changes (no more
	worries about ABI issues in this sense).  Modified build process so
	that the C++ class names are specified along with the .hg file.

	* gstreamerbase/gstreamerbasemm/Makefile.am: Removed unneeded
	libgstreamermm-0.10.la build dependency of the gstreamerbasemm
	library.

Modified:
   gstreamermm/trunk/ChangeLog
   gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
   gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am
   gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
   gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_gmmproc_file.cc

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	Thu Dec 18 05:03:35 2008
@@ -30,7 +30,7 @@
 files_all_ccg	= $(files_all_hg:%.hg=%.ccg)
 files_h		= $(files_all_hg:%.hg=$(gensrc_destdir)/%.h)
 files_stamp	= $(files_all_hg:%.hg=$(stamp_dir)/stamp-%)
-files_plugin_stamp = $(files_plugin_hg:%.hg=$(stamp_plugin_dir)/stamp-%-plugin)
+files_plugin_stamp = $(plugin_cpptype_names:%=$(stamp_plugin_dir)/stamp-%-plugin)
 destdir_files_stamp = $(files_patched_hg:%.hg=$(destdir_stamp_dir)/stamp-%)
 
 #Installed gmmproc stuff, from glibmm:
@@ -59,6 +59,7 @@
 run_generate_plugin_gmmproc_file = $(generate_plugin_gmmproc_file_path) $(generate_plugin_gmmproc_file_args)
 
 files_plugin_hg_with_path = $(patsubst %.hg,$(srcdir)/%.hg,$(files_plugin_hg))
+files_plugin_camel_hg_with_path = $(patsubst %,$(stamp_plugin_dir)/%.hg,$(plugin_cpptype_names))
 
 
 EXTRA_DIST	= Makefile_list_of_hg.am_fragment $(files_defs) \
@@ -66,40 +67,50 @@
 		  $(gensrc_destdir)/%.h.patch,$(files_patched_h))
 
 CLEANFILES = $(files_plugin_hg) $(files_plugin_hg:%.hg=%.ccg) \
+	$(files_plugin_camel_hg_with_path) \
+	$(files_plugin_camel_hg_with_path:.hg=.ccg) \
 	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc \
 	$(files_plugin_stamp)
 
 
-# This is to generate plugin .hg files.  A few variables are defined (in make
-# process), a temp file is used to generate preliminary .hg file which is then
-# run through m4 using the macros in tools/m4/ctocpp_base.m4 which then
-# produces the final .hg file.
-$(files_plugin_hg_with_path): $(generate_plugin_gmmproc_file_path) \
+# This is to generate plugin .hg files.  The generated .hg file s piped through
+# m4 using the macros in tools/m4/ctocpp_base.m4 which then produces the final
+# .hg file.  Finally, the camel hg file is linked to the final .hg file to
+# signal the successful generation of the .hg file.
+$(files_plugin_camel_hg_with_path): $(generate_plugin_gmmproc_file_path) \
 	$(tools_plugin_m4) $(files_defs)
+	$(eval hg_lowercase = $$(shell echo $$@ | tr '[:upper:]' '[:lower:]'))
 	$(run_generate_plugin_gmmproc_file) --hg \
-		$(subst .hg,,$(notdir $@)) | $(M4) -I $(tools_dir_m4) > $@
-
-# This is to generate plugin .ccg files.
-$(files_plugin_hg_with_path:.hg=.ccg): $(generate_plugin_gmmproc_file_path) \
-	$(files_defs)
+		$(notdir $(subst .hg,,$@)) | $(M4) -I $(tools_dir_m4) > \
+		$(srcdir)/$(notdir $(hg_lowercase))
+	ln -sf $(realpath $(srcdir))/$(notdir $(hg_lowercase)) $(builddir)/$@
+
+# This is to generate plugin .ccg files.  The .ccg file is generated and then
+# the camel ccg file is linked to the generated .ccg file to signal the
+# successful generation of the .hg file.
+$(files_plugin_camel_hg_with_path:.hg=.ccg): \
+	$(generate_plugin_gmmproc_file_path) $(tools_plugin_m4) $(files_defs)
+	$(eval ccg_lowercase = $$(shell echo $$@ | tr '[:upper:]' '[:lower:]'))
 	$(run_generate_plugin_gmmproc_file) --ccg \
-		$(notdir $(subst .ccg,,$@)) >  $@
+		$(notdir $(subst .ccg,,$@)) >  \
+		$(srcdir)/$(notdir $(ccg_lowercase))
+	ln -sf $(realpath $(srcdir))/$(notdir $(ccg_lowercase)) $(builddir)/$@
 
 $(stamp_dir)/stamp-%: %.hg %.ccg $(tools_m4) $(files_defs)
 	$(run_gmmproc) $(notdir $*) $(srcdir) $(gensrc_destdir)
 	@echo 'timestamp' > $@
 
-# This is to run generated plugin .hg and .ccg files through gmmproc.
-$(stamp_plugin_dir)/stamp-%-plugin: $(stamp_plugin_dir) $(srcdir)/%.hg \
-	$(srcdir)/%.ccg $(tools_m4) $(files_defs)
-	$(run_gmmproc) $(notdir $*) $(srcdir) $(gensrc_destdir)
+# This is to run the generated plug-in .hg and .ccg files through gmmproc
+# (they're generated if necessary by the .../%.hg and .../%.ccg dependencies.
+$(stamp_plugin_dir)/stamp-%-plugin: $(stamp_plugin_dir)/%.hg \
+	$(stamp_plugin_dir)/%.ccg \
+	$(generate_plugin_gmmproc_file_path) $(tools_m4) $(tools_plugin_m4) \
+	$(files_defs)
+	$(eval plugin_name_lowercase = \
+		$$(shell echo $$* | tr '[:upper:]' '[:lower:]'))
+	$(run_gmmproc) $(plugin_name_lowercase) $(srcdir) $(gensrc_destdir)
 	@echo 'timestamp' > $@
 
-# This is to create the plugin .stamps directory (if builddir is different than
-# srcdir)
-$(stamp_plugin_dir):
-	@(test -d $(stamp_plugin_dir) || mkdir $(stamp_plugin_dir))
-
 # This is to patch generated .h files in $(gensrc_destdir) (e.g. taglist.h).
 $(destdir_stamp_dir)/stamp-%: $(gensrc_destdir)/%.h
 	patch -Ns $(gensrc_destdir)/$*.h $(gensrc_destdir)/$*.h.patch || true
@@ -119,18 +130,21 @@
 	$(files_hg_with_path)
 	$(run_gen_gst_wrap_init) $(files_all_hg:%.hg=$(srcdir)/%.hg) >$@
 
+# This is to create the plugin .stamps directory (if builddir is different than
+# srcdir)
+$(stamp_plugin_dir):
+	@(test -d $(stamp_plugin_dir) || mkdir $(stamp_plugin_dir))
+
 create-stamp-dir: $(stamp_plugin_dir)
 	@(test -d $(stamp_dir) || mkdir $(stamp_dir))
 	@(test -d $(destdir_stamp_dir) || mkdir $(destdir_stamp_dir))
 
 if MAINTAINER_MODE
-all-local: create-stamp-dir $(files_stamp) $(files_plugin_hg_with_path) \
-	$(files_plugin_hg_with_path:.hg=.ccg) $(files_plugin_stamp) \
+all-local: create-stamp-dir $(files_stamp) $(files_plugin_stamp) \
 	$(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc \
 	$(destdir_files_stamp)
 else
-BUILT_SOURCES = $(files_plugin_hg_with_path) \
-		$(files_plugin_hg_with_path:.hg=.ccg) $(files_plugin_stamp) \
+BUILT_SOURCES = $(stamp_plugin_dir) $(files_plugin_stamp) \
 		$(gensrc_destdir)/wrap_init.cc
 endif
 

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	Thu Dec 18 05:03:35 2008
@@ -17,6 +17,16 @@
 
 files_general_deprecated_hg =
 
+# To add a plugin, add the C++ class name to plugin_cpptype_names (which must
+# be the plugin name as recognized by gst-inspect but in camel case -- as is
+# appropriate for a class name) and also the target .hg file name (the same
+# as the class name all in lowercase with an .hg extension) to files_plugin_hg
+# below:
+
+plugin_cpptype_names = CapsFilter FakeSrc FakeSink FdSink FdSrc \
+		  FileSrc FileSink Identity MultiQueue Queue \
+		  Tee TypeFind
+
 files_plugin_hg = capsfilter.hg fakesrc.hg fakesink.hg fdsink.hg fdsrc.hg \
 		  filesrc.hg filesink.hg identity.hg multiqueue.hg queue.hg \
 		  tee.hg typefind.hg

Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am	(original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemm/Makefile.am	Thu Dec 18 05:03:35 2008
@@ -28,4 +28,4 @@
 nodist_libgstreamerbasemm_0_10_la_SOURCES = $(files_plugin_built_cc) \
 					    wrap_init.cc
 libgstreamerbasemm_0_10_la_LDFLAGS = $(common_ldflags)
-libgstreamerbasemm_0_10_la_LIBADD  = $(GSTREAMERBASEMM_LIBS) $(top_builddir)/gstreamer/gstreamermm/libgstreamermm-0.10.la
+libgstreamerbasemm_0_10_la_LIBADD  = $(GSTREAMERBASEMM_LIBS)

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	Thu Dec 18 05:03:35 2008
@@ -12,6 +12,24 @@
 
 files_general_deprecated_hg =
 
+# To add a plugin, add the C++ class name to plugin_cpptype_names (which must
+# be the plugin name as recognized by gst-inspect but in camel case -- as is
+# appropriate for a class name) and also the target .hg file name (the same
+# as the class name all in lowercase with an .hg extension) to files_plugin_hg
+# below:
+
+plugin_cpptype_names = Adder AlsaMixer AlsaSink AlsaSrc \
+		  AudioConvert AudioResample AudioTestSrc \
+		  CdParanoiaSrc ClockOverlay DecodeBin \
+		  FfmpegColorSpace GioSink GioSrc GioStreamSink \
+		  GioStreamSrc \
+		  OggDemux OggMux PlayBin2 \
+		  TextOverlay \
+		  TextRender TheoraDec TheoraEnc \
+		  TimeOverlay VideoRate VideoScale \
+		  VideoTestSrc Volume VorbisDec VorbisEnc \
+		  VorbisParse VorbisTag XImageSink XvImageSink
+
 files_plugin_hg = adder.hg alsamixer.hg alsasink.hg alsasrc.hg \
 		  audioconvert.hg audioresample.hg audiotestsrc.hg \
 		  cdparanoiasrc.hg clockoverlay.hg decodebin.hg \
@@ -24,13 +42,13 @@
 		  videotestsrc.hg volume.hg vorbisdec.hg vorbisenc.hg \
 		  vorbisparse.hg vorbistag.hg ximagesink.hg xvimagesink.hg
 
-#TODO: gdpdepay and gdppay plug-ins cause several warnings when their wrap_new() methods are registered in GstBase::wrap_init() (from GstBase::init).
+# TODO: gdpdepay and gdppay plug-ins cause several warnings when their
+# wrap_new() methods are registered in GstBase::wrap_init() (from
+# GstBase::init).
 
-#TODO: Add decodebin2 to plugin list above.
-#TODO: Add multifdsink to plugin list above.
-#TODO: Add playbin to plugin list above.
-#TODO: Add tcpserversink to plugin list above.
-#TODO: Add theoraparse to plugin list above.
-#TODO: Add uridecodebin to plugin list above.
+# TODO: The following plug-ins can't be wrapped yet because their signals or
+# properties use the GValueArray type which might have to be wrapped in glibmm
+# first: DecodeBin2, MultiFdSink, PlayBin, TcpServerSink, TheoraParse,
+# UriDecodeBin.
 
 include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment

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	Thu Dec 18 05:03:35 2008
@@ -494,17 +494,22 @@
 
   GOptionEntry optionEntries[] =
   {
-    {"hg", 'h', 0, G_OPTION_ARG_NONE, &hgFile, "Generate a preliminary .hg file.  Run through m4 including macros in tools/m4 directory to get final .hg file", NULL },
+    {"hg", 'h', 0, G_OPTION_ARG_NONE, &hgFile, "Generate preliminary .hg file.", NULL },
     {"ccg", 'c', 0, G_OPTION_ARG_NONE, &ccgFile, "Generate .ccg file.", NULL },
-    {"suggest-hg", 's', 0, G_OPTION_ARG_NONE, &suggestHg, "If the plugin exists, output the suggested .hg filename.", NULL },
+    {"suggest-hg", 's', 0, G_OPTION_ARG_NONE, &suggestHg, "If the plugin exists, output .hg filename.", NULL },
     {"namespace", 'n', 0, G_OPTION_ARG_STRING, &nmspace, "The namespace of the plugin.", "namespace" },
-    {"main-defs", 'm', 0, G_OPTION_ARG_STRING, &defsFile, "The main .defs file without .defs extension (used in _DEFS() directive).", "def" },
-    {"target", 't', 0, G_OPTION_ARG_STRING, &target, "The target directory  of the generated .h and .cc files (used in _DEFS() directive).", "directory" },
+    {"main-defs", 'm', 0, G_OPTION_ARG_STRING, &defsFile, "The main defs file without .defs extension.", "def" },
+    {"target", 't', 0, G_OPTION_ARG_STRING, &target, "The .h and .cc target directory.", "directory" },
     { NULL }
   };
 
-  GOptionContext* gContext = g_option_context_new("<plugin name | typename>");
-  g_option_context_set_summary(gContext, "Outputs a GStreamer plugin's gmmproc files to be processed by gmmproc for\nwrapping in gstreamermm.  Use the same syntax for the plugin name as in\ngst-inspect.");
+  GOptionContext* gContext = g_option_context_new("<CppPluginClassName>");
+  g_option_context_set_summary(gContext, "Outputs a GStreamer plugin's "
+    "gmmproc files to be processed by gmmproc for\nwrapping in gstreamermm.  "
+    "Use the same syntax for CppPluginClassName as in\ngst-inspect except "
+    "that camel casing should be used because this will be the\nname of the "
+    "C++ class.  The .hg file is a preliminary .hg file that needs to\nbe run "
+    "through m4 including the ctocpp*.m4 files in the tools/m4 directory.");
 
   g_option_context_add_main_entries(gContext, optionEntries, NULL);
   g_option_context_add_group(gContext, gst_init_get_option_group());
@@ -536,15 +541,8 @@
     return -1;
   }
 
-  Glib::ustring gTypeName;
-
-  pluginName = argv[1];
-
-  if (pluginName.substr(0,3) == "Gst")
-  {
-    gTypeName = pluginName;
-    pluginName = pluginName.substr(3).lowercase();
-  }
+  cppTypeName = argv[1];
+  pluginName = cppTypeName.lowercase();
 
   GstElementFactory* factory = 0;
 
@@ -560,10 +558,6 @@
     factory = GST_ELEMENT_FACTORY(loaded_feature);
     type = gst_element_factory_get_element_type(factory);
   }
-  else
-  {
-    type = g_type_from_name(gTypeName.c_str());
-  }
 
   if (type)
   {
@@ -592,7 +586,6 @@
         g_type_name(g_type_parent(g_type_from_name(cParentTypeName.c_str())));
     }
 
-    cppTypeName = cTypeName.substr(3);
     cppParentTypeName = cParentTypeName.substr(3);
     castMacro = get_cast_macro(cTypeName);
 



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