Commit graph

43 commits

Author SHA1 Message Date
Matthew Waters
dbffcffaee gl/memory: allocate the correct memory size
and avoid wasting resources we will never need

https://bugzilla.gnome.org/show_bug.cgi?id=730703
2014-05-25 11:45:59 +10:00
Matthew Waters
13402f0b98 gl/memory: provide compatability defines
fixes build on android/OS X
2014-05-23 12:07:50 +10:00
Matthew Waters
9a0129a0e4 gl/memory: RGBA/UNSIGNED_BYTE only format supported by ReadPixels GLES2
Error out in case we attempt to read with any other invalid format.
2014-05-23 11:25:11 +10:00
Matthew Waters
0c8ccd8c5f gl/memory: generate textures with a sized internal format
Required in order to generate RG and RED textured with GLES3.
2014-05-23 11:25:11 +10:00
Matthew Waters
001b92ba12 gl/memory: implement GL_EXT_texture_rg support
Which is used by default over the Luminance formats due to it
being color renderable with fbos (and deprecation/removal with
GL 3.x).

https://bugzilla.gnome.org/show_bug.cgi?id=729750
https://bugzilla.gnome.org/show_bug.cgi?id=704222
https://bugzilla.gnome.org/show_bug.cgi?id=728890
2014-05-23 11:25:11 +10:00
Matthew Waters
2da979831e gl/upload: switch the 'master' texture for YUY2, UYVY
From d4bcef3204 on, using a RGBA
texture to hold the data causes the glmemory to have half width
and a scaling of [2, 1].  Using a LA texture solves this problem
however cannot be attached to the framebuffer for copying into
a RGBA texture.  Which will be solved by moving to EXT_texture_rg.

https://bugzilla.gnome.org/show_bug.cgi?id=728890
2014-05-21 10:26:21 +10:00
Nicolas Dufresne
d4bcef3204 glmemory: Fix handling of stride with alignement larger then 8
Setting a scaled factor for X coordinate is not enough as the indexer
will still think stride is shorter and will not fully skip it. Instead,
update width, so the lines are as expected. Combined with the scale, it
will hide the cropped portion.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2014-05-13 11:43:45 -04:00
Matthew Waters
a49a371710 gl/upload: implement lazy init
Rename init_format to set_format
2014-05-08 15:33:43 +10:00
Matthew Waters
598a79a5e2 gl/mem: implement texture copying between formats with strides properly
Previously, we used the width to determine the amount of data to be
copied using pbos.  This, makes it allocate enough data for the
the strides as well.
2014-05-01 14:00:04 +10:00
Nicolas Dufresne
9205bcdedb glmemory: User g_slice_new0 to ensure fully initilized structure
The pbo pointer not being initialized would trigger a use of unitilialized variable
in valgrind.
2014-04-23 12:42:44 -04:00
Vincent Penquerc'h
6ec86ca1dc gl: prevent division by 0 on unsupported texture type
Coverity 1199697
2014-04-21 13:23:45 +01:00
Matthew Waters
b69e1f42bb gl/mem: cache the stride/unpack length for upload 2014-04-11 17:26:09 +10:00
Matthew Waters
d92eb6dbbe gl/mem: provide defines for tokens not defined in GLES2/ancient platforms 2014-04-11 11:04:43 +10:00
Matthew Waters
15d0c04933 gl/mem: allocate the memory per plane
This patch provides the basic infrastructure required for this.
Upload and Download has been ported to this.

Has the nice effect of allowing GstGLMemory to be our
refcounted texture object for any texture type (not just RGBA).

Should not lose any features/video formats.
2014-04-11 10:37:06 +10:00
Matthew Waters
e01e2cce9f gl: pass video info's by reference 2014-04-02 23:05:47 +11:00
Matthew Waters
870503dc6b gl: silence all the compiler warnings 2014-03-16 15:17:44 +01:00
Matthew Waters
cd7bfb92d4 [876/906] glmem: use GstVideoInfo for format configuration
Allows use of strides
2014-03-15 18:37:06 +01:00
Matthew Waters
4386cc1c6b [873/906] upload: use GstVideoInfo for choosing the format 2014-03-15 18:37:05 +01:00
Matthew Waters
49a19fb6b1 [865/906] glmem: report successful copy to the caller 2014-03-15 18:37:05 +01:00
Matthew Waters
aa573cf138 [858/906] glmem: update the docs 2014-03-15 18:37:05 +01:00
Matthew Waters
4322266b97 [843/906] memory: provide copy_into_texture 2014-03-15 18:37:04 +01:00
Matthew Waters
b90d824626 [838/906] gl: Use GL_TEXTURE_2D instead of GL_TEXTURE_RECTANGLE
We create our textures (in Desktop GL) with GL_TEXTURE_RECTANGLE,
vaapi attempts to bind our texture to GL_TEXTURE_2D which throws a
GL_INVALID_OPERATION error and as thus, no video.

