gnomemm r1852 - in gstreamermm/trunk: . gstreamerbase gstreamerbase/src tools/extra_defs_gen tools/m4
- From: jaalburqu svn gnome org
- To: svn-commits-list gnome org
- Subject: gnomemm r1852 - in gstreamermm/trunk: . gstreamerbase gstreamerbase/src tools/extra_defs_gen tools/m4
- Date: Mon, 15 Dec 2008 03:15:44 +0000 (UTC)
Author: jaalburqu
Date: Mon Dec 15 03:15:44 2008
New Revision: 1852
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1852&view=rev
Log:
2008-12-14 Josà Alburquerque <jaalburqu svn gnome org>
* gstreamerbase/src/Makefile_list_of_hg.am_fragment:
* gstreamerbase/src/audiofilter.ccg:
* gstreamerbase/src/audiofilter.hg:
* gstreamerbase/src/videosink.ccg:
* gstreamerbase/src/videosink.hg: Added GstBase::AudioFilter and
GstBase::VideoSink base classes (from which some plug-ins derive) and
a list of most of the gst-plugins-base plug-ins to be generated (the
rest are TODO's to be done bit by bit).
* configure.ac:
* gstreamerbase/gstreamerbasemm-0.10.pc.in: Added gstreamer-video-0.10
to list of package dependencies of gstreamerbasemm and to the
gstreamerbasemm pk-config file (needed for GstBase::VideoSink).
* gstreamerbase/src/audiosink.hg:
* gstreamerbase/src/audiosrc.hg: Added GStreamer includes so plug-ins
that include the .h files have access to the *Class structures.
* tools/extra_defs_gen/generate_defs_gstbase.cc:
* gstreamerbase/src/gstbase_signals.defs: Rewrote
genereate_defs_gstbase tool to include GstPlayBaseBin (base class of
GstPlayBin) so its properties can be wrapped.
* tools/extra_defs_gen/generate_plugin_gmmproc_file.cc: Renamed global
includeRoot to more appropriate parentInclude (the include of the
parent class); Rewrote get_cast_macro() to use a similar algorithm for
inserting the underscore ('_') in the given type name as gmmproc does
more or less (just a guess, but the generate *_get_type() functions of
the plug-in specific enums in the *.ccg files have names that gmmproc
is happy with). Made *Class definition in *.ccg files optional based
on whether there are wrapped signals in plugin. Modified so that the
plug-in name can also be a type name (e.g. GstPipeline, etc.) and so
that when the --suggest-hg option is used the other options like
--namespace, and --target are not needed.
* tools/m4/convert_gst.m4: Fixed GstBuffer conversion to work with
gstreamerbase branch.
* tools/m4/ctocpp_base.m4: Added gdouble C to C++ translation.
* tools/m4/ctocpp.m4: Added GstElement and GstTagList C to C++
translation (for plug-in generation).
Added:
gstreamermm/trunk/gstreamerbase/src/audiofilter.ccg
gstreamermm/trunk/gstreamerbase/src/audiofilter.hg
gstreamermm/trunk/gstreamerbase/src/videosink.ccg
gstreamermm/trunk/gstreamerbase/src/videosink.hg
Modified:
gstreamermm/trunk/ChangeLog
gstreamermm/trunk/configure.ac
gstreamermm/trunk/gstreamerbase/gstreamerbasemm-0.10.pc.in
gstreamermm/trunk/gstreamerbase/src/Makefile_list_of_hg.am_fragment
gstreamermm/trunk/gstreamerbase/src/audiosink.hg
gstreamermm/trunk/gstreamerbase/src/audiosrc.hg
gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs
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_gst.m4
gstreamermm/trunk/tools/m4/ctocpp.m4
gstreamermm/trunk/tools/m4/ctocpp_base.m4
Modified: gstreamermm/trunk/configure.ac
==============================================================================
--- gstreamermm/trunk/configure.ac (original)
+++ gstreamermm/trunk/configure.ac Mon Dec 15 03:15:44 2008
@@ -144,6 +144,7 @@
gstreamer-plugins-base-0.10 >= ${gstreamermm_min_gst_version} \
gstreamer-audio-0.10 >= ${gstreamermm_min_gst_version} \
gstreamer-interfaces-0.10 >= ${gstreamermm_min_gst_version} \
+ gstreamer-video-0.10 >= ${gstreamermm_min_gst_version} \
libxml++-2.6 >= ${gstreamermm_min_libxmlpp_version} \
)
AC_SUBST(GSTREAMERBASEMM_CFLAGS)
Modified: gstreamermm/trunk/gstreamerbase/gstreamerbasemm-0.10.pc.in
==============================================================================
--- gstreamermm/trunk/gstreamerbase/gstreamerbasemm-0.10.pc.in (original)
+++ gstreamermm/trunk/gstreamerbase/gstreamerbasemm-0.10.pc.in Mon Dec 15 03:15:44 2008
@@ -5,7 +5,7 @@
Name: gstreamerbasemm
Description: C++ wrapper for gstreamer-base-plugins module
-Requires: glibmm-2.4 gstreamer-plugins-base-0.10 gstreamer-audio-0.10 gstreamer-interfaces-0.10
+Requires: glibmm-2.4 gstreamer-plugins-base-0.10 gstreamer-audio-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10
Version: @VERSION@
Libs: -L${libdir} -lgstreamerbasemm-0.10
Cflags: -I${includedir}/gstreamerbasemm-0.10 -I${libdir}/gstreamerbasemm-0.10/include
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 Mon Dec 15 03:15:44 2008
@@ -5,12 +5,29 @@
files_posix_hg =
files_win32_hg =
-files_general_hg = audioclock.hg audiosink.hg audiosrc.hg baseaudiosink.hg \
- baseaudiosrc.hg \
+files_general_hg = audioclock.hg audiofilter.hg audiosink.hg audiosrc.hg \
+ baseaudiosink.hg baseaudiosrc.hg videosink.hg \
colorbalance.hg colorbalancechannel.hg xoverlay.hg
files_general_deprecated_hg =
-files_plugin_hg = decodebin.hg oggmux.hg
+files_plugin_hg = adder.hg alsamixer.hg alsasink.hg alsasrc.hg \
+ audioconvert.hg audioresample.hg audiotestsrc.hg \
+ cdparanoiasrc.hg clockoverlay.hg decodebin.hg \
+ ffmpegcolorspace.hg gdpdepay.hg gdppay.hg giosink.hg \
+ giosrc.hg giostreamsink.hg giostreamsrc.hg \
+ oggdemux.hg oggmux.hg playbin2.hg \
+ textoverlay.hg \
+ textrender.hg theoradec.hg theoraenc.hg \
+ timeoverlay.hg videorate.hg videoscale.hg \
+ videotestsrc.hg volume.hg vorbisdec.hg vorbisenc.hg \
+ vorbisparse.hg vorbistag.hg ximagesink.hg xvimagesink.hg
+
+#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.
include $(top_srcdir)/build_shared/Makefile_build_gensrc.am_fragment
Added: gstreamermm/trunk/gstreamerbase/src/audiofilter.ccg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamerbase/src/audiofilter.ccg Mon Dec 15 03:15:44 2008
@@ -0,0 +1,24 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * 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 <gst/audio/gstaudiofilter.h>
+
+_PINCLUDE(gstreamermm/private/basetransform_p.h)
Added: gstreamermm/trunk/gstreamerbase/src/audiofilter.hg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamerbase/src/audiofilter.hg Mon Dec 15 03:15:44 2008
@@ -0,0 +1,51 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * 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 <gstreamermm/basetransform.h>
+
+_DEFS(gstreamerbasemm,gstbase)
+
+namespace GstBase
+{
+
+/** GstBase::AudioFilter â Base class for simple audio filters.
+ * GstBase::AudioFilter is a Gst::BaseTransform-derived base class for simple
+ * audio filters, ie. those that output the same format that they get as input.
+ *
+ * GstBase::AudioFilter will parse the input format for you (with error
+ * checking) before calling your setup function. Also, elements deriving from
+ * GstBase::AudioFilter may use gst_audio_filter_class_add_pad_templates() from
+ * their base_init function to easily configure the set of caps/formats that
+ * the element is able to handle.
+ *
+ * Derived classes should override the GstBase::AudioFilter::setup() and
+ * Gst::BaseTransform::transform_ip() and/or Gst::BaseTransform::transform()
+ * virtual functions in their class_init function.
+ */
+class AudioFilter : public Gst::BaseTransform
+{
+ _CLASS_GOBJECT(AudioFilter, GstAudioFilter, GST_AUDIO_FILTER, Gst::BaseTransform, GstBaseTransform)
+
+public:
+ //TODO: Wrap vfuncs.
+};
+
+} // namespace GstBase
Modified: gstreamermm/trunk/gstreamerbase/src/audiosink.hg
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/audiosink.hg (original)
+++ gstreamermm/trunk/gstreamerbase/src/audiosink.hg Mon Dec 15 03:15:44 2008
@@ -19,6 +19,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <gst/audio/gstaudiosink.h>
#include <gstreamerbasemm/baseaudiosink.h>
_DEFS(gstreamerbasemm,gstbase)
Modified: gstreamermm/trunk/gstreamerbase/src/audiosrc.hg
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/audiosrc.hg (original)
+++ gstreamermm/trunk/gstreamerbase/src/audiosrc.hg Mon Dec 15 03:15:44 2008
@@ -19,6 +19,7 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <gst/audio/gstaudiosrc.h>
#include <gstreamerbasemm/baseaudiosrc.h>
_DEFS(gstreamerbasemm,gstbase)
Modified: gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs
==============================================================================
--- gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs (original)
+++ gstreamermm/trunk/gstreamerbase/src/gstbase_signals.defs Mon Dec 15 03:15:44 2008
@@ -541,6 +541,170 @@
;; From GstXOverlay
+;; From GstPlayBaseBin
+
+(define-property name
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamString")
+ (docs "The name of the object")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property async-handling
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamBoolean")
+ (docs "The bin will handle Asynchronous state changes")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property delay
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamUInt64")
+ (docs "Expected delay needed for elements to spin up to PLAYING in nanoseconds")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property auto-flush-bus
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamBoolean")
+ (docs "Whether to automatically flush the pipeline's bus when going from READY into NULL state")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property uri
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamString")
+ (docs "URI of the media to play")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property suburi
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamString")
+ (docs "Optional URI of a subtitle")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property queue-size
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamUInt64")
+ (docs "Size of internal queues in nanoseconds")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property queue-threshold
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamUInt64")
+ (docs "Buffering threshold of internal queues in nanoseconds")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property queue-min-threshold
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamUInt64")
+ (docs "Buffering low threshold of internal queues in nanoseconds")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property nstreams
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamInt")
+ (docs "number of streams")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property stream-info
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamPointer")
+ (docs "List of streaminfo")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property stream-info-value-array
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamValueArray")
+ (docs "value array of streaminfo")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property source
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamObject")
+ (docs "Source element")
+ (readable #t)
+ (writable #f)
+ (construct-only #f)
+)
+
+(define-property current-video
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamInt")
+ (docs "Currently playing video stream (-1 = none)")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property current-audio
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamInt")
+ (docs "Currently playing audio stream (-1 = none)")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property current-text
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamInt")
+ (docs "Currently playing text stream (-1 = none)")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property subtitle-encoding
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamString")
+ (docs "Encoding to assume if input subtitles are not in UTF-8 encoding. If not set, the GST_SUBTITLE_ENCODING environment variable will be checked for an encoding to use. If that is not set either, ISO-8859-15 will be assumed.")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
+(define-property connection-speed
+ (of-object "GstPlayBaseBin")
+ (prop-type "GParamUInt")
+ (docs "Network connection speed in kbps (0 = unknown)")
+ (readable #t)
+ (writable #t)
+ (construct-only #f)
+)
+
;; From GstAdder
(define-property name
Added: gstreamermm/trunk/gstreamerbase/src/videosink.ccg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamerbase/src/videosink.ccg Mon Dec 15 03:15:44 2008
@@ -0,0 +1,25 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * 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 <gst/video/gstvideosink.h>
+
+_PINCLUDE(gstreamermm/private/basesink_p.h)
+
Added: gstreamermm/trunk/gstreamerbase/src/videosink.hg
==============================================================================
--- (empty file)
+++ gstreamermm/trunk/gstreamerbase/src/videosink.hg Mon Dec 15 03:15:44 2008
@@ -0,0 +1,52 @@
+// -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008 The gstreamermm Development Team
+ *
+ * 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 <gstreamermm/basesink.h>
+
+_DEFS(gstreamerbasemm,gstbase)
+
+namespace GstBase
+{
+
+/** GstBase::VideoSink â Base class for video sinks.
+ * Provides useful functions and a base class for video sinks.
+ *
+ * GstBase::VideoSink will configure the default base sink to drop frames that
+ * arrive later than 20ms as this is considered the default threshold for
+ * observing out-of-sync frames.
+ */
+class VideoSink : public Gst::BaseSink
+{
+ _CLASS_GOBJECT(VideoSink, GstVideoSink, GST_VIDEO_SINK, Gst::BaseSink, GstBaseSink)
+
+public:
+ /** Get height of GstBase::VideoSink.
+ */
+ _MEMBER_GET(height, height, int, gint)
+
+ /** Get width of GstBase::VideoSink.
+ */
+ _MEMBER_GET(width, width, int, gint)
+
+ //TODO: _WRAP_METHOD(void center_rect(...), gst_video_sink_center_rect)
+};
+
+} // namespace GstBase
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 Mon Dec 15 03:15:44 2008
@@ -50,6 +50,9 @@
<< get_defs(GST_TYPE_COLOR_BALANCE_CHANNEL)
<< get_defs(GST_TYPE_X_OVERLAY)
+ // Base class of playbin plugin:
+ << get_defs(g_type_from_name("GstPlayBaseBin"))
+
// gst-plugins-base (GStreamer base) plugin types:
<< get_plugin_defs("adder")
<< get_plugin_defs("alsamixer")
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 Mon Dec 15 03:15:44 2008
@@ -36,7 +36,7 @@
static Glib::ustring cppTypeName;
static Glib::ustring cppParentTypeName;
static Glib::ustring castMacro;
-static Glib::ustring includeRoot;
+static Glib::ustring parentInclude;
static Glib::ustring parentNameSpace;
GType type = 0;
@@ -98,12 +98,19 @@
if (iter != typeName.end())
result.push_back(*iter);
- for ( ++iter; iter != typeName.end(); ++iter)
+ int encountered_upper = 1; // The first char (above) should be upper
+
+ for (++iter; iter != typeName.end(); ++iter)
{
if (g_unichar_isupper(*iter))
{
- result.push_back('_');
+ if (!encountered_upper || encountered_upper > 1)
+ result.push_back('_');
+ ++encountered_upper;
}
+ else
+ encountered_upper = 0;
+
result.push_back(g_unichar_toupper(*iter));
}
@@ -321,7 +328,7 @@
{
std::cout << "include(ctocpp_base.m4)dnl" << std::endl;
std::cout << "changecom()dnl" << std::endl;
- std::cout << "#include <" << includeRoot << "/" <<
+ std::cout << "#include <" << parentInclude << "/" <<
cppParentTypeName.lowercase() << ".h>" << std::endl;
std::cout << includeMacroCalls;
@@ -373,14 +380,17 @@
void generate_ccg_file(const Glib::ustring& enumGTypeFunctionDefinitions,
const Glib::ustring& cClassSignalDeclarations)
{
- std::cout << "_PINCLUDE(" << includeRoot << "/private/" <<
+ std::cout << "_PINCLUDE(" << parentInclude << "/private/" <<
cppParentTypeName.lowercase() << "_p.h)" << std::endl << std::endl;
- std::cout << "struct _" << cTypeName << "Class" << std::endl;
- std::cout << "{" << std::endl;
- std::cout << " " << cParentTypeName << "Class parent_class;" << std::endl;
- std::cout << cClassSignalDeclarations;
- std::cout << "};" << std::endl << std::endl;
+ if (!cClassSignalDeclarations.empty())
+ {
+ std::cout << "struct _" << cTypeName << "Class" << std::endl;
+ std::cout << "{" << std::endl;
+ std::cout << " " << cParentTypeName << "Class parent_class;" << std::endl;
+ std::cout << cClassSignalDeclarations;
+ std::cout << "};" << std::endl << std::endl;
+ }
Glib::ustring getTypeName = castMacro.lowercase() + "_get_type";
@@ -446,8 +456,8 @@
{ NULL }
};
- GOptionContext* gContext = g_option_context_new("<plugin name>");
- g_option_context_set_summary(gContext, "Outputs a GStreamer plugin's gmmproc files to be processed by gmmproc for wrapping in gstreamermm. Use the same syntax for the plugin name as in gst-inspect.");
+ 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.");
g_option_context_add_main_entries(gContext, optionEntries, NULL);
g_option_context_add_group(gContext, gst_init_get_option_group());
@@ -479,18 +489,19 @@
return -1;
}
- if (!nmspace || !defsFile || !target)
+ Glib::ustring gTypeName;
+
+ pluginName = argv[1];
+
+ if (pluginName.substr(0,3) == "Gst")
{
- std::cout << "A namespace, a default defs file and a target directory "
- "must be supplied" << std::endl << "with the --namespace, --main-defs "
- "and --target options (run with -? option for " << std::endl <<
- "details)." << std::endl;
- return -1;
+ gTypeName = pluginName;
+ pluginName = pluginName.substr(3).lowercase();
}
GstElementFactory* factory = 0;
- factory = gst_element_factory_find(argv[1]);
+ factory = gst_element_factory_find(pluginName.c_str());
// Make sure that the feature is actually loaded:
if (factory)
@@ -501,15 +512,36 @@
g_object_unref(factory);
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)
+ {
+ if (suggestHg)
+ {
+ std::cout << pluginName << ".hg" << std::endl;
+ return 0;
+ }
+
+ if (!nmspace || !defsFile || !target)
+ {
+ std::cout << "A namespace, a default defs file and a target directory "
+ "must be supplied" << std::endl << "with the --namespace, --main-defs "
+ "and --target options (run with -? option for " << std::endl <<
+ "details)." << std::endl;
+ return -1;
+ }
- pluginName = argv[1];
cTypeName = g_type_name(type);
cParentTypeName = g_type_name(g_type_parent(type));
cppTypeName = cTypeName.substr(3);
cppParentTypeName = cParentTypeName.substr(3);
castMacro = get_cast_macro(cTypeName);
- if (cppParentTypeName.compare("BaseSsrc") == 0 ||
+ if (cppParentTypeName.compare("BaseSrc") == 0 ||
cppParentTypeName.compare("BaseSink") == 0 ||
cppParentTypeName.compare("BaseTransform") == 0 ||
cppParentTypeName.compare("PushSrc") == 0 ||
@@ -517,18 +549,16 @@
cppParentTypeName.compare("Bin") == 0 ||
cppParentTypeName.compare("Element") == 0)
{
- includeRoot = "gstreamermm";
+ parentInclude = "gstreamermm";
parentNameSpace = "Gst";
}
else
{
- includeRoot = target;
+ parentInclude = target;
parentNameSpace = nmspace;
}
- if (suggestHg)
- std::cout << pluginName << ".hg" << std::endl;
- else if (hgFile || ccgFile)
+ if (hgFile || ccgFile)
{
Glib::ustring propertyWrapStatements;
Glib::ustring includeMacroCalls;
@@ -554,8 +584,6 @@
cClassSignalDeclarations);
}
}
-
- g_object_unref(factory);
}
else
{
@@ -571,5 +599,8 @@
}
}
+ if (factory)
+ g_object_unref(factory);
+
return 0;
}
Modified: gstreamermm/trunk/tools/m4/convert_gst.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/convert_gst.m4 (original)
+++ gstreamermm/trunk/tools/m4/convert_gst.m4 Mon Dec 15 03:15:44 2008
@@ -36,7 +36,7 @@
_CONVERSION(`Glib::RefPtr<Gst::Object>',`GstObject*',`Glib::unwrap($3)')
#Buffer
-_CONVERSION(`GstBuffer*',`Glib::RefPtr<Gst::Buffer>',`wrap($3)')
+_CONVERSION(`GstBuffer*',`Glib::RefPtr<Gst::Buffer>',`Gst::wrap($3)')
_CONVERSION(`const Glib::RefPtr<Gst::Buffer>&',`GstBuffer*', `Glib::unwrap($3)')
_CONVERSION(`const Glib::RefPtr<const Gst::Buffer>&',`GstBuffer*', `const_cast<GstBuffer*>(Glib::unwrap($3))')
_CONVERSION(`const Glib::RefPtr<Gst::Buffer>&',`const GstBuffer*', `Glib::unwrap($3)')
Modified: gstreamermm/trunk/tools/m4/ctocpp.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/ctocpp.m4 (original)
+++ gstreamermm/trunk/tools/m4/ctocpp.m4 Mon Dec 15 03:15:44 2008
@@ -4,4 +4,6 @@
#Reference counted
_CCONVERSION(`GstBuffer*',`const Glib::RefPtr<Gst::Buffer>&',`Glib::RefPtr<Gst::Buffer>',`<gstreamermm/buffer.h>')
_CCONVERSION(`GstCaps*',`const Glib::RefPtr<Gst::Caps>&',`Glib::RefPtr<Gst::Caps>',`<gstreamermm/caps.h>')
+_CCONVERSION(`GstElement*',`const Glib::RefPtr<Gst::Element>&',`Glib::RefPtr<Gst::Element>',`<gstreamermm/element.h>')
_CCONVERSION(`GstPad*',`const Glib::RefPtr<Gst::Pad>&',`Glib::RefPtr<Gst::Pad>',`<gstreamermm/pad.h>')
+_CCONVERSION(`GstTagList*',`Gst::TagList',,`<gstreamermm/taglist.h>')
Modified: gstreamermm/trunk/tools/m4/ctocpp_base.m4
==============================================================================
--- gstreamermm/trunk/tools/m4/ctocpp_base.m4 (original)
+++ gstreamermm/trunk/tools/m4/ctocpp_base.m4 Mon Dec 15 03:15:44 2008
@@ -78,6 +78,7 @@
_CCONVERSION(`gint64',`gint64')
_CCONVERSION(`guint64',`guint64')
_CCONVERSION(`gfloat',`float')
+_CCONVERSION(`gdouble',`double')
#String C to C++ translations
_CCONVERSION(`gchararray',`const Glib::ustring&',`Glib::ustring')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]