diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-20 14:23:57 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-25 11:54:23 +0100 |
commit | a521252845cacc5152d2b00e850ba6eaceef2963 (patch) | |
tree | c3c3b585042094d610889f86c944ce7c12706f78 /gst/gstmemory.h | |
parent | ea7c1225c1e4f890dcc71a25143036467e3f02b8 (diff) |
Add new GstMapInfo
Use a structure to hold info about the mapping. The application then keeps track
of this state and we can use it to unmap the memory again later.
Diffstat (limited to 'gst/gstmemory.h')
-rw-r--r-- | gst/gstmemory.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/gst/gstmemory.h b/gst/gstmemory.h index 4e000fead..3013d6dfa 100644 --- a/gst/gstmemory.h +++ b/gst/gstmemory.h @@ -99,6 +99,23 @@ typedef enum { } GstMapFlags; /** + * GstMapInfo: + * @memory: a pointer to the mapped memory + * @data: a pointer to the mapped data + * @size: the valid size in @data + * @maxsize: the maximum bytes in @data + * + * A structure containing the result of a map operation such as + * gst_memory_map(). It contains the data and size. + */ +typedef struct { + GstMemory *memory; + gpointer data; + gsize size; + gsize maxsize; +} GstMapInfo; + +/** * GST_MAP_READWRITE: * * Map for readwrite access @@ -260,9 +277,8 @@ void gst_memory_resize (GstMemory *mem, gssize offset, gsize size); /* retrieving data */ gboolean gst_memory_is_writable (GstMemory *mem); -gpointer gst_memory_map (GstMemory *mem, gsize *size, gsize *maxsize, - GstMapFlags flags); -void gst_memory_unmap (GstMemory *mem); +gboolean gst_memory_map (GstMemory *mem, GstMapInfo *info, GstMapFlags flags); +void gst_memory_unmap (GstMemory *mem, GstMapInfo *info); /* copy and subregions */ GstMemory * gst_memory_copy (GstMemory *mem, gssize offset, gssize size); |