Commit graph

144 commits

Author SHA1 Message Date
Matthew Waters
df6967c274 glcolorconvert: fix planar YUV download
- sample the u and v planes properly
- output the correctly scaled u and v planes for different chroma block sizes
2017-12-09 19:31:48 +00:00
Matthew Waters
a771b40474 glcolorconvert: fix UYVY download green screen 2017-12-09 19:31:47 +00:00
Matthew Waters
ea711807d8 glcolrconvert: fix YUY2 download
- The shader was outputing the wrong values compared with raw
  videotestsrc.
- deal with the texture edge properly.
- properly sample the 2x1 rectangle for the u and v values
- don't double sample the y value
2017-12-09 19:31:47 +00:00
Matthew Waters
e6bd70d580 glcolorconvert: convert xRGB into ARGB properly
The alpha channel might not be the last component so check which one
it is in and clobber that one instead.
2017-12-09 19:31:47 +00:00
Matthew Waters
c216799b20 glmemory: use GstVideoInfo everywhere
Simplifies a lot of the calling code

https://bugzilla.gnome.org/show_bug.cgi?id=733717
2017-12-09 19:31:45 +00:00
Matthew Waters
2b82b78ef5 glmemory: reenable the texture_rg support for !eagl
The GST_GL_HAVE_PLATFORM_EAGL is always defined we need to compare
against the value instead.
2017-12-09 19:31:44 +00:00
Wang Xin-yu (王昕宇)
2ce11e4bac gl: fix multi gl object leaks
1. fix FBO leaks in decide_allocation
2. fix texture leaks in decide_allocation and reset
3. fix texture leaks in FBO incomplete error path
2017-12-09 19:31:44 +00:00
Sebastian Dröge
f6ae4ab243 eagl: Disable usage of R and RG textures on iOS
They don't work currently and just render zeroes, while the
fallback code path with LUM and LUM_ALPHA textures still works.

https://bugzilla.gnome.org/show_bug.cgi?id=732390
2017-12-09 19:31:44 +00:00
Matthew Waters
216b5ec9a8 glcolorconvert: free pixel swizzling information 2017-12-09 19:31:44 +00:00
Matthew Waters
4a8b31afd6 glfeature: remove GST_GL_API_GLES3
instead check the gl version using gst_gl_context_check_gl_version()
2017-12-09 19:31:42 +00:00
Matthew Waters
5009338a50 gl/colorconvert: keep our private pointer
again, avoid to much trigger
2017-12-09 19:31:42 +00:00
Matthew Waters
04b2144ff1 gl/colorconvert: use GstObject's lock instead of our own 2017-12-09 19:31:42 +00:00
Matthew Waters
1544f66f26 gl/colorconvert: remove unnecassary pointer inderection 2017-12-09 19:31:42 +00:00
Matthew Waters
8cf3a3a4f4 gl/colorconvert: optimise the same format case
simply return the input buffer unchanged
2017-12-09 19:31:41 +00:00
Matthew Waters
4fe67d48be gl/colorconvert: fix YUY2/UYVY download for RG/LA textures 2017-12-09 19:31:41 +00:00
Matthew Waters
8ac92cd90d gl/colorconvert: allocate output buffers
Allows the nop optimisation by simply reffing the input buffer.
2017-12-09 19:31:41 +00:00
Tim-Philipp Müller
06351d4d9b glcolorconvert: fix compiler warning
gstglcolorconvert.c:1133:11: error: 'j' may be used uninitialized in this function

Was used uninitialized when jumping to out label
in error case.
2017-12-09 19:31:41 +00:00
Matthew Waters
625efc1757 gl/colorconvert: operate on buffers instead of memories 2017-12-09 19:31:41 +00:00
Nicolas Dufresne
73c73470a0 glcolorconvert: Fix YUY2 and UYVY support with luminance_alpha
https://bugzilla.gnome.org/show_bug.cgi?id=730666
2017-12-09 19:31:41 +00:00
Matthew Waters
2279713aa0 gl/colorconvert: remove scratch texture for YUY2/UYVY
We can get all our data from the one RG/LA texture with some shader magic.

