[gstreamermm: 75/167] wrapped GstMemory
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gstreamermm: 75/167] wrapped GstMemory
- Date: Tue, 3 Sep 2013 19:25:22 +0000 (UTC)
commit 7a437919f416d14c55493bb345d671f7963e3cec
Author: Marcin Kolny at Flytronic <marcin kolny flytronic pl>
Date: Tue Jul 30 12:16:11 2013 +0200
wrapped GstMemory
gstreamer/src/filelist.am | 1 +
gstreamer/src/memory.ccg | 30 ++++++++++++++++++++
gstreamer/src/memory.hg | 66 +++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 97 insertions(+), 0 deletions(-)
---
diff --git a/gstreamer/src/filelist.am b/gstreamer/src/filelist.am
index bbb8156..4bdd8fd 100644
--- a/gstreamer/src/filelist.am
+++ b/gstreamer/src/filelist.am
@@ -107,6 +107,7 @@ files_hg = \
ghostpad.hg \
iterator.hg \
message.hg \
+ memory.hg \
miniobject.hg \
navigation.hg \
object.hg \
diff --git a/gstreamer/src/memory.ccg b/gstreamer/src/memory.ccg
new file mode 100644
index 0000000..dc0943d
--- /dev/null
+++ b/gstreamer/src/memory.ccg
@@ -0,0 +1,30 @@
+/* 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.
+ */
+
+_PINCLUDE(gstreamermm/private/miniobject_p.h)
+
+namespace Gst
+{
+
+Glib::RefPtr<Gst::Memory> Memory::create(Gst::MemoryFlags flags, gpointer data, gsize maxsize, gsize offset,
gsize size)
+{
+ return Glib::RefPtr<Memory>(reinterpret_cast<Memory*>(gst_memory_new_wrapped(GstMemoryFlags(flags),
data, maxsize, offset, size, 0, 0)));
+}
+
+}
diff --git a/gstreamer/src/memory.hg b/gstreamer/src/memory.hg
new file mode 100644
index 0000000..6efa0bb
--- /dev/null
+++ b/gstreamer/src/memory.hg
@@ -0,0 +1,66 @@
+/* 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>
+
+_DEFS(gstreamermm,gst)
+
+namespace Gst
+{
+
+_WRAP_ENUM(MemoryFlags, GstMemoryFlags)
+
+/**
+ * GstMemory is a lightweight refcounted object that wraps a region of memory.
+ * They are typically used to manage the data of a #GstBuffer.
+ *
+ * A GstMemory object has an allocated region of memory of maxsize. The maximum
+ * size does not change during the lifetime of the memory object. The memory
+ * also has an offset and size property that specifies the valid range of memory
+ * in the allocated region.
+ *
+ */
+class Memory : public MiniObject
+{
+ _CLASS_OPAQUE_REFCOUNTED(Memory, GstMemory, NONE, gst_memory_ref, gst_memory_unref)
+ _IGNORE(gst_memory_ref, gst_memory_unref)
+
+public:
+
+ /*
+ * Allocate a new memory block that wraps the given @data.
+ *
+ * @param flags: Gst::MemoryFlags.
+ * @param data Data to wrap.
+ * @param maxsize Allocated size of @data.
+ * @param offset Offset in @data.
+ * @param size Size of valid data.
+ *
+ * @returns a new #Gst::Memory.
+ */
+ static Glib::RefPtr<Memory> create(Gst::MemoryFlags flags, gpointer data, gsize maxsize, gsize offset,
gsize size);
+
+ _MEMBER_GET(maxsize, maxsize, gsize, gsize)
+ _MEMBER_GET(align, align, gsize, gsize)
+ _MEMBER_GET(offset, offset, gsize, gsize)
+ _MEMBER_GET(size, size, gsize, gsize)
+};
+
+}//namespace Gst
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]