Commit graph

20 commits

Author SHA1 Message Date
Matthew Waters
3c1c5e9d83 glcontext: remove not thread-safe get/set_error()
Use GError's instead if necessary.
2017-12-09 19:32:21 +00:00
Matthew Waters
1153684a94 glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2017-12-09 19:32:21 +00:00
Guillaume Desmottes
b23a008ab6 gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2017-12-09 19:32:20 +00:00
Matthew Waters
04e92acd3b glbasememory: take a pointer as the wrapped gpu handle
Allows passing arbitrary data to wrap the the specific memory implementation
which is required for some memory implementations.
2017-12-09 19:32:19 +00:00
Matthew Waters
99dfbf8ed9 glmemorypbo: unmap pbo memory on pbo read error
Otherwise we are returning failure with a dangling map!

Also only unset the NEED_DOWNLOAD flag in download_transfer() if the read actually
succeeds.
2017-12-09 19:32:18 +00:00
Matthew Waters
18a812a30f gl*memory: document new functionality and objects 2017-12-09 19:32:17 +00:00
Matthew Waters
0cf1eaf71a glbasememory: Free the actual memory object when requested
Otherwise we are leaking ~400B on each GstMemory allocation.

Freeing in the base class matches the GObject semantics.
2017-12-09 19:32:14 +00:00
Matthew Waters
880d2798b0 glmemorypbo: don't double read pixels
The optimistic download_transfer was not setting the required flag to not
perform glReadPixels on subsequent map (READ). resulting in glReadPixels
happening twice.
2017-12-09 19:32:14 +00:00
Matthew Waters
5ba0ab3da9 glmemory: expose gst_gl_memory_texsubimage
Removes extremely similar code from glmemorypbo.
2017-12-09 19:32:14 +00:00
Matthew Waters
48fbc9e096 glmemorypbo: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=759679
2017-12-09 19:32:14 +00:00
Matthew Waters
633c26884e glmemorypbo: fix wrapping data on GL 2.1
GL 2.1 only supports pbo upload.

The wrapped data pointer was only being set on the pbo memory and on the
glmemory so when a download was requested (in GL 2.1), glmemory was
allocating a new data pointer and thus not returning the wrapped data.
2017-12-09 19:32:14 +00:00
Matthew Waters
5aca58ce86 glmemorypbo: only create a pbo memory if the context actually supports it
e.g. GL <= 2.0 does not support pbo usage and GL 2.1 only supports pbo upload.
2017-12-09 19:32:14 +00:00
Matthew Waters
3695ab353d glmemory: small code reformat
makes the alloc_params selections fit on a single line.
2017-12-09 19:32:14 +00:00
Sebastian Dröge
45d7796949 glmemorypbo: Comment out unused functions to fix compilation with clang
It's not clear if these are intentionally unused or the code should be
changed, but this fixes compilation for the time being at least.

See https://bugzilla.gnome.org/show_bug.cgi?id=759679
2017-12-09 19:32:13 +00:00
Matthew Waters
09c8c23842 gl*memory*: reverse the parameter order of user_data and destroy notify
The convention is to have the destroy notify last after any user data
2017-12-09 19:32:13 +00:00
Matthew Waters
1673a6192f glmemorypbo: remove our own alloc()/wrapped()/etc functions
replaced by equivalent functionality within gst_gl_base_memory_alloc()
2017-12-09 19:32:13 +00:00
Matthew Waters
c870a9cdd5 glbuffer: remove unneeded gst_gl_buffer_alloc()
Replaced by gst_gl_base_memory_alloc()
2017-12-09 19:32:13 +00:00
Matthew Waters
228481da18 glmemorypbo: implement GstGLBaseMemory:alloc
Uses the GstGLVideoAllocationParams parameters
2017-12-09 19:32:12 +00:00
Matthew Waters
f83b834628 glmemorypbo: map/unmap pbo memory correctly for state tracking
Otherwise some downloads will fail to occur from the PBO.
2017-12-09 19:32:12 +00:00
Matthew Waters
76a38dd66a glmemory: base classify and add the pbo memory on top
The base class is useful for having multiple backing memory types other
than the default.  e.g. IOSurface, EGLImage, dmabuf?

The PBO transfer logic is now inside GstGLMemoryPBO which uses GstGLBuffer
to manage the PBO memory.

This also moves the format utility functions into their own file.
2017-12-09 19:32:12 +00:00