Commit graph

2918 commits

Author SHA1 Message Date
Matthew Waters
650e5c4fe5 glmemory: implement GstGLBaseMemory::alloc
- Create GstGLVideoAllocationParams which is a GstGLAllocationParams subclass.
- Make it possible to allocate glmemory objects directly if no frills are
  needed.
2015-12-17 13:49:55 +11:00
Matthew Waters
bd61e1274c glbasememory: add a generic interface for allocating GL memories
This is made possible by a subclassable GstGLAllocationParams that holds
the allocation parameters

Every allocation would now go through gst_gl_base_memory_alloc with the
allocation parameters now being specified in a single struct to allow
extension by different allocators.
2015-12-17 13:49:55 +11:00
Matthew Waters
640476fcba Revert "glbuffer: Don't pass allocation params"
This reverts commit 052f41e5c2.

This is incorrect and will affect any other glbuffer user that needs/wants to
perform data alignment.
2015-12-17 11:06:34 +11:00
Nicolas Dufresne
052f41e5c2 glbuffer: Don't pass allocation params
The imported memory has already been allocated, passing allocation
parameters with alignment confuses the memory which endup with a
size different from maxsize and lead to overrun when the memory
is being copied.
2015-12-16 12:07:17 -05:00
Alessandro Decina
c1720963e4 glupload: fix allocator name after GLMemory API changes 2015-12-16 17:03:03 +11:00
Nicolas Dufresne
4c19b415bd gl: Allow using non-system mesa with both GL and GLES
GCC automatically disable redundance warnings for system headers. As
soon as we start using a non-system installed mesa, we would start
having issues. The test for both wasn't setting any flags, so it would
work but then fail at runtime.

This is being fixed by disabling in the code (where needed only) that
GCC warning. The test is also fixed to avoid the false positive we had.
2015-12-15 19:28:22 -05:00
Xavier Claessens
598ddaee72 bad: Add g_autoptr() support to all types
https://bugzilla.gnome.org/show_bug.cgi?id=754464
2015-12-14 14:45:38 -05:00
Luis de Bethencourt
91eb51dda1 glviewconvert: check pointer before dereferencing
priv->primary_out could be NULL, check before dereferencing it in
GST_BUFFER_FLAG_SET ()

CID 1308945
2015-12-14 12:32:14 +00:00
Matthew Waters
41c3cb30d4 glbuffer: bind/unbind on map/unmap for GL mappings
Bind the handle to the GL target on map/unmap to save the caller from
handling this themselves.
2015-12-14 18:22:58 +11:00
Matthew Waters
5d0d2ec6ca glbuffer: remove buffer specific transfer flags
Instead rely on GstGLBaseMemory's transfer handling
2015-12-14 18:22:27 +11:00
Matthew Waters
b12f2be4b1 glmemorypbo: map/unmap pbo memory correctly for state tracking
Otherwise some downloads will fail to occur from the PBO.
2015-12-14 18:22:07 +11:00
Matthew Waters
359d0a31ee glformat: add compatibility definitions for OES/rectangle textures 2015-12-14 17:05:31 +11:00
Matthew Waters
4c8f264686 glbasebuffer: remove unsed memory subclass
The functionality has been split into GstGLBaseMemory and GstGLBuffer.
2015-12-14 16:35:34 +11:00
Matthew Waters
2b7495bbc1 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.
2015-12-14 16:35:32 +11:00
Matthew Waters
6cf8da132b gl: add a GL buffer based GstMemory
Heavily based on GstGLBaseBuffer that is a subclass of GstGLBaseMemory.
Provides GPU and CPU accessible GL buffer objects by GL handle or by
sysmem data pointer.
2015-12-14 16:34:54 +11:00
Matthew Waters
27e724df8f gl: add a base memory object
It handles the following
- GstAllocationParams -> gst_memory_init transformation
- Makes sure that map/unmap/create/destroy happen on the GL thread with
  a GL context current.
