summaryrefslogtreecommitdiff
path: root/gst-libs/gst/gl/gstglmemory.h
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2015-06-11 18:26:50 +1000
committerMatthew Waters <matthew@centricular.com>2015-06-12 16:59:20 +1000
commitc3a47c910d3ce0da1bc5742389e2b8adf6667914 (patch)
treeb717c36182afe0696a03e8aa5a555906ca25c575 /gst-libs/gst/gl/gstglmemory.h
parent7d8d1f8206cc5303309f8951e863b20e8fd905d0 (diff)
glmemory: separate pbo transfer from texture transfers
When supported, the potentially longer pbo upload/download can be initiated before the texture upload/download, potentially increasing throughput.
Diffstat (limited to 'gst-libs/gst/gl/gstglmemory.h')
-rw-r--r--gst-libs/gst/gl/gstglmemory.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/gst-libs/gst/gl/gstglmemory.h b/gst-libs/gst/gl/gstglmemory.h
index 66b6c20f4..d124c7cbd 100644
--- a/gst-libs/gst/gl/gstglmemory.h
+++ b/gst-libs/gst/gl/gstglmemory.h
@@ -41,6 +41,15 @@ GType gst_gl_allocator_get_type(void);
#define GST_GL_ALLOCATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GL_ALLOCATOR, GstGLAllocatorClass))
#define GST_GL_ALLOCATOR_CAST(obj) ((GstGLAllocator *)(obj))
+typedef enum _GstGLMemoryTransfer
+{
+ /* force a transfer between the texture and the PBO (if available) */
+ GST_GL_MEMORY_TRANSFER_NEED_UPLOAD = (1 << 0),
+ GST_GL_MEMORY_TRANSFER_NEED_DOWNLOAD = (1 << 1),
+} GstGLMemoryTransfer;
+
+#define GST_GL_MEMORY_ADD_TRANSFER(mem,state) ((GstGLMemory *)mem)->transfer_state |= state
+
/**
* GstGLMemory:
* @mem: the parent object
@@ -68,6 +77,7 @@ struct _GstGLMemory
gfloat tex_scaling[2];
/* <private> */
+ GstGLMemoryTransfer transfer_state;
gboolean texture_wrapped;
GDestroyNotify notify;
gpointer user_data;
@@ -112,6 +122,9 @@ GstGLMemory * gst_gl_memory_wrapped_texture (GstGLContext * context,
gpointer user_data,
GDestroyNotify notify);
+void gst_gl_memory_download_transfer (GstGLMemory * gl_mem);
+void gst_gl_memory_upload_transfer (GstGLMemory * gl_mem);
+
gboolean gst_gl_memory_copy_into_texture (GstGLMemory *gl_mem,
guint tex_id,
GstVideoGLTextureType tex_type,