[gstreamermm] add support for g_value holding G_TYPE_LIST



commit 3534789143f3a5e91a914c50598777a6dfdac767
Author: Dirk Van Haerenborgh <vhdirk gmail com>
Date:   Mon Oct 21 17:46:45 2013 +0200

    add support for g_value holding G_TYPE_LIST
    
    Signed-off-by: Marcin Kolny <marcin kolny gmail com>

 gstreamer/gstreamermm.h     |    1 +
 gstreamer/src/filelist.am   |    1 +
 gstreamer/src/valuelist.ccg |   63 +++++++++++++++++++++++++++++++++++++++++++
 gstreamer/src/valuelist.hg  |   60 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 125 insertions(+), 0 deletions(-)
---
diff --git a/gstreamer/gstreamermm.h b/gstreamer/gstreamermm.h
index 60f9d9e..68c4861 100644
--- a/gstreamer/gstreamermm.h
+++ b/gstreamer/gstreamermm.h
@@ -101,6 +101,7 @@
 #include <gstreamermm/typefindfactory.h>
 #include <gstreamermm/urihandler.h>
 #include <gstreamermm/value.h>
+#include <gstreamermm/valuelist.h>
 
 // Core library base includes
 #include <gstreamermm/basesink.h>
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 85618a0..5508ae1 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -143,6 +143,7 @@ files_hg  =                     \
         typefind.hg             \
         urihandler.hg           \
         value.hg                \
+        valuelist.hg        \
         videoorientation.hg     \
         videosink.hg            \
         videooverlay.hg             \
diff --git a/gstreamer/src/valuelist.ccg b/gstreamer/src/valuelist.ccg
new file mode 100644
index 0000000..6718abb
--- /dev/null
+++ b/gstreamer/src/valuelist.ccg
@@ -0,0 +1,63 @@
+/* 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 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.
+ */
+
+namespace Gst
+{
+
+ValueList::ValueList()
+{}
+
+// static
+GType ValueList::get_type()
+{
+  return GST_TYPE_LIST;
+}
+
+guint ValueList::size() const
+{
+  return gst_value_list_get_size(gobj());
+}
+
+bool ValueList::get(guint index, Glib::ValueBase& value) const
+{
+  const GValue* g_value = gst_value_list_get_value(gobj(), index);
+
+  if(g_value)
+  {
+    value.init(g_value);
+    return true;
+  }
+  else
+    return false;
+}
+
+Gst::ValueList& ValueList::append(const Glib::ValueBase& value)
+{
+  gst_value_list_append_value(gobj(), value.gobj());
+  return *this;
+}
+
+Gst::ValueList& ValueList::prepend(const Glib::ValueBase& value)
+{
+  gst_value_list_prepend_value(gobj(), value.gobj());
+  return *this;
+}
+
+
+} // Glib namespace
diff --git a/gstreamer/src/valuelist.hg b/gstreamer/src/valuelist.hg
new file mode 100644
index 0000000..9d99721
--- /dev/null
+++ b/gstreamer/src/valuelist.hg
@@ -0,0 +1,60 @@
+/* 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 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 <gst/gst.h>
+#include <gst/gstvalue.h>
+#include <glibmm/value.h>
+#include <glibmm/value_custom.h>
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+
+class ValueList : public Glib::ValueBase
+{
+
+public:
+
+  /** Default constructor.
+   */
+  ValueList();
+
+  /** Get the GType for this class, for use with the underlying GObject type system.
+   */
+  static GType get_type() G_GNUC_CONST;
+
+public:
+
+  _WRAP_METHOD_DOCS_ONLY(gst_value_list_get_size)
+  guint size() const;
+  
+  _WRAP_METHOD_DOCS_ONLY(gst_value_list_get_value)
+  bool get(guint index, Glib::ValueBase& value) const;
+
+  _WRAP_METHOD_DOCS_ONLY(gst_value_list_append)
+  Gst::ValueList& append(const Glib::ValueBase& value);
+
+  _WRAP_METHOD_DOCS_ONLY(gst_value_list_prepend)
+  Gst::ValueList& prepend(const Glib::ValueBase& value);
+
+};
+
+} //namespace Gst
+


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