- Holds a possible sysmem accessible data pointer with alignment.
- Holds the need upload/download transfer state
2015-12-14 13:55:16 +11:00
Matthew Waters
51636b451c gl: add convenience function for the start of a video frame
Get's the start of the video frame based on a GstVideoInfo and
GstVideoAlignment.
2015-12-14 13:55:16 +11:00
Matthew Waters
3591c6bfa0 gluploadmeta; remove convenience helper API
It was not really useful as if one knows about libgstgl, one can just use
GLMemory objects directly.
2015-12-14 13:55:16 +11:00
Matthew Waters
50337e601e gldownload: remove helper api from the library
It was never used by anyone and is not needed anymore with the element
and GstGLMemory's transparent support for downloading textures.
2015-12-14 13:55:16 +11:00
Alessandro Decina
1d862db9c1 libgstgl: gstglcontext_cocoa: kCGLPFAStereo has been deprecated in 10.11
Also since the version scheme has changed (to include the micro number) since
10.10, use the MAC_OS_X_VERSION_* macro to avoid confusion.
2015-12-10 14:46:27 +11:00
Alessandro Decina
11ca761c5d glbufferpool: relax check for multiple texture targets
Only complain about multiple texture targets when _different_ texture targets
are configured.
2015-12-10 14:46:27 +11:00
Alessandro Decina
5cd0601dd5 glmemory: take subsampling into account for rectangle textures
Rectangle textures don't use normalized coordinates so subsampling needs to be
factored in explicitly.

Fixes YUV => RGB conversion for rectangle textures.
2015-12-10 14:46:27 +11:00
Thiago Santos
2fdd5dca14 adaptivedemux: avoid pushing events with manifest lock
It can be an easy source of deadlocks. Reproducible with very
fast connections (local server).
2015-12-08 16:12:37 -03:00
Matthew Waters
44c5985edd glproto: include function definitions for GL_APPLE_sync
Provides a performance improvement on iOS where we were falling back to glFinish
on settting sync points.
2015-12-08 18:08:28 +11:00
Nicolas Dufresne
d84d1708b7 glupload: Only offer custom allocator with caps features
To use GLMemory and EGLImage allocators, one need to know the
libgstgl API. This is only expected if the associated caps features
have been negotiated. Generic element that otherwise receive those
allocators may fail, resulting in broken pieline. We don't want to
force all generic element to check if the allocator is a custom
allocator or a normal allocator (which implement the _alloc method).

https://bugzilla.gnome.org/show_bug.cgi?id=758877
2015-12-04 17:08:46 -05:00
Sebastian Dröge
280de75d89 adaptivedemux: Log PTS of buffers that are pushed downstream 2015-12-03 10:08:53 +02:00
Matthew Waters
c8099e6e71 glcolorconvert: improve the YUY2/UYVY->RGBA conversion shader
Don't offset the y-axis.  We only need to offset on the x-axis.

Removes a sawtooth pattern on horizontal and vertical edges.

https://bugzilla.gnome.org/show_bug.cgi?id=755486
2015-12-02 22:52:20 +11:00
Matthew Waters
0b11eba96a glcolorconvert: improve RGBA->YUY2/UYVY conversion shader
We should only average the chroma samples not the luma sample.

https://bugzilla.gnome.org/show_bug.cgi?id=758904
2015-12-02 22:52:20 +11:00
Jan Schmidt
08544a459b adaptivedemux: Send the bitrate of the stream as a tag
If we know or can measure the nominal bitrate of a stream,
send that info as a tag downstream
2015-12-02 22:29:38 +11:00
Reynaldo H. Verdejo Pinochet
c564a043d1 Drop usage of deprecated g-ir-scanner --strip-prefix flag 2015-12-02 00:20:01 -08:00
Tim-Philipp Müller
64adb1998d hlsdemux: fix crash when decryption key can't be downloaded
Happened with
http://sslhls.m6tv.cdn.sfr.net/hls-live/livepkgr/_definst_/m6_hls_aes/m6_hls_aes_856.m3u8
if glib-networking was not installed (since key has https uri).
2015-12-01 18:01:36 +00:00
Reynaldo H. Verdejo Pinochet
86ec812429 Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
2015-11-18 16:05:42 -08:00
Sebastian Dröge
74ab40470c glviewconvert: String literals are const
gstglviewconvert.c: In function '_mangle_extensions':
gstglviewconvert.c:1511:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
     ext_str = "#extension GL_OES_EGL_image_external : require\n";
             ^
