mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
memory: Use lock flags for map flags
We implement the locking in gst_memory_map with the lock flags, make matching flags the same number so that we can use the map flags directly as lock flags.
This commit is contained in:
parent
76b30712f5
commit
61a9de98d9
1 changed files with 19 additions and 18 deletions
|
@ -155,6 +155,23 @@ struct _GstMemory {
|
|||
gsize size;
|
||||
};
|
||||
|
||||
/**
|
||||
* GstLockFlags:
|
||||
* @GST_LOCK_FLAG_READ: lock for read access
|
||||
* @GST_LOCK_FLAG_WRITE: lock for write access
|
||||
* @GST_LOCK_FLAG_EXCLUSIVE: lock for exclusive access
|
||||
* @GST_LOCK_FLAG_LAST: first flag that can be used for custom purposes
|
||||
*
|
||||
* Flags used when locking memory
|
||||
*/
|
||||
typedef enum {
|
||||
GST_LOCK_FLAG_READ = (1 << 0),
|
||||
GST_LOCK_FLAG_WRITE = (1 << 1),
|
||||
GST_LOCK_FLAG_EXCLUSIVE = (1 << 2),
|
||||
|
||||
GST_LOCK_FLAG_LAST = (1 << 4)
|
||||
} GstLockFlags;
|
||||
|
||||
/**
|
||||
* GstMapFlags:
|
||||
* @GST_MAP_READ: map for read access
|
||||
|
@ -164,8 +181,8 @@ struct _GstMemory {
|
|||
* Flags used when mapping memory
|
||||
*/
|
||||
typedef enum {
|
||||
GST_MAP_READ = (1 << 0),
|
||||
GST_MAP_WRITE = (1 << 1),
|
||||
GST_MAP_READ = GST_LOCK_FLAG_READ,
|
||||
GST_MAP_WRITE = GST_LOCK_FLAG_WRITE,
|
||||
|
||||
GST_MAP_FLAG_LAST = (1 << 16)
|
||||
} GstMapFlags;
|
||||
|
@ -464,22 +481,6 @@ gst_memory_unref (GstMemory * memory)
|
|||
}
|
||||
|
||||
/* locking */
|
||||
/**
|
||||
* GstLockFlags:
|
||||
* @GST_LOCK_FLAG_READ: lock for read access
|
||||
* @GST_LOCK_FLAG_WRITE: lock for write access
|
||||
* @GST_LOCK_FLAG_EXCLUSIVE: lock for exclusive access
|
||||
* @GST_LOCK_FLAG_LAST: first flag that can be used for custom purposes
|
||||
*
|
||||
* Flags used when locking memory
|
||||
*/
|
||||
typedef enum {
|
||||
GST_LOCK_FLAG_READ = (1 << 0),
|
||||
GST_LOCK_FLAG_WRITE = (1 << 1),
|
||||
GST_LOCK_FLAG_EXCLUSIVE = (1 << 2),
|
||||
|
||||
GST_LOCK_FLAG_LAST = (1 << 4)
|
||||
} GstLockFlags;
|
||||
|
||||
gboolean gst_memory_is_exclusive (GstMemory *mem);
|
||||
|
||||
|
|
Loading…
Reference in a new issue