2011-03-18 17:35:42 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2009 Wim Taymans <wim.taymans@gmail.be>
|
|
|
|
*
|
|
|
|
* gstmemory.h: Header for memory blocks
|
|
|
|
*
|
|
|
|
* 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
|
2012-11-03 20:44:48 +00:00
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
2011-03-18 17:35:42 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_MEMORY_H__
|
|
|
|
#define __GST_MEMORY_H__
|
|
|
|
|
2011-03-21 08:51:53 +00:00
|
|
|
#include <gst/gstconfig.h>
|
|
|
|
|
|
|
|
#include <glib-object.h>
|
2015-08-10 22:35:21 +00:00
|
|
|
#include <gst/gstminiobject.h>
|
2017-01-11 20:25:08 +00:00
|
|
|
#include <gst/gstobject.h>
|
2011-03-18 18:28:17 +00:00
|
|
|
|
2011-03-18 17:35:42 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2014-06-19 06:05:03 +00:00
|
|
|
GST_EXPORT GType _gst_memory_type;
|
|
|
|
#define GST_TYPE_MEMORY (_gst_memory_type)
|
2011-11-10 12:51:28 +00:00
|
|
|
GType gst_memory_get_type(void);
|
|
|
|
|
2011-03-18 17:35:42 +00:00
|
|
|
typedef struct _GstMemory GstMemory;
|
2011-06-22 09:42:46 +00:00
|
|
|
typedef struct _GstAllocator GstAllocator;
|
2011-06-10 14:46:12 +00:00
|
|
|
|
2012-02-13 15:33:00 +00:00
|
|
|
#define GST_MEMORY_CAST(mem) ((GstMemory *)(mem))
|
|
|
|
|
2011-03-30 16:45:08 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryFlags:
|
2011-04-07 14:02:43 +00:00
|
|
|
* @GST_MEMORY_FLAG_READONLY: memory is readonly. It is not allowed to map the
|
|
|
|
* memory with #GST_MAP_WRITE.
|
|
|
|
* @GST_MEMORY_FLAG_NO_SHARE: memory must not be shared. Copies will have to be
|
|
|
|
* made when this memory needs to be shared between buffers.
|
2012-03-14 20:32:22 +00:00
|
|
|
* @GST_MEMORY_FLAG_ZERO_PREFIXED: the memory prefix is filled with 0 bytes
|
|
|
|
* @GST_MEMORY_FLAG_ZERO_PADDED: the memory padding is filled with 0 bytes
|
2015-10-15 22:05:21 +00:00
|
|
|
* @GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS: the memory is physically contiguous. (Since 1.2)
|
2015-06-14 00:19:59 +00:00
|
|
|
* @GST_MEMORY_FLAG_NOT_MAPPABLE: the memory can't be mapped via gst_memory_map() without any preconditions. (Since 1.2)
|
2011-06-05 17:11:22 +00:00
|
|
|
* @GST_MEMORY_FLAG_LAST: first flag that can be used for custom purposes
|
2011-03-30 16:45:08 +00:00
|
|
|
*
|
|
|
|
* Flags for wrapped memory.
|
|
|
|
*/
|
2011-03-19 09:45:37 +00:00
|
|
|
typedef enum {
|
2012-07-04 14:38:15 +00:00
|
|
|
GST_MEMORY_FLAG_READONLY = GST_MINI_OBJECT_FLAG_LOCK_READONLY,
|
|
|
|
GST_MEMORY_FLAG_NO_SHARE = (GST_MINI_OBJECT_FLAG_LAST << 0),
|
|
|
|
GST_MEMORY_FLAG_ZERO_PREFIXED = (GST_MINI_OBJECT_FLAG_LAST << 1),
|
|
|
|
GST_MEMORY_FLAG_ZERO_PADDED = (GST_MINI_OBJECT_FLAG_LAST << 2),
|
2013-02-23 07:19:48 +00:00
|
|
|
GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS = (GST_MINI_OBJECT_FLAG_LAST << 3),
|
2013-02-22 11:41:09 +00:00
|
|
|
GST_MEMORY_FLAG_NOT_MAPPABLE = (GST_MINI_OBJECT_FLAG_LAST << 4),
|
2011-04-07 14:02:43 +00:00
|
|
|
|
2012-06-14 14:30:12 +00:00
|
|
|
GST_MEMORY_FLAG_LAST = (GST_MINI_OBJECT_FLAG_LAST << 16)
|
2011-03-19 09:45:37 +00:00
|
|
|
} GstMemoryFlags;
|
|
|
|
|
2012-02-13 15:33:00 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_FLAGS:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* A flags word containing #GstMemoryFlags flags set on @mem
|
|
|
|
*/
|
2012-06-14 14:30:12 +00:00
|
|
|
#define GST_MEMORY_FLAGS(mem) GST_MINI_OBJECT_FLAGS (mem)
|
2012-02-13 15:33:00 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_FLAG_IS_SET:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
* @flag: the #GstMemoryFlags to check.
|
|
|
|
*
|
|
|
|
* Gives the status of a specific flag on a @mem.
|
|
|
|
*/
|
2012-06-14 14:30:12 +00:00
|
|
|
#define GST_MEMORY_FLAG_IS_SET(mem,flag) GST_MINI_OBJECT_FLAG_IS_SET (mem,flag)
|
2012-03-14 20:32:22 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_FLAG_UNSET:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
* @flag: the #GstMemoryFlags to clear.
|
|
|
|
*
|
|
|
|
* Clear a specific flag on a @mem.
|
|
|
|
*/
|
2012-06-14 14:30:12 +00:00
|
|
|
#define GST_MEMORY_FLAG_UNSET(mem,flag) GST_MINI_OBJECT_FLAG_UNSET (mem, flag)
|
2012-02-13 15:33:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GST_MEMORY_IS_READONLY:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* Check if @mem is readonly.
|
|
|
|
*/
|
|
|
|
#define GST_MEMORY_IS_READONLY(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_READONLY)
|
2012-06-14 14:30:12 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_IS_NO_SHARE:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* Check if @mem cannot be shared between buffers
|
|
|
|
*/
|
|
|
|
#define GST_MEMORY_IS_NO_SHARE(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NO_SHARE)
|
2012-03-14 20:32:22 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_IS_ZERO_PREFIXED:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* Check if the prefix in @mem is 0 filled.
|
|
|
|
*/
|
|
|
|
#define GST_MEMORY_IS_ZERO_PREFIXED(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PREFIXED)
|
|
|
|
/**
|
|
|
|
* GST_MEMORY_IS_ZERO_PADDED:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* Check if the padding in @mem is 0 filled.
|
|
|
|
*/
|
|
|
|
#define GST_MEMORY_IS_ZERO_PADDED(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_ZERO_PADDED)
|
|
|
|
|
2013-02-22 08:02:22 +00:00
|
|
|
/**
|
2013-02-23 07:19:48 +00:00
|
|
|
* GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS:
|
2013-02-22 08:02:22 +00:00
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
2013-02-23 07:19:48 +00:00
|
|
|
* Check if @mem is physically contiguous.
|
2013-02-22 08:02:22 +00:00
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
2013-02-23 07:19:48 +00:00
|
|
|
#define GST_MEMORY_IS_PHYSICALLY_CONTIGUOUS(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS)
|
2012-02-13 15:33:00 +00:00
|
|
|
|
2013-02-22 11:41:09 +00:00
|
|
|
/**
|
|
|
|
* GST_MEMORY_IS_NOT_MAPPABLE:
|
|
|
|
* @mem: a #GstMemory.
|
|
|
|
*
|
|
|
|
* Check if @mem can't be mapped via gst_memory_map() without any preconditions
|
|
|
|
*
|
|
|
|
* Since: 1.2
|
|
|
|
*/
|
|
|
|
#define GST_MEMORY_IS_NOT_MAPPABLE(mem) GST_MEMORY_FLAG_IS_SET(mem,GST_MEMORY_FLAG_NOT_MAPPABLE)
|
|
|
|
|
2011-03-18 17:35:42 +00:00
|
|
|
/**
|
|
|
|
* GstMemory:
|
2012-06-14 14:30:12 +00:00
|
|
|
* @mini_object: parent structure
|
2011-06-22 09:42:46 +00:00
|
|
|
* @allocator: pointer to the #GstAllocator
|
2011-03-30 14:47:55 +00:00
|
|
|
* @parent: parent memory block
|
2012-01-19 08:12:05 +00:00
|
|
|
* @maxsize: the maximum size allocated
|
|
|
|
* @align: the alignment of the memory
|
|
|
|
* @offset: the offset where valid data starts
|
|
|
|
* @size: the size of valid data
|
2011-03-18 17:35:42 +00:00
|
|
|
*
|
|
|
|
* Base structure for memory implementations. Custom memory will put this structure
|
|
|
|
* as the first member of their structure.
|
|
|
|
*/
|
|
|
|
struct _GstMemory {
|
2012-06-14 14:30:12 +00:00
|
|
|
GstMiniObject mini_object;
|
|
|
|
|
2012-01-30 12:02:13 +00:00
|
|
|
GstAllocator *allocator;
|
2011-03-18 17:35:42 +00:00
|
|
|
|
2011-03-19 09:45:37 +00:00
|
|
|
GstMemory *parent;
|
2012-01-19 08:12:05 +00:00
|
|
|
gsize maxsize;
|
|
|
|
gsize align;
|
|
|
|
gsize offset;
|
|
|
|
gsize size;
|
2011-03-18 17:35:42 +00:00
|
|
|
};
|
|
|
|
|
2011-03-30 16:45:08 +00:00
|
|
|
/**
|
|
|
|
* GstMapFlags:
|
|
|
|
* @GST_MAP_READ: map for read access
|
|
|
|
* @GST_MAP_WRITE: map for write access
|
2011-12-19 16:00:18 +00:00
|
|
|
* @GST_MAP_FLAG_LAST: first flag that can be used for custom purposes
|
2011-03-30 16:45:08 +00:00
|
|
|
*
|
|
|
|
* Flags used when mapping memory
|
|
|
|
*/
|
2011-03-18 18:28:17 +00:00
|
|
|
typedef enum {
|
2012-07-03 11:45:03 +00:00
|
|
|
GST_MAP_READ = GST_LOCK_FLAG_READ,
|
|
|
|
GST_MAP_WRITE = GST_LOCK_FLAG_WRITE,
|
2011-12-19 16:00:18 +00:00
|
|
|
|
|
|
|
GST_MAP_FLAG_LAST = (1 << 16)
|
2011-03-18 18:28:17 +00:00
|
|
|
} GstMapFlags;
|
2012-07-09 14:02:50 +00:00
|
|
|
|
2012-07-04 10:03:32 +00:00
|
|
|
/**
|
|
|
|
* GST_MAP_READWRITE:
|
|
|
|
*
|
|
|
|
* GstMapFlags value alias for GST_MAP_READ | GST_MAP_WRITE
|
|
|
|
*/
|
|
|
|
#define GST_MAP_READWRITE (GST_MAP_READ | GST_MAP_WRITE)
|
|
|
|
|
2011-03-18 18:28:17 +00:00
|
|
|
|
2012-01-20 13:23:57 +00:00
|
|
|
/**
|
|
|
|
* GstMapInfo:
|
|
|
|
* @memory: a pointer to the mapped memory
|
2012-01-24 13:37:25 +00:00
|
|
|
* @flags: flags used when mapping the memory
|
2012-06-23 11:37:16 +00:00
|
|
|
* @data: (array length=size): a pointer to the mapped data
|
2012-01-20 13:23:57 +00:00
|
|
|
* @size: the valid size in @data
|
|
|
|
* @maxsize: the maximum bytes in @data
|
2012-02-23 14:32:33 +00:00
|
|
|
* @user_data: extra private user_data that the implementation of the memory
|
|
|
|
* can use to store extra info.
|
2012-01-20 13:23:57 +00:00
|
|
|
*
|
|
|
|
* A structure containing the result of a map operation such as
|
|
|
|
* gst_memory_map(). It contains the data and size.
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
GstMemory *memory;
|
2012-01-24 13:37:25 +00:00
|
|
|
GstMapFlags flags;
|
2012-01-20 15:10:26 +00:00
|
|
|
guint8 *data;
|
2012-01-20 13:23:57 +00:00
|
|
|
gsize size;
|
|
|
|
gsize maxsize;
|
2012-08-11 21:19:32 +00:00
|
|
|
/*< protected >*/
|
2012-02-23 14:32:33 +00:00
|
|
|
gpointer user_data[4];
|
2012-09-10 10:20:15 +00:00
|
|
|
|
|
|
|
/*< private >*/
|
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2012-01-20 13:23:57 +00:00
|
|
|
} GstMapInfo;
|
|
|
|
|
2012-03-29 11:34:50 +00:00
|
|
|
/**
|
|
|
|
* GST_MAP_INFO_INIT:
|
|
|
|
*
|
|
|
|
* Initializer for #GstMapInfo
|
|
|
|
*/
|
2016-04-06 16:23:20 +00:00
|
|
|
#define GST_MAP_INFO_INIT { NULL, (GstMapFlags) 0, NULL, 0, 0, { NULL, NULL, NULL, NULL}, {NULL, NULL, NULL, NULL}}
|
2012-01-24 13:37:25 +00:00
|
|
|
|
2011-03-30 16:45:08 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryMapFunction:
|
|
|
|
* @mem: a #GstMemory
|
2012-01-19 08:12:05 +00:00
|
|
|
* @maxsize: size to map
|
2011-03-30 16:45:08 +00:00
|
|
|
* @flags: access mode for the memory
|
|
|
|
*
|
|
|
|
* Get the memory of @mem that can be accessed according to the mode specified
|
2012-01-19 08:12:05 +00:00
|
|
|
* in @flags. The function should return a pointer that contains at least
|
|
|
|
* @maxsize bytes.
|
2011-03-30 16:45:08 +00:00
|
|
|
*
|
2012-01-19 08:12:05 +00:00
|
|
|
* Returns: a pointer to memory of which at least @maxsize bytes can be
|
|
|
|
* accessed according to the access pattern in @flags.
|
2011-03-30 16:45:08 +00:00
|
|
|
*/
|
2012-01-19 08:12:05 +00:00
|
|
|
typedef gpointer (*GstMemoryMapFunction) (GstMemory *mem, gsize maxsize, GstMapFlags flags);
|
2011-03-30 16:45:08 +00:00
|
|
|
|
2015-06-03 14:03:16 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryMapFullFunction:
|
|
|
|
* @mem: a #GstMemory
|
|
|
|
* @info: the #GstMapInfo to map with
|
|
|
|
* @maxsize: size to map
|
|
|
|
*
|
|
|
|
* Get the memory of @mem that can be accessed according to the mode specified
|
|
|
|
* in @info's flags. The function should return a pointer that contains at least
|
|
|
|
* @maxsize bytes.
|
|
|
|
*
|
|
|
|
* Returns: a pointer to memory of which at least @maxsize bytes can be
|
|
|
|
* accessed according to the access pattern in @info's flags.
|
|
|
|
*/
|
|
|
|
typedef gpointer (*GstMemoryMapFullFunction) (GstMemory *mem, GstMapInfo * info, gsize maxsize);
|
|
|
|
|
2011-03-30 16:45:08 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryUnmapFunction:
|
|
|
|
* @mem: a #GstMemory
|
|
|
|
*
|
2012-01-19 08:12:05 +00:00
|
|
|
* Return the pointer previously retrieved with gst_memory_map().
|
2011-03-30 16:45:08 +00:00
|
|
|
*/
|
2012-01-19 08:12:05 +00:00
|
|
|
typedef void (*GstMemoryUnmapFunction) (GstMemory *mem);
|
2011-03-30 16:45:08 +00:00
|
|
|
|
2015-06-03 08:03:36 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryUnmapFullFunction:
|
|
|
|
* @mem: a #GstMemory
|
2015-06-03 14:03:16 +00:00
|
|
|
* @info: a #GstMapInfo
|
2015-06-03 08:03:36 +00:00
|
|
|
*
|
2015-06-03 14:03:16 +00:00
|
|
|
* Return the pointer previously retrieved with gst_memory_map() with @info.
|
2015-06-03 08:03:36 +00:00
|
|
|
*/
|
2015-06-03 14:03:16 +00:00
|
|
|
typedef void (*GstMemoryUnmapFullFunction) (GstMemory *mem, GstMapInfo * info);
|
2015-06-03 08:03:36 +00:00
|
|
|
|
2011-03-30 16:45:08 +00:00
|
|
|
/**
|
|
|
|
* GstMemoryCopyFunction:
|
|
|
|
* @mem: a #GstMemory
|
|
|
|
* @offset: an offset
|
2011-11-11 01:47:30 +00:00
|
|
|
* @size: a size or -1
|
2011-03-30 16:45:08 +00:00
|
|
|
*
|
|
|
|
* Copy @size bytes from @mem starting at @offset and return them wrapped in a
|
|
|
|
* new GstMemory object.
|
|
|
|
* If @size is set to -1, all bytes starting at @offset are copied.
|
|
|
|
*
|
|
|
|
* Returns: a new #GstMemory object wrapping a copy of the requested region in
|
|
|
|
* @mem.
|
|
|
|
*/
|
2011-11-11 01:47:30 +00:00
|
|
|
typedef GstMemory * (*GstMemoryCopyFunction) (GstMemory *mem, gssize offset, gssize size);
|
2011-03-30 16:45:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstMemoryShareFunction:
|
|
|
|
* @mem: a #GstMemory
|
|
|
|
* @offset: an offset
|
2011-11-11 01:47:30 +00:00
|
|
|
* @size: a size or -1
|
2011-03-30 16:45:08 +00:00
|
|
|
*
|
|
|
|
* Share @size bytes from @mem starting at @offset and return them wrapped in a
|
|
|
|
* new GstMemory object. If @size is set to -1, all bytes starting at @offset are
|
|
|
|
* shared. This function does not make a copy of the bytes in @mem.
|
|
|
|
*
|
|
|
|
* Returns: a new #GstMemory object sharing the requested region in @mem.
|
|
|
|
*/
|
2011-11-11 01:47:30 +00:00
|
|
|
typedef GstMemory * (*GstMemoryShareFunction) (GstMemory *mem, gssize offset, gssize size);
|
2011-03-30 16:45:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GstMemoryIsSpanFunction:
|
|
|
|
* @mem1: a #GstMemory
|
2011-06-05 17:11:22 +00:00
|
|
|
* @mem2: a #GstMemory
|
2011-03-30 16:45:08 +00:00
|
|
|
* @offset: a result offset
|
|
|
|
*
|
|
|
|
* Check if @mem1 and @mem2 occupy contiguous memory and return the offset of
|
|
|
|
* @mem1 in the parent buffer in @offset.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if @mem1 and @mem2 are in contiguous memory.
|
|
|
|
*/
|
2011-03-30 14:47:55 +00:00
|
|
|
typedef gboolean (*GstMemoryIsSpanFunction) (GstMemory *mem1, GstMemory *mem2, gsize *offset);
|
2011-03-18 17:35:42 +00:00
|
|
|
|
2012-07-05 15:11:01 +00:00
|
|
|
void gst_memory_init (GstMemory *mem, GstMemoryFlags flags,
|
|
|
|
GstAllocator *allocator, GstMemory *parent,
|
|
|
|
gsize maxsize, gsize align,
|
|
|
|
gsize offset, gsize size);
|
2013-02-26 14:37:24 +00:00
|
|
|
|
|
|
|
gboolean gst_memory_is_type (GstMemory *mem, const gchar *mem_type);
|
|
|
|
|
2011-03-22 19:51:06 +00:00
|
|
|
/* refcounting */
|
2012-06-14 14:30:12 +00:00
|
|
|
/**
|
|
|
|
* gst_memory_ref:
|
|
|
|
* @memory: The memory to refcount
|
|
|
|
*
|
|
|
|
* Increase the refcount of this memory.
|
|
|
|
*
|
|
|
|
* Returns: (transfer full): @memory (for convenience when doing assignments)
|
|
|
|
*/
|
|
|
|
static inline GstMemory *
|
|
|
|
gst_memory_ref (GstMemory * memory)
|
|
|
|
{
|
|
|
|
return (GstMemory *) gst_mini_object_ref (GST_MINI_OBJECT_CAST (memory));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gst_memory_unref:
|
|
|
|
* @memory: (transfer full): the memory to refcount
|
|
|
|
*
|
|
|
|
* Decrease the refcount of an memory, freeing it if the refcount reaches 0.
|
|
|
|
*/
|
|
|
|
static inline void
|
|
|
|
gst_memory_unref (GstMemory * memory)
|
|
|
|
{
|
|
|
|
gst_mini_object_unref (GST_MINI_OBJECT_CAST (memory));
|
|
|
|
}
|
2012-02-13 15:33:00 +00:00
|
|
|
|
2011-03-22 19:51:06 +00:00
|
|
|
/* getting/setting memory properties */
|
2012-02-13 15:33:00 +00:00
|
|
|
gsize gst_memory_get_sizes (GstMemory *mem, gsize *offset, gsize *maxsize);
|
|
|
|
void gst_memory_resize (GstMemory *mem, gssize offset, gsize size);
|
2011-03-18 17:35:42 +00:00
|
|
|
|
2012-07-04 14:38:15 +00:00
|
|
|
#define gst_memory_lock(m,f) gst_mini_object_lock (GST_MINI_OBJECT_CAST (m), (f))
|
|
|
|
#define gst_memory_unlock(m,f) gst_mini_object_unlock (GST_MINI_OBJECT_CAST (m), (f))
|
|
|
|
#define gst_memory_is_writable(m) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (m))
|
2012-08-21 11:30:52 +00:00
|
|
|
#define gst_memory_make_writable(m) GST_MEMORY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (m)))
|
2012-07-04 14:38:15 +00:00
|
|
|
|
2011-06-07 15:34:17 +00:00
|
|
|
/* retrieving data */
|
2016-03-05 14:27:35 +00:00
|
|
|
GstMemory * gst_memory_make_mapped (GstMemory *mem, GstMapInfo *info, GstMapFlags flags) G_GNUC_WARN_UNUSED_RESULT;
|
2012-02-13 15:33:00 +00:00
|
|
|
gboolean gst_memory_map (GstMemory *mem, GstMapInfo *info, GstMapFlags flags);
|
|
|
|
void gst_memory_unmap (GstMemory *mem, GstMapInfo *info);
|
2011-03-29 17:17:55 +00:00
|
|
|
|
2011-03-22 19:51:06 +00:00
|
|
|
/* copy and subregions */
|
2016-03-05 14:27:35 +00:00
|
|
|
GstMemory * gst_memory_copy (GstMemory *mem, gssize offset, gssize size) G_GNUC_WARN_UNUSED_RESULT;
|
|
|
|
GstMemory * gst_memory_share (GstMemory *mem, gssize offset, gssize size) G_GNUC_WARN_UNUSED_RESULT;
|
2011-03-18 20:45:39 +00:00
|
|
|
|
2011-03-29 17:17:55 +00:00
|
|
|
/* span memory */
|
2012-02-13 15:33:00 +00:00
|
|
|
gboolean gst_memory_is_span (GstMemory *mem1, GstMemory *mem2, gsize *offset);
|
2011-03-30 14:47:55 +00:00
|
|
|
|
2015-11-10 17:38:59 +00:00
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstMemory, gst_memory_unref)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
|
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstAllocator, gst_object_unref)
|
|
|
|
#endif
|
|
|
|
|
2011-03-18 17:35:42 +00:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GST_MEMORY_H__ */
|