[gstreamermm] Began wrapping Gst::PropertyProbe methods.



commit d9217af5d932192aaf6fd50e9edd49639a8a19e3
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Fri Jun 5 01:37:54 2009 -0400

    Began wrapping Gst::PropertyProbe methods.
---
 ChangeLog                                      |   15 +++++++
 configure.ac                                   |    7 ++-
 gstreamer/gstreamermm/value_base_type_traits.h |   54 ++++++++++++++++++++++++
 gstreamer/src/Makefile_list_of_hg.am_fragment  |    2 +-
 gstreamer/src/mixer.hg                         |    2 +-
 gstreamer/src/propertyprobe.hg                 |    4 ++
 6 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index de44670..22868b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2009-06-05  José Alburquerque  <jaalburqu svn gnome org>
+
+	* gstreamer/gstreamermm/value_base_type_traits.h:
+	* gstreamer/src/propertyprobe.hg: Defined a template specialization of
+	glibmm's Glib::Container_Helpers::TypeTraits<> so that
+	Glib::ArrayHandle<> can be used to wrap a GlibValueArray.  Wrapped
+	Gst::ProperyProbe::get_values() which returns a
+	Glib::ArrayHandle<Glib::ValueBase>.
+	* configure.ac:
+	* gstreamer/src/Makefile_list_of_hg.am_fragment: Added playbin
+	plug-in.
+	* gstreamer/src/mixer.hg: GstMixer signals are not available to
+	gen_defs_gst tool and have been deprecated so marked the TODO to wrap
+	them complete.
+
 2009-05-29  José Alburquerque  <jaalburqu svn gnome org>
 
 	* gstreamer/src/taglist.ccg:
diff --git a/configure.ac b/configure.ac
index d0fa92f..1c105c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,7 +193,8 @@ audiotestsrc=AudioTestSrc cdparanoiasrc=CdParanoiaSrc \
 clockoverlay=ClockOverlay decodebin=DecodeBin \
 ffmpegcolorspace=FfmpegColorSpace gdpdepay=GDPDepay gdppay=GDPPay \
 giosink=GioSink giosrc=GioSrc giostreamsink=GioStreamSink \
-giostreamsrc=GioStreamSrc oggdemux=OggDemux oggmux=OggMux playbin2=PlayBin2 \
+giostreamsrc=GioStreamSrc oggdemux=OggDemux oggmux=OggMux \
+playbin=PlayBin playbin2=PlayBin2 \
 tcpclientsrc=TCPClientSrc tcpclientsink=TCPClientSink \
 tcpserversrc=TCPServerSrc \
 textoverlay=TextOverlay textrender=TextRender theoradec=TheoraDec \
@@ -204,8 +205,8 @@ vorbistag=VorbisTag ximagesink=XImageSink xvimagesink=XvImageSink"
 
 # TODO: The following plug-ins (to be added above) 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.
+# wrapped in glibmm first: DecodeBin2, MultiFdSink, TcpServerSink, TheoraParse,
+# UriDecodeBin.
 
 # Go through all the "plug-in defs", extracting the plug-in name and the C++
 # class name.  Create a list of the C++ class names and a list of the
diff --git a/gstreamer/gstreamermm/value_base_type_traits.h b/gstreamer/gstreamermm/value_base_type_traits.h
new file mode 100644
index 0000000..fe79ba2
--- /dev/null
+++ b/gstreamer/gstreamermm/value_base_type_traits.h
@@ -0,0 +1,54 @@
+// -*- c++ -*-
+
+/* gstreamermm - a C++ wrapper for gstreamer
+ *
+ * Copyright 2008-2009 The gstreamermm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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/containerhandle_shared.h>
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+namespace Glib
+{
+
+namespace Container_Helpers
+{
+
+template <>
+struct TypeTraits<Glib::ValueBase>
+{
+  typedef Glib::ValueBase       CppType;
+  typedef GValue *              CType;
+  typedef GValue *              CTypeNonConst;
+
+  static CType to_c_type (Glib::ValueBase& v)
+    { return v.gobj(); }
+
+  static CType to_c_type (CType v)
+    { return v; }
+
+  static CppType to_cpp_type(CType v)
+    { ValueBase b; if (v) b.init(v); return b; }
+
+  // Glib::~ValueBase() frees underlying C type already.
+  static void release_c_type(CType v) { }
+};
+
+}
+
+}
+#endif /* DOXYGEN_SHOULD_SKIP_THIS */
diff --git a/gstreamer/src/Makefile_list_of_hg.am_fragment b/gstreamer/src/Makefile_list_of_hg.am_fragment
index 6bec8a6..e6005d1 100644
--- a/gstreamer/src/Makefile_list_of_hg.am_fragment
+++ b/gstreamer/src/Makefile_list_of_hg.am_fragment
@@ -40,7 +40,7 @@ files_all_plugin_hg = capsfilter.hg fakesrc.hg fakesink.hg fdsink.hg fdsrc.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 \
+		  oggdemux.hg oggmux.hg playbin.hg playbin2.hg \
 		  tcpclientsrc.hg tcpclientsink.hg tcpserversrc.hg \
 		  textoverlay.hg textrender.hg theoradec.hg theoraenc.hg \
 		  timeoverlay.hg videorate.hg videoscale.hg \
diff --git a/gstreamer/src/mixer.hg b/gstreamer/src/mixer.hg
index 79f6484..284a9fc 100644
--- a/gstreamer/src/mixer.hg
+++ b/gstreamer/src/mixer.hg
@@ -74,7 +74,7 @@ public:
   _WRAP_METHOD(Gst::MixerFlags get_mixer_flags() const, gst_mixer_get_mixer_flags)
   _WRAP_METHOD(static Gst::MixerMessageType get_message_type(const Glib::RefPtr<Gst::Message>& message), gst_mixer_message_get_type)
 
-  //TODO: Wrap signals if necessary.
+  // Signals were deprecated before we could wrap them (see header file).
 
 #ifdef GLIBMM_VFUNCS_ENABLED
   virtual Glib::ArrayHandle<int> get_volume_vfunc(const Glib::RefPtr<const Gst::MixerTrack>& track) const;
diff --git a/gstreamer/src/propertyprobe.hg b/gstreamer/src/propertyprobe.hg
index e30e55e..5aacad3 100644
--- a/gstreamer/src/propertyprobe.hg
+++ b/gstreamer/src/propertyprobe.hg
@@ -19,6 +19,7 @@
 
 #include <gst/interfaces/propertyprobe.h>
 #include <glibmm/interface.h>
+#include <gstreamermm/value_base_type_traits.h>
 
 _DEFS(gstreamermm,gst)
 
@@ -38,6 +39,9 @@ class PropertyProbe : public Glib::Interface
   _CLASS_INTERFACE(PropertyProbe, GstPropertyProbe, GST_PROPERTY_PROBE, GstPropertyProbeInterface)
 
 public:
+#m4 _CONVERSION(`GValueArray*', `Glib::ArrayHandle<Glib::ValueBase>', `($3 ? Glib::ArrayHandle<Glib::ValueBase>(&($3->values), $3->n_values, Glib::OWNERSHIP_DEEP) : Glib::ArrayHandle<Glib::ValueBase>(0, 0, Glib::OWNERSHIP_NONE))')
+  _WRAP_METHOD(Glib::ArrayHandle<Glib::ValueBase> get_values(const GParamSpec* pspec), gst_property_probe_get_values)
+
   //TODO: Wrap methods.
   //TODO: Wrap vfuncs.
 };



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