diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-16 15:57:35 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2012-01-16 15:57:35 +0100 |
commit | c96d5a330ca7895cfd1d6875562c7a5010bc693a (patch) | |
tree | e48c12ba2a873b0656999bb1fd1adaebe7dd3ad8 /gst/gstmemory.h | |
parent | 4eb0c8ae07affe59157b04959a497c8c9f83a771 (diff) |
memory: make writability check into a method
Use a method to check for writability instead of a macro so that we can change
the implementation more easily.
Diffstat (limited to 'gst/gstmemory.h')
-rw-r--r-- | gst/gstmemory.h | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/gst/gstmemory.h b/gst/gstmemory.h index 0268da1a2..f0756aeac 100644 --- a/gst/gstmemory.h +++ b/gst/gstmemory.h @@ -56,16 +56,6 @@ typedef enum { } GstMemoryFlags; /** - * GST_MEMORY_IS_WRITABLE: - * @mem: a #GstMemory - * - * Check if @mem is writable. - */ -#define GST_MEMORY_IS_WRITABLE(mem) (((mem)->refcount == 1) && \ - (((mem)->parent == NULL) || ((mem)->parent->refcount == 1)) && \ - (((mem)->flags & GST_MEMORY_FLAG_READONLY) == 0)) - -/** * GstMemory: * @allocator: pointer to the #GstAllocator * @flags: memory flags @@ -289,24 +279,26 @@ GstMemory * gst_memory_new_wrapped (GstMemoryFlags flags, gpointer data, GFr gsize maxsize, gsize offset, gsize size); /* refcounting */ -GstMemory * gst_memory_ref (GstMemory *mem); -void gst_memory_unref (GstMemory *mem); +GstMemory * gst_memory_ref (GstMemory *mem); +void gst_memory_unref (GstMemory *mem); /* getting/setting memory properties */ -gsize gst_memory_get_sizes (GstMemory *mem, gsize *offset, gsize *maxsize); -void gst_memory_resize (GstMemory *mem, gssize offset, gsize size); +gsize gst_memory_get_sizes (GstMemory *mem, gsize *offset, gsize *maxsize); +void gst_memory_resize (GstMemory *mem, gssize offset, gsize size); /* retrieving data */ -gpointer gst_memory_map (GstMemory *mem, gsize *size, gsize *maxsize, - GstMapFlags flags); -gboolean gst_memory_unmap (GstMemory *mem, gpointer data, gssize size); +gboolean gst_memory_is_writable (GstMemory *mem); + +gpointer gst_memory_map (GstMemory *mem, gsize *size, gsize *maxsize, + GstMapFlags flags); +gboolean gst_memory_unmap (GstMemory *mem, gpointer data, gssize size); /* copy and subregions */ -GstMemory * gst_memory_copy (GstMemory *mem, gssize offset, gssize size); -GstMemory * gst_memory_share (GstMemory *mem, gssize offset, gssize size); +GstMemory * gst_memory_copy (GstMemory *mem, gssize offset, gssize size); +GstMemory * gst_memory_share (GstMemory *mem, gssize offset, gssize size); /* span memory */ -gboolean gst_memory_is_span (GstMemory *mem1, GstMemory *mem2, gsize *offset); +gboolean gst_memory_is_span (GstMemory *mem1, GstMemory *mem2, gsize *offset); G_END_DECLS |