https://bugzilla.gnome.org/show_bug.cgi?id=728890
2017-12-09 19:31:41 +00:00
Matthew Waters
132a233f7b 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
2017-12-09 19:31:41 +00:00
Matthew Waters
313dfbb500 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
2017-12-09 19:31:41 +00:00
Matthew Waters
5efb69304a gl/colorconvert: fix up alpha clobbering
Previously it would only work if the alpha value was in the last
component (RGBx, BGRx).  Now it works wherever the alpha value may
be (xRGB, xBGR, etc).
2017-12-09 19:31:40 +00:00
Matthew Waters
07b6bfeaa7 gl/colorconvert: use the texture scaling from the gl memory
The colorconvert values were not being used at all.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2017-12-09 19:31:40 +00:00
Matthew Waters
480784e368 gl/convert: clobber alpha channel when needed
Needed in the conversion from padded RGB formats to formats with an
alpha channel.  e.g. BGRx -> ABGR, etc

https://bugzilla.gnome.org/show_bug.cgi?id=729742
2017-12-09 19:31:40 +00:00
Matthew Waters
ae283ec9da gl/colorconvert: choose the right alpha component for AYUV -> RGBA 2017-12-09 19:31:40 +00:00
Nicolas Dufresne
5c8acc21fe gl: Fix some of the error handling 2017-12-09 19:31:40 +00:00
Matthew Waters
f213321083 gl/colorconvert: preserve alpha in AYUV <-> RGBA conversions
https://bugzilla.gnome.org/show_bug.cgi?id=729743
2017-12-09 19:31:40 +00:00
Matthew Waters
977c326c59 gl/colorconvert: implement lazy init 2017-12-09 19:31:40 +00:00
Matthew Waters
857200ff40 gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2017-12-09 19:31:39 +00:00
Julien Isorce
4b0e037fa4 gl: use gst_gl_context_gen_shader helper instead of duplicating code 2017-12-09 19:31:39 +00:00
Matthew Waters
33091ff6a5 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.
2017-12-09 19:31:38 +00:00
Julien Isorce
959aae65c0 gl: fix string literal warning
warning: format not a string literal, argument types not checked [-Wformat-nonliteral]
2017-12-09 19:31:38 +00:00
Jan Schmidt
c891eedb79 glcolorconvert: Fix bt709 conversion matrices.
Fix the sign on one entry in the bt.709 YUV->RGB conversion
matrix, and the corresponding inverse matrix. Fixes really
wrong colouring of some videos.
2017-12-09 19:31:37 +00:00
Julien Isorce
9062658bc7 gl/color: restore viewport dimensions when fbo done
Regression introduced by 95abfda139.
It caused to display the wrong frame size when resizing the window.
2017-12-09 19:31:36 +00:00
Julien Isorce
e7dc1d787e gl/color: fix warning type qualifiers ignored
i686-apple-darwin11-llvm-gcc-4.2
"warning: type qualifiers ignored on function return type"
2017-12-09 19:31:36 +00:00
Matthew Waters
a321fa998a gl/color: remove if statement with no effect
Coverity 1199698
2017-12-09 19:31:36 +00:00
Matthew Waters
92c243be62 gl/color: pass large value by reference
Coverity 1199700
2017-12-09 19:31:36 +00:00
Matthew Waters
1ce0c5356f gl/color: explicitly map the buffers we are copying into
Otherwise it may not be downloaded at all.
2017-12-09 19:31:36 +00:00
Matthew Waters
50ff50c10e gl/color: cache the temporary textures 2017-12-09 19:31:36 +00:00
Matthew Waters
7c77c31afd gl: fixup incorrect number of arguments 2017-12-09 19:31:36 +00:00
Matthew Waters
12ecf507b8 gl: fix incorrect usage of g_return_if_fail 2017-12-09 19:31:36 +00:00
Matthew Waters
30c6efc432 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.
2017-12-09 19:31:36 +00:00
Matthew Waters
fba49c3463 gl: add colorconvert object that converts between color spaces/formats
Currently used by both upload and download objects separately.
2017-12-09 19:31:36 +00:00