Commit graph

172 commits

Author SHA1 Message Date
Matthew Waters
bf9c8544e3 gl: use the bufferpool's upload when available
Avoids duplicating GL resources

https://bugzilla.gnome.org/show_bug.cgi?id=728872
2017-12-09 19:31:39 +00:00
Julien Isorce
0455cb610a glimagesink: use new helper function to avoid duplicating default shader text 2017-12-09 19:31:38 +00:00
Julien Isorce
c52dd44e60 gl: fails glimagesink when shader compilation went wrong
Those shaders are fixed and very simple so it should not fail
but it's worth to handle a such case.
2017-12-09 19:31:37 +00:00
Julien Isorce
4844c53017 gl: call glClearColor before glClear 2017-12-09 19:31:37 +00:00
Sebastian Dröge
569f1363f4 glimagesink: Use the pixel-aspect-ratio adjusted width/height when centering the frame in the display area
Makes sure we actually keep the display aspect ratio
2017-12-09 19:31:37 +00:00
Sebastian Dröge
889e92e738 glimagesink: By default keep the display aspect ratio
Also the default for the pixel-aspect-ratio should be 1/1, not 0/1.
2017-12-09 19:31:37 +00:00
Sebastian Dröge
fc607b3c53 glimagesink: Call gst_object_unref() on the GstGL GObjects again
While they're plain GObjects it does not hurt to call gst_object_unref()
on them and potentially allows to debug reference leaks a bit easier.
2017-12-09 19:31:37 +00:00
Sebastian Dröge
2b38f86b4e glimagesink: If creating a context or upload failed, destroy it
Fixes deadlocks in error cases when later code assumes the broken
context is actually usable.

https://bugzilla.gnome.org/show_bug.cgi?id=728761
2017-12-09 19:31:37 +00:00
Vincent Penquerc'h
f230f758e7 gl: a couple spelling/grammar fixes 2017-12-09 19:31:37 +00:00
Vincent Penquerc'h
d6a87fb0c3 gl: guard against using a NULL window pointer
Coverity 1195145
2017-12-09 19:31:37 +00:00
Matthew Waters
9eb5001e02 glimagesink: remove unused texture 2017-12-09 19:31:36 +00:00
Matthew Waters
57b4bd6905 glimagesink: move upload into _prepare() 2017-12-09 19:31:36 +00:00
Sebastian Dröge
aab3ef1b5d glimagesink: First handle GL window setup, then create the context and its thread 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
Sebastian Dröge
4ecffcf76b glimagesink: Create GL context and set up window from the streaming thread
gst_gl_context_create() might need to dispatch some operations to the
application's main thread, and calling this in the change_state function
can cause deadlocks.
2017-12-09 19:31:36 +00:00
Matthew Waters
a20a5d36e2 gl: pass video info's by reference 2017-12-09 19:31:35 +00:00
Matthew Waters
71548893bf gl: avoid adding a NULL pool to propose allocation 2017-12-09 19:31:35 +00:00
Julien Isorce
0233939eaa gl: only set CAPS_FEATURE_MEMORY_EGL_IMAGE on egl platform 2017-12-09 19:31:35 +00:00
Julien Isorce
6614df6478 gl: let the user includes itself our egl headers if needed
Forgot to address this change.

https://bugzilla.gnome.org/show_bug.cgi?id=703343
2017-12-09 19:31:35 +00:00
Julien Isorce
c2471aec81 gl: add EGLImage support
* picked from old libgstegl:
  - GstEGLImageMemory
  - GstEGLImageAllocator
  - last_buffer management from removed GstEGLImageBufferPool

* add-ons:
  - GstEGLImageMemory now old a reference on GstGLContext
    so that it can delete the EGLImage and its gltexture source
    while having the associated gl context being current.
  - add EGLImage support for GstVideoGLTextureUploadMeta which
    mainly call EGLImageTargetTexture2D
  - GstGLBufferPool now supports GstEGLImageAllocator
  - glimagesink / glfilters / etc.. now propose GstEGLImageAllocator
    to upstream

https://bugzilla.gnome.org/show_bug.cgi?id=703343
2017-12-09 19:31:35 +00:00
Matthew Waters
a884d6feee move gl elements to ext subdirectory 2017-12-09 19:31:34 +00:00