Also, by moving exclusively to GL_TEXTURE_2D and the npot extension
we also remove a difference between the Desktop GL and GLES2 code.

https://bugzilla.gnome.org/show_bug.cgi?id=712287
2014-03-15 18:37:03 +01:00
Matthew Waters
2313cea524 [819/906] make gen_texture/del_texture threadsafe
Use stack allocated instead of static variables

Conflicts:
	gst-libs/gst/gl/gstglutils.c
2014-03-15 18:37:02 +01:00
Matthew Waters
9b22b0e0ba [812/906] move the GL vtable from GstGLDisplay to GstGLContext
Conflicts:
	tests/check/libs/gstglcontext.c
2014-03-15 18:37:02 +01:00
Matthew Waters
f590a1ce23 [780/906] up/download: check return values
So we fail properly
2014-03-15 18:37:00 +01:00
Matthew Waters
71a70e78f6 [763/906] memory: copy properly depending on where the most recent data is 2014-03-15 18:36:59 +01:00
Julien Isorce
dd7e054e2c [732/906] build: fix repeated typedefs
Write forward declarations in another way to avoid
repeated typedefs "error: redefinition of typedef".
Raised when using i686-apple-darwin11-llvm-gcc-4.2
It seems that C apple compiler does not support
C11 feature.

https://bugzilla.gnome.org/show_bug.cgi?id=703885
2014-03-15 18:36:57 +01:00
Matthew Waters
2d69905592 [703/906] x11: don't segfault if destroy_cb is NULL 2014-03-15 18:36:55 +01:00
Matthew Waters
dbeb6a911b [701/906] display: move context creation into window 2014-03-15 18:36:55 +01:00
Matthew Waters
96114e62cb [699/906] display: remove list of upload and download objects
and only create an up/download object when needed.
2014-03-15 18:36:55 +01:00
Matthew Waters
74209b9e9e [677/906] memory: fix GSIZE printf format on win32 2014-03-15 18:36:54 +01:00
Matthew Waters
7b03a572d9 [647/906] remove dependecy on glew 2014-03-15 18:36:52 +01:00
Matthew Waters
fa3c3b8434 [642/906] add gstglconfig.h for apps to find out what our capabilites are
ie libgstgl can be compiled with any combination of opengl/gles2
2014-03-15 18:36:52 +01:00
Matthew Waters
cc8e54541b [624/906] OPENGL_ES2 => HAVE_GLES2 and add HAVE_OPENGL
use GstGLAPI to determine which code paths to execute.
perform some cleanups
2014-03-15 18:36:51 +01:00
Matthew Waters
93f7e993ad [603/906] update FSF address 2014-03-15 18:36:50 +01:00
Matthew Waters
12bf1cfa27 [600/906] docs: add docs for new objects and expand on some existing ones 2014-03-15 18:36:49 +01:00
Matthew Waters
fad1b94c41 [592/906] memory: update for up/download API changes 2014-03-15 18:36:49 +01:00
Matthew Waters
28863c4bb4 [586/906] fix up some debug statements to get them into the right categories 2014-03-15 18:36:49 +01:00
Matthew Waters
5d1395f435 [574/906] memory: implement transperent upload/download for data
(not async yet)
2014-03-15 18:36:48 +01:00
Matthew
20406c1de3 [567/906] fix OpenGL|ES2 ifdef'ed code 2014-03-15 18:36:47 +01:00
Matthew Waters
0ef8174881 [554/906] GstGLMemory: update for GstAllocator API changes 2014-03-15 18:36:47 +01:00
Matthew Waters
2141571de9 [521/906] GstGLMemory: update for GstAllocator changes 2014-03-15 18:36:45 +01:00
Matthew Waters
1331611094 [514/906] add GstGLMemory and allocator
implement custom GstMemory for GL textures
currently map/unmap returns NULL although it might be favourable to upload/download/cache the image data
2014-03-15 18:36:44 +01:00