Commit graph

87 commits

Author SHA1 Message Date
Nicola Murino
3c6d775766 glupload: fix some memory leaks
https://bugzilla.gnome.org/show_bug.cgi?id=741943
2015-01-13 15:19:39 +11:00
Nicolas Dufresne
9954de1ccd gl: Add support for GstVideoAlignment
This allow saving a copy with libav video decoders or decoders with
similar padding requirement.

https://bugzilla.gnome.org/show_bug.cgi?id=740900
2014-12-19 12:11:08 -05:00
Sebastian Dröge
0f753b7099 glupload: Fix valid compiler warning
gstglupload.c:442:32: error: if statement has empty body [-Werror,-Wempty-body]
    if (upload->texture_ids[i]);
                               ^
2014-11-24 11:32:33 +01:00
Matthew Waters
810d38c29f glupload: rearchitecture for non GLMemory inputs/outputs
Allows other memory types to be implemented/returned/used by the caller.
2014-11-23 17:13:36 +11:00
Matthew Waters
82a3a34475 glupload: fallback to upload if contexts cannot share GL resources
Fixes pipelines of the form

    gleffects ! tee ! glimagesink

as tee does not pass on the allocation query.
2014-09-23 12:02:18 +10:00
Matthew Waters
5b8d7a443e glupload: provide the output buffer that is rendered into
Allows callers to properly reference count the buffers used for
rendering.

Fixes a redraw race in glimagesink where the previous buffer
(the one used for redraw operations) is freed as soon as the next
buffer is uploaded.

1. glimagesink uploads in _prepare() to texture n
1.1 glupload holds buffer n
2. glimagesink _render()s texture n
3. glimagesink uploads texture n+1
3.1 glupload free previous buffer which deletes texture n
3.2 glupload holds buffer n+1
4. glwindow resize/expose
5. glimagesink redraws with texture n

The race is that the buffer n (the one used for redrawing) is freed as soon as
the buffer n+1 arrives.  There could be any amount of time and number of
redraws between this event and when buffer n+1 is actually rendered and thus
replaces buffer n as the redraw source.

https://bugzilla.gnome.org/show_bug.cgi?id=736740
2014-09-21 21:36:49 +10:00
Wang Xin-yu (王昕宇)
ba822e1dd0 glupload: don't determine if frame needs upload by pointer compare
https://bugzilla.gnome.org/show_bug.cgi?id=734269
2014-08-06 14:47:52 +10:00
Matthew Waters
89636392fa glmemory: use GstVideoInfo everywhere
Simplifies a lot of the calling code

https://bugzilla.gnome.org/show_bug.cgi?id=733717
2014-07-31 15:19:54 +10:00
Matthew Waters
59088f5a90 glupload: always release the previous buffer
Fixes the case where _perform_with_buffer() is called without
intervening calls to _release_buffer() as is the case on start up
with glimagesink.

Also release the buffer when reseting the upload.

https://bugzilla.gnome.org/show_bug.cgi?id=731107
2014-06-03 14:03:21 +10:00
Matthew Waters
da35876537 glfeature: remove GST_GL_API_GLES3
instead check the gl version using gst_gl_context_check_gl_version()
2014-05-30 10:29:37 +10:00
Sebastian Dröge
f56aa3e32c glupload: Fix assertion after API changes 2014-05-29 10:37:02 +02:00
Matthew Waters
07919d874c gl/upload: re add the upload meta to the private struct
try and avoid being to trigger happy
2014-05-29 16:45:37 +10:00
Matthew Waters
eff3da8871 gl/upload: small code cleanup and gst-indent 2014-05-29 16:30:14 +10:00
Matthew Waters
aa102d2660 gl/upload: use GstObject's lock instead of our own 2014-05-29 16:30:13 +10:00
Matthew Waters
f7f92e6d7a gl/colorconvert: allocate output buffers
Allows the nop optimisation by simply reffing the input buffer.
2014-05-29 16:30:13 +10:00
Matthew Waters
6ce3b82efe gl/upload: add GstGLUploadMeta object
That simply deals with the provider aspect of GstVideoGLTextureUploadMeta.
2014-05-28 14:41:35 +10:00
Matthew Waters
60b6ef981e gl/colorconvert: operate on buffers instead of memories 2014-05-27 21:59:12 +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
2d0a791348 glupload: Ensure we still have a texture after upload_set_format()
gst_gl_upload_set_format() resets the upload, hence the texture.
So we need to ensure we have a texture after this call when
uploading.
2014-05-12 18:26:12 -04:00
Nicolas Dufresne
864e1511c7 glupload: Correctly update the video info from video meta
Using gst_video_info_set_format() isn't complete when updating
a video info from video meta.
2014-05-12 18:26:12 -04:00
Nicolas Dufresne
4f84a6124a glupload: Correctly update video info in upload fallback
When the upload accelerated method fails, we fallback to an upload,
but the video info was not correctly updated.
2014-05-12 18:26:12 -04:00
Julien Isorce
d93cd25e2d gl/upload: set out_tex after reset, not before
Fix a regression introduced recently with the lazy init.
It was happening when calling gst_video_gl_texture_upload_meta_upload
from an aplication. So not using gst_gl_upload_perform_with_buffer.
2014-05-12 13:43:19 +01:00
Matthew Waters
f14e5ea027 gl/upload: update the video info on mapping a video frame
The buffer should contain the most specific data on how the data is
formatted.  We should use this information.

