[gstreamermm: 89/167] wrapped GstSample struct



commit 57c922470ea1379af6507a3b025a2aa61a73aa36
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date:   Tue Jul 30 15:00:16 2013 +0200

    wrapped GstSample struct

 .gitignore                |    2 +
 gstreamer/src/filelist.am |    1 +
 gstreamer/src/sample.ccg  |   29 +++++++++++++++++++++++
 gstreamer/src/sample.hg   |   57 +++++++++++++++++++++++++++++++++++++++++++++
 tools/m4/convert_gst.m4   |    5 ++++
 5 files changed, 94 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index aacf610..a1af55d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -148,6 +148,8 @@ gstreamer/gstreamermm/query.cc
 gstreamer/gstreamermm/query.h
 gstreamer/gstreamermm/registry.cc
 gstreamer/gstreamermm/registry.h
+gstreamer/gstreamermm/sample.cc
+gstreamer/gstreamermm/sample.h
 gstreamer/gstreamermm/segment.cc
 gstreamer/gstreamermm/segment.h
 gstreamer/gstreamermm/streamvolume.cc
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index 4bdd8fd..847f054 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -121,6 +121,7 @@ files_hg  =                     \
         pushsrc.hg              \
         query.hg                \
         registry.hg             \
+        sample.hg               \
         segment.hg              \
         structure.hg            \
         systemclock.hg          \
diff --git a/gstreamer/src/sample.ccg b/gstreamer/src/sample.ccg
new file mode 100644
index 0000000..4fb111f
--- /dev/null
+++ b/gstreamer/src/sample.ccg
@@ -0,0 +1,29 @@
+/*
+ * sample.ccg
+ *
+ *  Created on: Jul 30, 2013
+ *      Author: m.kolny
+ */
+/* 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>
+
+_PINCLUDE(gstreamermm/private/miniobject_p.h)
+
diff --git a/gstreamer/src/sample.hg b/gstreamer/src/sample.hg
new file mode 100644
index 0000000..59190a8
--- /dev/null
+++ b/gstreamer/src/sample.hg
@@ -0,0 +1,57 @@
+/*
+ * sample.hg
+ *
+ *  Created on: Jul 30, 2013
+ *      Author: m.kolny
+ */
+/* 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 <gstreamermm/miniobject.h>
+#include <gstreamermm/buffer.h>
+#include <gstreamermm/caps.h>
+#include <gstreamermm/segment.h>
+#include <gstreamermm/structure.h>
+
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+
+/*
+ * A Gst::Sample is a small object containing data, a type, timing and
+ * extra arbitrary information.
+ */
+class Sample : public MiniObject
+{
+  _CLASS_OPAQUE_REFCOUNTED(Sample, GstSample, NONE, gst_sample_ref, gst_sample_unref)
+  _IGNORE(gst_sample_ref, gst_sample_unref)
+
+  static Glib::RefPtr<Gst::Buffer> create(Glib::RefPtr<Gst::Buffer> buffer, Glib::RefPtr<Gst::Caps> caps,
+          Glib::RefPtr<const Gst::Segment> segment, Glib::RefPtr<Gst::Structure> info);
+
+public:
+  _WRAP_METHOD(Glib::RefPtr<Gst::Buffer> get_buffer(), gst_sample_get_buffer)
+  _WRAP_METHOD(Glib::RefPtr<Gst::Caps> get_caps(), gst_sample_get_caps)
+
+};
+
+}//namespace Gst
diff --git a/tools/m4/convert_gst.m4 b/tools/m4/convert_gst.m4
index 9c8c10e..9686595 100644
--- a/tools/m4/convert_gst.m4
+++ b/tools/m4/convert_gst.m4
@@ -186,6 +186,11 @@ _CONVERSION(`const Glib::RefPtr<Gst::Query>&',`GstQuery*', `Glib::unwrap($3)')
 dnl Registry
 _CONVERSION(`GstRegistry*',`Glib::RefPtr<Gst::Registry>', `Glib::wrap($3)')
 
+dnl Sample
+_CONVERSION(`GstSample*',`Glib::RefPtr<Gst::Sample>',`Glib::wrap($3)')
+_CONVERSION(`GstSample*',`Glib::RefPtr<const Gst::Sample>',`Glib::wrap($3)')
+_CONVERSION(`const Glib::RefPtr<Gst::Sample>&',`GstSample*', `Glib::unwrap($3)')
+
 dnl Segment
 _CONVERSION(`GstSegment*',`Glib::RefPtr<Gst::Segment>',`Glib::wrap($3)')
 _CONVERSION(`GstSegment*',`Glib::RefPtr<const Gst::Segment>',`Glib::wrap($3)')


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