gnomemm r1782 - in gstreamermm/trunk: . build_shared gstreamer/src gstreamerbase/src tools/extra_defs_gen
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1782 - in gstreamermm/trunk: . build_shared gstreamer/src gstreamerbase/src tools/extra_defs_gen
- Date: Tue, 11 Nov 2008 19:38:24 +0000 (UTC)
Author: jaalburqu
Date: Tue Nov 11 19:38:24 2008
New Revision: 1782
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1782&view=rev
Log:
2008-11-11 Josà Alburquerque <jaalburqu svn gnome org>
* tools/extra_defs_gen/Makefile.am:
* tools/extra_defs_gen/generate_plugin_hg_file.cc: Added first cut at
source generation tool that generates *.hg files from a given plug-in
name (same syntax as in gst-inspect) so that additional GStreamer
plug-ins like GstFileSrc (see TODO in ogg player example) can have
corresponding C++ classes.
* tools/extra_defs_gen/generate_defs_gst.cc:
* tools/extra_defs_gen/generate_defs_gstbase.cc: Removed unused
includes.
* build_shared/Makefile_build.am_fragment:
* build_shared/Makefile_build_gensrc.am_fragment:
* build_shared/Makefile_gensrc.am_fragment:
* gstreamer/src/Makefile.am:
* gstreamer/src/Makefile_list_of_hg.am_fragment:
* gstreamerbase/src/Makefile.am:
* gstreamerbase/src/Makefile_list_of_hg.am_fragment: Modified build
process to be sensitive to generating source code for additional
GStreamer plug-ins that are not public. All that is need is to
include the *.hg name (e.g. filesrc.hg) in the `files_plugin_hg ='
variable definition of the Makefile_list_of_hg.am_fragment in the
branch `src' directory.
Added:
gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_hg_file.cc
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/build_shared/Makefile_build.am_fragment
gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment
gstreamermm/trunk/build_shared/Makefile_gensrc.am_fragment
gstreamermm/trunk/gstreamer/src/Makefile.am
gstreamermm/trunk/gstreamer/src/Makefile_list_of_hg.am_fragment
gstreamermm/trunk/gstreamerbase/src/Makefile.am
gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
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
Modified: gstreamermm/trunk/build_shared/Makefile_build.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_build.am_fragment (original)
+++ gstreamermm/trunk/build_shared/Makefile_build.am_fragment Tue Nov 11 19:38:24 2008
@@ -33,6 +33,8 @@
DISTFILES = $(DIST_COMMON) $(dist_sources) $(TEXINFOS) $(EXTRA_DIST)
+CLEANFILES = $(files_plugin_built_h) $(files_plugin_built_cc) $(files_plugin_built_h:%.h=%.loT)
+
DEFS = @DEFS@ -DG_LOG_DOMAIN=\"$(sublib_name)\"
DEFAULT_INCLUDES =
Modified: gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment
==============================================================================
--- gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment (original)
+++ gstreamermm/trunk/build_shared/Makefile_build_gensrc.am_fragment Tue Nov 11 19:38:24 2008
@@ -39,12 +39,15 @@
$(files_posix_hg) \
$(files_win32_hg) \
$(files_general_hg) \
+ $(files_plugin_hg) \
$(files_general_deprecated_hg)
if OS_WIN32
-files_hg = $(files_general_hg) $(files_win32_hg) $(files_general_deprecated_hg)
+files_hg = $(files_general_hg) $(files_win32_hg) $(files_plugin_hg) \
+ $(files_general_deprecated_hg)
else
-files_hg = $(files_general_hg) $(files_posix_hg) $(files_general_deprecated_hg)
+files_hg = $(files_general_hg) $(files_posix_hg) $(files_plugin_hg) \
+ $(files_general_deprecated_hg)
endif
files_built_cc = $(files_hg:.hg=.cc) wrap_init.cc
@@ -53,6 +56,9 @@
files_all_built_cc = $(files_all_hg:.hg=.cc) wrap_init.cc
files_all_built_h = $(files_all_hg:.hg=.h)
+files_plugin_built_cc = $(files_plugin_hg:.hg=.cc)
+files_plugin_built_h = $(files_plugin_hg:.hg=.h)
+
# Extra files
files_all_extra_cc = \
@@ -84,4 +90,3 @@
$(sublib_files_extra_general_h)
endif
files_extra_h += wrap_init.h
-
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 11 19:38:24 2008
@@ -18,7 +18,7 @@
gensrc_destdir = $(srcdir)/../$(sublib_name)
stamp_dir = $(srcdir)/.stamps
-include $(top_srcdir)/tools/Makefile_list_of_sources.am_fragment
+include $(tools_dir)/Makefile_list_of_sources.am_fragment
tools_m4 = $(files_tools_m4:%.m4=$(tools_dir_m4)/%.m4)
# tools_pm = $(files_tools_pm:%.pm=$(tools_dir_pm)/%.pm)
@@ -43,15 +43,29 @@
run_gen_wrap_init = $(gen_wrap_init_path) $(gen_wrap_init_args)
# The Gst::wrap() table initialization:
-gen_gst_wrap_init_in = $(top_srcdir)/tools/generate_gst_wrap_init.pl.in
-gen_gst_wrap_init_path = $(top_srcdir)/tools/generate_gst_wrap_init.pl
+gen_gst_wrap_init_in = $(tools_dir)/generate_gst_wrap_init.pl.in
+gen_gst_wrap_init_path = $(tools_dir)/generate_gst_wrap_init.pl
gen_gst_wrap_init_args = --namespace=$(sublib_namespace) --parent_dir=$(sublib_parentdir)
run_gen_gst_wrap_init = $(PERL_PATH) $(gen_gst_wrap_init_path) $(gen_gst_wrap_init_args)
+# The generate_plugin_hg_file utility
+generate_plugin_hg_file_path = $(tools_dir)/extra_defs_gen/generate_plugin_hg_file
+generate_plugin_hg_file_args = --namespace=$(sublib_namespace) --main-defs=$(main_defs) --target=$(sublib_parentdir)
+run_generate_plugin_hg_file = $(generate_plugin_hg_file_path) $(generate_plugin_hg_file_args)
+
EXTRA_DIST = Makefile_list_of_hg.am_fragment \
$(files_defs) $(files_all_hg) $(files_all_ccg)
+BUILT_SOURCES = $(files_plugin_hg)
+
+CLEANFILES = $(files_plugin_hg) $(files_plugin_hg:%.hg=%.ccg) $(gensrc_destdir)/wrap_init.cc $(gensrc_destdir)/gst_wrap_init.cc
+
+
+$(files_plugin_hg): $(generate_plugin_hg_file_path)
+ $(run_generate_plugin_hg_file) $(subst .hg,,$@) > $@
+ touch $(subst .hg,.ccg,$@)
+
$(stamp_dir)/stamp-%: %.hg %.ccg $(tools_m4) $(files_defs)
$(run_gmmproc) $(notdir $*) $(srcdir) $(gensrc_destdir)
@@ -60,10 +74,10 @@
sublib_srcdir = $(srcdir)/../src
files_hg_with_path = $(patsubst %.hg,$(sublib_srcdir)/%.hg,$(files_all_hg))
-$(gensrc_destdir)/wrap_init.cc: $(gen_wrap_init_path) $(files_hg_with_path)
+$(gensrc_destdir)/wrap_init.cc: $(gen_wrap_init_path) $(files_hg_with_path) Makefile
$(run_gen_wrap_init) $(files_all_hg:%.hg=$(srcdir)/%.hg) >$@
-$(gensrc_destdir)/gst_wrap_init.cc: $(gen_gst_wrap_init_in) $(files_hg_with_path)
+$(gensrc_destdir)/gst_wrap_init.cc: $(gen_gst_wrap_init_in) $(files_hg_with_path) Makefile
$(run_gen_gst_wrap_init) $(files_all_hg:%.hg=$(srcdir)/%.hg) >$@
create-stamp-dir:
Modified: gstreamermm/trunk/gstreamer/src/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamer/src/Makefile.am (original)
+++ gstreamermm/trunk/gstreamer/src/Makefile.am Tue Nov 11 19:38:24 2008
@@ -6,5 +6,7 @@
sublib_parentdir = gstreamermm
files_defs = gst.defs gst_methods.defs gst_signals.defs gst_enums.defs gst_vfuncs.defs gst_others.defs gst_docs.xml gst_docs_override.xml
+main_defs = gst.defs
+
include $(top_srcdir)/build_shared/Makefile_gensrc.am_fragment
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 11 19:38:24 2008
@@ -17,4 +17,6 @@
files_general_deprecated_hg =
+files_plugin_hg =
+
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
Modified: gstreamermm/trunk/gstreamerbase/src/Makefile.am
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/Makefile.am (original)
+++ gstreamermm/trunk/gstreamerbase/src/Makefile.am Tue Nov 11 19:38:24 2008
@@ -6,5 +6,7 @@
sublib_parentdir = gstreamerbasemm
files_defs = gstbase.defs gstbase_methods.defs gstbase_signals.defs gstbase_enums.defs gstbase_vfuncs.defs gstbase_others.defs gstbase_docs.xml gstbase_docs_override.xml
+main_defs = gstbase.defs
+
include $(top_srcdir)/build_shared/Makefile_gensrc.am_fragment
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 11 19:38:24 2008
@@ -8,4 +8,6 @@
files_general_deprecated_hg =
+files_plugin_hg =
+
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
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 11 19:38:24 2008
@@ -4,6 +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_extra_defs generate_defs_gstbase \
+ generate_plugin_hg_file
+
generate_extra_defs_SOURCES = generate_defs_gst.cc
generate_defs_gstbase_SOURCES = generate_defs_gstbase.cc
+
+generate_plugin_hg_file_SOURCES = generate_plugin_hg_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 11 19:38:24 2008
@@ -19,7 +19,6 @@
#include "glibmm_generate_extra_defs/generate_extra_defs.h"
-#include <glib.h>
#include <gst/gst.h>
#include <gst/base/gstbasesrc.h>
#include <gst/base/gstbasesink.h>
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 11 19:38:24 2008
@@ -19,7 +19,6 @@
#include "glibmm_generate_extra_defs/generate_extra_defs.h"
-#include <glib.h>
#include <gst/gst.h>
#include <gst/interfaces/colorbalance.h>
#include <gst/interfaces/colorbalancechannel.h>
Added: gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_hg_file.cc
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/tools/extra_defs_gen/generate_plugin_hg_file.cc Tue Nov 11 19:38:24 2008
@@ -0,0 +1,107 @@
+/* $Id: generate_extra_defs.cc 740 2008-10-15 15:58:17Z jaalburqu $ */
+
+/* generate_extra_defs.cc
+ *
+ * Copyright (C) 2001 The Free Software Foundation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library 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 <gst/gst.h>
+#include <glibmm.h>
+
+int main(int argc, char* argv[])
+{
+ gchar* nmspace;
+ gchar* defsFile;
+ gchar* target;
+
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+
+ GOptionEntry optionEntries[] =
+ {
+ {"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 (used in _DEFS() directive)", "def" },
+ {"target", 't', 0, G_OPTION_ARG_STRING, &target, "The target directory of the generated .h file (used in _DEFS() directive)", "directory" },
+ { NULL }
+ };
+
+ GOptionContext* gContext = g_option_context_new("<plugin name>");
+ g_option_context_set_summary(gContext, "Outputs a GStreamer plugin's .hg file to be processed by gmmproc for wrapping it in gstreamermm. Use the same syntax for the plugin name as in gst-inspect.");
+
+ g_option_context_add_main_entries(gContext, optionEntries, NULL);
+ g_option_context_add_group(gContext, gst_init_get_option_group());
+
+ Glib::OptionContext optionContext(gContext, true);
+
+ try
+ {
+ if (!optionContext.parse(argc, argv))
+ {
+ std::cout << "Error parsing options and initializing. Sorry." <<
+ std::endl;
+ return -1;
+ }
+ }
+ catch (Glib::OptionError& error)
+ {
+ std::cout << "Error parsing options and initializing GStreamer." <<
+ std::endl << "Run `" << argv[0] << " -?' for a list of options." <<
+ std::endl;
+ return -1;
+ }
+
+ if (argc != 2)
+ {
+ std::cout << "A plugin name must be supplied to generate an .hg file." <<
+ std::endl << "Run `" << argv[0] << " -?' for a list of options." <<
+ std::endl;
+ return -1;
+ }
+
+ std::cout << "Namespace = " << nmspace << "." << std::endl;
+ std::cout << "Main defs file = " << defsFile << "." << std::endl;
+ std::cout << "Target directory = " << target << "." << std::endl;
+
+ GType type = 0;
+ GstElementFactory* factory = 0;
+
+ factory = gst_element_factory_find(argv[1]);
+
+ // 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);
+
+ Glib::ustring typeName = g_type_name(type);
+ Glib::ustring parentTypeName = g_type_name(g_type_parent(type));
+
+ std::cout << "Type name: " << typeName << "." << std::endl;
+ std::cout << "Parent type name: " << parentTypeName << "." << std::endl;
+
+ g_object_unref(factory);
+ }
+
+ return 0;
+}
\ No newline at end of file
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]