https://bugzilla.gnome.org/show_bug.cgi?id=729896
2014-05-12 22:13:19 +10:00
Matthew Waters
a4f0fbe4c3 gl/upload: avoid performing color conversion when there is no need
One such example is when the buffer contains GstGLMemory in the
RGBA format

https://bugzilla.gnome.org/show_bug.cgi?id=729278
2014-05-12 22:09:32 +10:00
Matthew Waters
0c92f185c4 gl/upload: update the respective state when we cache textures/data 2014-05-11 10:45:34 +10:00
Matthew Waters
ecae7a1a41 gl/upload: cache the textures that we are using 2014-05-10 23:54:34 +10:00
Matthew Waters
c6e3f51ca5 gl/upload: avoid recreating the GLMemory struct for output textures 2014-05-10 23:05:03 +10:00
Nicolas Dufresne
afea9c6fe1 gl: Fix some of the error handling 2014-05-09 18:59:46 -04:00
Nicolas Dufresne
803f2c3dc0 glupload: Update GstVideoInfo after the buffer is mapped
gst_video_frame_map() will store an updated video info base
on the video meta. In order to have the right stride and offset
we should update that video info accordingly.
2014-05-09 17:59:43 -04:00
Matthew Waters
34b55f33f2 gl/colorconvert: implement lazy init 2014-05-09 22:32:11 +10:00
Julien Isorce
dff8abd57a gl/upload: set initted to TRUE when _init_upload succeeded 2014-05-09 13:07:16 +01:00
Matthew Waters
ffe2c1f3c1 gl/upload: fix compilation on OS X 2014-05-08 17:28:11 +10:00
Matthew Waters
b0b630c69c gl/upload: fail propoerly if init fails 2014-05-08 15:40:33 +10:00
Matthew Waters
c247be334a gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2014-05-08 15:33:43 +10: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
5405273b0a gl/upload: add get_format method
Simply retreives the format set by init_format
2014-05-08 14:03:57 +10:00
Julien Isorce
d4fe519c2e gl: do not allocate the target texture of an EGLImage
The target texture of an EGLImage is the texture bind just
before calling glEGLImageTargetTexture2D.

As we currently only support a gl texture as the source of an EGLImage
the gl texture is actually already allocated when creating the eglimage.

I also see some cases where it fails to upload an eglimage when
glTexImage2D is called on the target.
2014-05-06 15:39:12 +01:00
Julien Isorce
dd8929a272 gl: delete texture used with GstVideoGLTextureUploadMeta 2014-05-06 15:39:12 +01: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
Julien Isorce
1ced9b1005 gl: fix declaration-definition mismatch for _init_upload 2014-04-23 21:10:07 +01:00
Matthew Waters
a05d62d5ca gl/color: pass large value by reference
Coverity 1199700
2014-04-12 18:18:08 +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
95abfda139 gl: add colorconvert object that converts between color spaces/formats
Currently used by both upload and download objects separately.
2014-04-11 10:37:05 +10:00
Matthew Waters
e01e2cce9f gl: pass video info's by reference 2014-04-02 23:05:47 +11:00
Matthew Waters
6d452f60ee gl/upload: add support for the bt709 color matrix 2014-03-25 00:34:13 +11:00
Matthew Waters
f55b299826 gl/upload: remove the legacy GL 1.x upload path
uploading requires shaders and fbos available in GL2.
2014-03-24 23:19:02 +11:00
Matthew Waters
870503dc6b gl: silence all the compiler warnings 2014-03-16 15:17:44 +01:00
Matthew Waters
13aa186711 [881/906] upload: restore default values for unpack_length
fixes elements that upload a supplementary texture (glbumber,
gldifferencematte, etc)
2014-03-15 18:37:06 +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