fdmemory: add flag to avoid close of the fd
[platform/upstream/gstreamer.git] / gst-libs / gst / allocators / gstfdmemory.h
index e2da2d7..40c90d0 100644 (file)
@@ -45,6 +45,8 @@ typedef struct _GstFdAllocatorClass GstFdAllocatorClass;
  *        keep it mapped until the memory is destroyed.
  * @GST_FD_MEMORY_FLAG_MAP_PRIVATE: do a private mapping instead of
  *        the default shared mapping.
+ * @GST_FD_MEMORY_FLAG_DONT_CLOSE: don't close the file descriptor when
+ *        the memory is freed. Since: 1.10.
  *
  * Various flags to control the operation of the fd backed memory.
  *
@@ -54,6 +56,7 @@ typedef enum {
   GST_FD_MEMORY_FLAG_NONE = 0,
   GST_FD_MEMORY_FLAG_KEEP_MAPPED = (1 << 0),
   GST_FD_MEMORY_FLAG_MAP_PRIVATE = (1 << 1),
+  GST_FD_MEMORY_FLAG_DONT_CLOSE  = (1 << 2),
 } GstFdMemoryFlags;
 
 /**
@@ -82,6 +85,10 @@ GstMemory *     gst_fd_allocator_alloc  (GstAllocator * allocator, gint fd,
 gboolean        gst_is_fd_memory        (GstMemory *mem);
 gint            gst_fd_memory_get_fd    (GstMemory *mem);
 
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstFdAllocator, gst_object_unref)
+#endif
+
 G_END_DECLS
 
 #endif /* __GST_FD_ALLOCATOR_H__ */