2015-11-17 17:09:51 +02:00
Sebastian Dröge
e2ea7843f9 glsyncmeta: Actually return the newly created meta from gst_buffer_add_gl_sync_meta()
gstglsyncmeta.c  -fPIC -DPIC -o .libs/libgstgl_1.0_la-gstglsyncmeta.o
gstglsyncmeta.c: In function 'gst_buffer_add_gl_sync_meta':
gstglsyncmeta.c:131:1: error: control reaches end of non-void function [-Werror=return-type]
 }
 ^
2015-11-17 17:08:14 +02:00
Matthew Waters
67327615df glsyncmeta: add vfuncs for all operations
there could be other ways/requirements for synchronising two GPU command
streams (whether GL or platform specific).

e.g. glfencesync/eglwaitnative/cond/etc
2015-11-17 15:27:26 +11:00
Matthew Waters
79f4efb02a glviewconvert: add support rectangle/external-oes textures
https://bugzilla.gnome.org/show_bug.cgi?id=757285
2015-11-17 15:27:26 +11:00
Tim-Philipp Müller
1491d02c4e adaptivedemux: remove now-defunct "num-lookback-fragments" property
This no longer does anything, and it was marked as CONSTRUCT_ONLY
which means someone would really have to go out of their way to
be able to set this, which would only be done in very custom
scenarios, if ever, and those will likely target a specific
version of GStreamer then, so probably not much point keeping
it deprecated for a while before removing it.
2015-11-14 20:28:34 +00:00
Vineeth TM
6eae0c7e18 glsl: fix possible string overrun in gst_glsl_version_profile_from_string
given a NULL-terminated string, s.
s[i] = '\0';
i++;
does not guarentee that s[i] is NULL terminated and thus string operations
could read off the end of the array.

https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Matthew Waters
babd066b89 glshader: don't read invalid list pointers (use after free)
gst_gl_shader_detach_unlocked already removes the list entry so attempting to
use the element to iterate to the next stage could read invalid data.

Based on patch by Vineeth TM <vineeth.tm@samsung.com>

https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Vineeth TM
4c9ac5e474 glsl: free str while returning error
https://bugzilla.gnome.org/show_bug.cgi?id=758039
2015-11-13 17:00:46 +11:00
Vineeth TM
550ecade4d glslstage: Fix vertex_sources memory leak
vertex_sources is being allocated but not freed resulting in leak

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
591401f9e8 glcolorconvert: remove unnecessary free
version_str is already being freed. So no need to call again

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
ba4802e1e5 glcolorconvert: Fix string leak
String got using gst_glsl_version_profile_to_string, is allocated
memory and should be freed

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Vineeth TM
b8adc98ddc glcolorconvert: Fix frag_prog and frag_body memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=757974
2015-11-12 21:23:21 +11:00
Florin Apostol
4994f068d5 adaptivedemux: fixed handling errors emitted by uri handler
https://bugzilla.gnome.org/show_bug.cgi?id=757947
2015-11-11 17:56:19 +01:00
Matthew Waters
aada44cc09 glcolorconvert: mangle gl_FragColor for GL3
Some drivers don't provide the compatibility definition and we need to provide
our own 'out vec4' variable to put the results of the fragment shader into.

https://bugzilla.gnome.org/show_bug.cgi?id=757938
2015-11-11 23:42:02 +11:00
Matthew Waters
50b59150fd glviewconvert: remove set_format
We need the caps to be able to
1. check the caps features
2. get the requested texture-target on input/output
2015-11-11 15:16:37 +11:00
Matthew Waters
f24e768cc3 glshader: properly unref the stages on failure
When failing in the varargs functions, all the stage objects not handled need to
be unreffed to prevent a leak.
2015-11-11 14:41:38 +11:00
Matthew Waters
8d8063060e glslstage: properly return an error when we could not create the shader stage
While it was erroring out correctly later, there were GLib warnings about
setting a GError over the top of another GError.
2015-11-11 11:29:35 +11:00
Matthew Waters
21bd8ee536 glshaderstrings: fixup the external-oes fragment shader
The wrong sampler type was used
s/sampler2DExternalOES/samplerExternalOES/
2015-11-11 01:27:21 +11:00