Commit graph

2636 commits

Author SHA1 Message Date
Matthew Waters
dec8139e65 gl/calayer: provide the exact GL api version for the wrapped context
Otherwise we could end up being mistaken for the diference between a
gl3 and a gl2 context resulting in a failure getting the list of
extensions from the wrapped context due to the difference between
glGetString and glGetStringi for the GL_EXTENSIONS token.

https://bugzilla.gnome.org/show_bug.cgi?id=749728
2015-05-23 01:26:05 +10:00
Xavier Claessens
1a98face84 gl: win32: do not call SetParent in release_parent_win_id()
When called from gst_gl_window_win32_close(), internal window
could not exist, and if it does it's going to be destroyed just
after that anyway. Also it causes window_proc() to be called
and crash because it gets a NULL context.

When called from gst_gl_window_win32_set_window_handle() we are
going to set another parent anyway, and it's probably better to
reparent directly instead of passing by a NULL parent which could
cause the internal window to popup briefly.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 16:58:11 -04:00
Xavier Claessens
ae77afeb74 gl: win32: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 16:58:11 -04:00
Xavier Claessens
247697ce62 gl: win32: fix crash when finalizing GstGLContext
gst_gl_context_finalize() is calling gst_gl_window_win32_quit()
which was posting a message. But then window_proc takes window's
context and get a NULL.

Now that we've got a GMainLoop we can do like other backends and
simply call g_main_loop_quit().

This also remove duplicated code to release the parent window and
potential crash there because parent_proc could be NULL if we never
created the internal window. That could happen for example if setting
state to READY then setting a window_handle, and go back to NULL state.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
e1a827822e gl: win32: Fix leaked GstGLContext
https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:53 -04:00
Xavier Claessens
0acc18c60f gl: win32: set the parent window when creating internal window
When _set_window_handle() was called in READY state, it wasn't
set to the internal window created later.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Xavier Claessens
e24bc348bd gl: win32: use a GMainContext to dispatch win32 messages
gst_gl_window_win32_send_message_async() could be called before the
internal window is created so we cannot use PostMessage there.

x11 and wayland backends both create a custom GSource for this,
so there is no reason to not do that for win32.

https://bugzilla.gnome.org/show_bug.cgi?id=749601
2015-05-21 14:33:52 -04:00
Jan Schmidt
c9372ae33f glupload: Don't leak all memory uploaded via raw uploads.
Remove an extra ref missed when switching over to not
reusing output textures
2015-05-22 00:28:25 +10:00
Matthew Waters
e9f0d0fb51 glcontext: require a shader version to initialize.
It's very near pointless to try our GL implementation without shaders.

https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-21 15:07:38 +10:00
Xavier Claessens
7ca9f52ccb gl: fix crash on windows with intel driver
https://bugzilla.gnome.org/show_bug.cgi?id=749430
2015-05-20 00:56:44 +10:00
Matthew Waters
2e58daf196 gl/calayer: provide a current wrapped GstGLContext for callbacks
So that the draw and resize callbacks can get the current GstGLContext.
2015-05-20 00:36:48 +10:00
Matthew Waters
81e46e8b75 glsyncmeta: ensure that the Fence is going to be executed
Otherwise it could stay client side without being submitted to the GL
server resulting in another context waiting on a Fence that will never
become signalled causing a deadlock.
2015-05-20 00:36:48 +10:00
Matthew Waters
2747eb1232 glupload: don't reuse output textures for raw data upload
Causes stale textures to be used further down the chain.
2015-05-20 00:36:48 +10:00
Matthew Waters
2352545bee glframebuffer: don't clear the framebuffer
Breaks attempting to blend with the destination buffer and should be done
explicitly by the callback anyway.
2015-05-19 11:11:02 +10:00
Matthew Waters
ddc4f1ffbd glbasefilter: track gl_start/stop correctly
Don't start multiple times without calling gl_stop.
2015-05-19 11:09:54 +10:00
Matthew Waters
1e9c30223e glcontext/cocoa: implement GL3 core context selection 2015-05-14 20:35:18 +10:00
Matthew Waters
0870e8785e gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
2015-05-14 16:42:09 +10:00
Matthew Waters
e1b077d6af glshader: attempt to detect the gles2 inside opengl3 case
This is necessary to use gles2 shaders in a GL 3 core context on
OS X which fails without a proper #version being set on the shaders.
2015-05-14 14:58:07 +10:00
Matthew Waters
3d0bc93edc glshader: remove references to gl3 specific shaders
We rely specifically on gles2 shaders being supported by the GL
implementation with GL3 core profile.
2015-05-14 14:58:07 +10:00
Matthew Waters
7f7a9dd3ec gl: element buffers are part of vao state
Use them as such.  They are also required for GL3 core profile support
with glDrawElements on OS X.
2015-05-14 14:58:07 +10:00
Matthew Waters
ba5130fe01 glmemory: properly detect (hopefully) the correct ext_rg/arb_rg variant
GL_EXT_texture_rg is only valid for GLES2. GLES3 uses similar wording to
the GL_ARB_texture_rg which requires a sized internal format that the
GL_EXT_texture_rg does not require.

https://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_rg.txt
https://www.opengl.org/registry/specs/ARB/texture_rg.txt
2015-05-14 14:58:07 +10:00
Matthew Waters
0871b7b43d compositor: implement proper par handling
We were previously failing on different input and output par
2015-05-14 14:58:07 +10:00
Thiago Santos
61cad123d7 adaptivedemux: drop debug message that was wrong
EOS doesn't necessarily mean that no fragment was downloaded
2015-05-13 13:35:14 -03:00
Thiago Santos
8331b083ee adaptivedemux: run gst-indent
To allow commiting on this file cleanly
2015-05-13 13:35:14 -03:00
Matthew Waters
07dffe9e5b glcontext: propagate the version/extension failure upwards
Otherwise the calling code has no idea that the context failed to
be created fully.

https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-13 23:56:48 +10:00
Matthew Waters
1853e455ac gl: don't deadlock on context creation failure
https://bugzilla.gnome.org/show_bug.cgi?id=749284
2015-05-13 23:56:48 +10:00
Sebastian Dröge
53c79cbf86 Revert "gl: readd glupload/download onto element pads"
This reverts commit 87d8270f30.
2015-05-06 15:46:49 +02:00
Jimmy Ohn
868472affb adaptivedemux: only update stream position if query success
We don't need to check about the query fail case.
because it is update to segment position even though query fail.

https://bugzilla.gnome.org/show_bug.cgi?id=748529
2015-05-05 14:33:41 -03:00
Matthew Waters
6f85a17ab3 glsyncmeta: fixup size declaration 2015-05-05 14:46:17 +10:00
Jan Schmidt
2ed71bee3b glcolorconvert: Improve passthrough check when no conversion is needed.
Make the passthrough check contingent on only the fields we
can modify being unchanged, and pre-compute it when caps
change instead of checking on each buffer. Makes the passthrough
more lenient if consumers are lax about making input and output
caps complete.
2015-05-04 13:30:13 +10:00
Sreerenj Balachandran
e6e0702821 codecparser: h265: Fix nal unit size checking
The EOS and EOB nals have the size 2 which is the size of
nal unit header itself. The gst_h265_parser_identify_nalu()
is not required to scan start code again in this case.

In other cases, for a valid nalunit the minimum required size
is 3 bytes (2 byte header and at least 1 byte RBSP payload)
2015-04-30 21:47:38 +02:00
Sreerenj Balachandran
af7ff2bd95 codecparser: h265: Calculate crop rectangle dimensions 2015-04-30 21:46:31 +02:00
Sreerenj Balachandran
877e69c9ec codecparser: h265: Fix parsing multiple SEI messages in a single SEI Nal
An SEI Nal can have more than one SEI message.

Change in API: the gst_h265_parser_parse_sei()
2015-04-30 21:45:39 +02:00
Matthew Waters
87d8270f30 gl: readd glupload/download onto element pads
Allows insertion of gl elements into non-gl pipelines without converter
(upload/download) elements.

https://bugzilla.gnome.org/show_bug.cgi?id=743974
2015-04-30 11:26:33 +10:00
Sreerenj Balachandran
8407622c93 codecparser: h265: Fix the number of tile rows/columns parsing
The possible minimum value for num_tile_columns_minus1 and num_tile_rows_minus1
is zero (7.4.3.3).

https://bugzilla.gnome.org/show_bug.cgi?id=748641
2015-04-29 19:16:48 +02:00
Edward Hervey
38c97f5fa5 adaptivedemux: Fix comparision logic
We can't answer the SEEKING query if we do *not* have the manifest
2015-04-29 15:41:07 +02:00
Jan Schmidt
1de2e2bc39 glupload: Make upload method static caps non-const.
Retrieving a GstStaticCaps does a one time internal
initialisation and caches it - they can't be stored as
const structures.
2015-04-29 02:52:40 +10:00
Matthew Waters
17084a4608 glmemory: remove uneeded unref
The call to _gl_mem_alloc_data will unref and NULLify 'dest' for us.
We just need to return.

https://bugzilla.gnome.org/show_bug.cgi?id=744246
2015-04-28 20:47:55 +10:00
Matthew Waters
0b7f65bbc3 glupload: provide the sink template caps that could be used
https://bugzilla.gnome.org/show_bug.cgi?id=746399
2015-04-28 20:13:48 +10:00
Xavier Claessens
5bfaaf4c74 egl: Use maximum bits per color instead of minimum
https://bugzilla.gnome.org/show_bug.cgi?id=748425
2015-04-27 10:45:48 -04:00
Matthew Waters
bd940327ef gl: unref display/other-context in the correct place
Otherwise state changes from PLAYING->READY->PAUSED will cause there to
to be no display configured on the element.

https://bugzilla.gnome.org/show_bug.cgi?id=748405
2015-04-27 15:20:56 +10:00
Sreerenj Balachandran
989643ff7c codecparsers: h265: add helpers to convert quantization matrices
Add utility functions to convert quantization matrices from zig-zag scan
order into raster scan order and vice-versa

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-26 21:46:25 +02:00
Sreerenj Balachandran
a86e7c1c1f codecparser: h265: skip byte alignment bits while parsing slice header
Skip the byte alignment bits as per the logic of byte_alignment()
provided in hevc specification. This will fix the calculation of
slice header size.

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-26 21:45:31 +02:00
Sreerenj Balachandran
b17a026eb7 codecparser: h265: Fix the NumDeltaPocs calculation
Always use the equation provided in spec (7-57) for finding
the NumDeltaPocs

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-26 21:45:08 +02:00
Sreerenj Balachandran
333ba075a5 codecparser: h265: Fix the NumPocTotalCurr calculation
The NumPocToalCurr should be calculated for all B and P slices.

https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-26 21:44:25 +02:00
Sreerenj Balachandran
889cc8ee31 codecparser: h265: Fix nal size calculation for EOS and EOB
https://bugzilla.gnome.org/show_bug.cgi?id=747613
2015-04-26 21:43:40 +02:00
Sebastian Dröge
e7aa25ca6f glfilter: De-camelcase onInitFBO() vfunc 2015-04-26 21:42:03 +02:00
Sebastian Dröge
c638477c48 glfilter: Remove onStart/onStop vfuncs, and unused onReset()
onStart/onStop are just duplicates of the basetransform ones, onReset
was never called but was used everywhere when stop should've been used.
2015-04-26 21:39:06 +02:00
Matthew Waters
1fce7dc228 glbasefilter: Unref other context in finalize, and display in READY->NULL
https://bugzilla.gnome.org/show_bug.cgi?id=748405
2015-04-26 20:33:41 +02:00
Tim-Philipp Müller
699452ef31 Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:59:32 +01:00
Sebastian Dröge
235506e912 adaptivedemux: Only answer the duration query in non-live mode 2015-04-26 19:08:35 +02:00
Sebastian Dröge
6c8eeb448d adaptivedemux: Don't claim to be live when answering the LATENCY query
Even for "live" streams we are not live in the GStreamer meaning of the word.
We don't produce buffers that are timestamped based on their "capture time"
and our clock, but just based on whatever timestamps the stream might contain.

Also even if we wanted to claim to be live, that wouldn't work well as we
would have to return GST_STATE_CHANGE_NO_PREROLL when going from READY to
PAUSED, which we can't. We first need data to know if we are "live" or not.
2015-04-23 17:47:18 +02:00
Sebastian Dröge
0cd3938345 adaptivedemux: Allow subclasses to override how a new manifest would be downloaded 2015-04-23 17:47:18 +02:00
Sebastian Dröge
c1f98daa74 adaptivedemux: Expose downloader
This allows subclasses to use it and share connections if possible.
2015-04-23 17:47:18 +02:00
Sebastian Dröge
3c639d3235 adaptivedemux: Don't stop all tasks and streams from the update task on errors
It will deadlocks as we will then join() the update task from itself. Instead
just post an actual error message on the bus and only stop the update task.

The application is then responsible for shutting down the element, and thus
all the other tasks and everything, based on the error message it gets.
2015-04-21 22:04:56 +02:00
Matthew Waters
ab9eb432fb glwindow: track context activation properly
We only need to deactivate/reactivate the context iff it was already
active.
2015-04-21 12:55:24 +10:00
Matthew Waters
6cb6d8f9e8 gldisplay: synchronize the searching and creation of GstGLContext's
Ootherwise we could end up with multiple elements in different chains
each creating a context.  Fixes context creation with glvideomixer.
2015-04-21 12:55:24 +10:00
Guillaume Desmottes
89e2a5fe75 videoaggregator: fix caps leak when early returning
https://bugzilla.gnome.org/show_bug.cgi?id=747993

Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
2015-04-17 14:45:05 +01:00
Matthieu Bouron
93d2e67cbc glcontext: Make gst_gl_context_egl_activate fail if the old surface could not be destroyed
https://bugzilla.gnome.org/show_bug.cgi?id=746251
2015-04-17 14:39:11 +02:00
Matthieu Bouron
8ebc715fbf glcontext: Make gst_gl_context_egl_activate fail if the surface could not be created
Also add some error logging.
2015-04-16 11:47:00 +02:00
Sebastian Dröge
2fe6fe12cf glcolorconvert: Fix last commit 2015-04-11 19:35:48 +02:00
Sebastian Dröge
a557a546ac gl: Remove iOS/EAGL workaround for R/RG textures
This should be unneeded now after https://bugzilla.gnome.org/show_bug.cgi?id=732507
2015-04-11 19:17:00 +02:00
Sebastian Dröge
b10cdc8536 glcolorconvert: Add correct check for RG/R textures in glcolorconvert too
https://bugzilla.gnome.org/show_bug.cgi?id=732507
2015-04-11 19:14:34 +02:00
Anton Obzhirov
6a2e986f07 glbasefilter: avoid segfault when gl platform is not available
https://bugzilla.gnome.org/show_bug.cgi?id=747124
2015-04-10 12:15:29 -03:00
Sebastian Dröge
9592a0c32f videoaggregator: Remove broken timestamps-going-backwards check
This would've also triggered if for some reason the segment was updated
in such a way that PTS went backwards, but the running time increased. Like
what happens when non-flushing seeks are done.

We're doing a proper buffer-from-the-past check a few lines below based on the
running time, which is the only time we should care about here.
2015-04-08 19:31:43 -07:00
Reynaldo H. Verdejo Pinochet
7fb02dc918 aggregator: document gap handling behavior
https://bugzilla.gnome.org/show_bug.cgi?id=746249
2015-04-03 18:17:35 -03:00
Reynaldo H. Verdejo Pinochet
ca2de787db aggregator: drop stale white space at warning 2015-04-03 18:17:35 -03:00
Reynaldo H. Verdejo Pinochet
931fbf5e12 aggregator: implement gap handling
https://bugzilla.gnome.org/show_bug.cgi?id=746249
2015-04-03 18:17:35 -03:00
Olivier Crête
43d4d3c5ca aggregator: Unify downstream flow return and flushing
Also means that having a non-OK downstream flow return
wakes up the chain functions.

https://bugzilla.gnome.org/show_bug.cgi?id=747220
2015-04-02 15:59:27 -04:00
Olivier Crête
b9a422d8d0 aggregator: Flushing is always in pad lock, no need to atomics
The usage of atomics was always doubtful as it was used to release a
GCond

https://bugzilla.gnome.org/show_bug.cgi?id=747220
2015-04-02 15:59:27 -04:00
Olivier Crête
d1bae20802 aggregator: Reset pending_eos on pad flush
https://bugzilla.gnome.org/show_bug.cgi?id=747220
2015-04-02 15:59:27 -04:00
Olivier Crête
38d8db801a aggregator: Unify code to set a pad flushing
https://bugzilla.gnome.org/show_bug.cgi?id=747220
2015-04-02 15:59:27 -04:00
Alessandro Decina
6981a8d15b libgstgl: fix rendering on iOS
Stop assuming that the handle has been set by the time ->create_context is
called. After bc7a7259f3 set_window_handle always
happens after ->create_context in fact.

See also https://bugzilla.gnome.org/show_bug.cgi?id=745090
2015-04-02 18:29:39 +11:00
Olivier Crête
5a6024850c aggregator: Query latency on first incoming buffer.
And keep on querying upstream until we get a reply.

Also, the _get_latency_unlocked() method required being calld
with a private lock, so removed the _unlocked() variant from the API.
And it now returns GST_CLOCK_TIME_NONE when the element is not live as
we think that 0 upstream latency is possible.

https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-04-01 22:39:26 -04:00
Edward Hervey
0360a62135 introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 15:42:03 +02:00
Thiago Santos
66b01c9a0c adaptivedemux: do not try to advance fragment if there is none
It might return OK from subclasses and it could cause a bitrate
renegotiation. For DASH and MSS that is ok as they won't expose
new pads as part of this but it can cause issues for HLS as
it will expose new pads, leading to pads that will only have EOS
that cause decodebin to fail

https://bugzilla.gnome.org/show_bug.cgi?id=745905
2015-03-27 16:22:57 -03:00
Nirbheek Chauhan
dceb8aefd1 videoaggregator: Document why buffer_vinfo is needed 2015-03-24 14:54:33 +01:00
Nirbheek Chauhan
802a29eb48 videoaggregator: Check if there's a previous buffer to 'keep'
If we want to keep a previous buffer but there's no previous buffer, we actually
need more data instead.
2015-03-24 14:54:33 +01:00
Philippe Normand
14ac40f106 gl/dispmanx: surfaceless EGL context support
Show the DispmanX window only if there's no shared external GL context
set up. When a window is required by the context a transparent
DispmanX element is created and later on made visible by the ::show
method.

https://bugzilla.gnome.org/show_bug.cgi?id=746632
2015-03-24 11:12:05 +00:00
Julien Isorce
e1e17dcadb glwindow: remove unused gl_thread field 2015-03-22 19:12:15 +01:00
Julien Isorce
d35e3b8481 gldisplay: fix GThread leak
https://bugzilla.gnome.org/show_bug.cgi?id=746541
2015-03-22 19:03:19 +01:00
Matthew Waters
0ee027b6ee gl/docs: update some doc comments 2015-03-18 10:13:25 -07:00
Olivier Crête
0656c2fc67 aggregator: Be more aggressive with invalid replies to our latency query
https://bugzilla.gnome.org/show_bug.cgi?id=745768
2015-03-16 14:31:50 -04:00
Matthew Waters
78c82328ee gldisplay: tentative proper context collision detection
Fixes
tee name=t ! queue ! gliamgesink t. ! queue ! glimagesink
2015-03-15 14:43:10 +00:00
Víctor Manuel Jáquez Leal
d925e7fd19 glupload: move meta-data copy into gst-gl library
In some upload implementations the out buffer has more than one references,
turning the buffer not writable, so it won't be possible to modify its
meta-data.

This patch moves the meta-data copy before increasing the reference of the out
buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=746173
2015-03-14 19:53:02 +00:00
Matthew Waters
48f8b5b46b glmemory: fix the slight difference between EXT_rg and ARB_rg
GL_EXT_texture_rg doesn't take sized formats for the internalformat
parameter of TexImage* but GL_ARB_texture_rg and GL(ES)3 do.

https://bugzilla.gnome.org/show_bug.cgi?id=732507
2015-03-14 18:59:27 +00:00
Matthew Waters
fa61e8e4ce glsyncmeta: make context to wait and set sync explicit
otherwise we may wait on a sync object in same context by accident
2015-03-14 16:53:46 +00:00
Julien Isorce
802bf79998 gl: add GstGLDisplayCocoa
https://bugzilla.gnome.org/show_bug.cgi?id=746012
2015-03-14 08:38:03 +00:00
Julien Isorce
90f0cfceb7 gl/cocoa: do not terminate loop in gst_gl_window_cocoa_close
It is now done in _finalize.

Fix regression introduced by
"gl/window: create the main loop/context on init/finalize"
bc7a7259f3
2015-03-14 07:49:14 +00:00
Julien Isorce
2d593b4c26 gl: avoid overwriting display and context to NULL
It happens when the application provides display
and/or context.
2015-03-13 18:30:30 +00:00
Matthew Waters
a29a18cc3a glshader: attribute locations are -1 on error 2015-03-13 17:41:17 +00:00
Neos3452
40a4530c5d glshader: prevent from getting attributes without vertex shader
It doesn't make sense to query for vertex attributes without a vertex
shader. Moreover this is causing a crash on OSX.

https://bugzilla.gnome.org/show_bug.cgi?id=746168
2015-03-13 17:35:18 +00:00
Matthew Waters
773f9fa6ff glupload: unref the bufferpool 2015-03-13 12:40:04 +00:00
Matthew Waters
34485c9976 gl: get the context from basemixer/basefilter 2015-03-13 12:30:20 +00:00
Matthew Waters
91b7642c48 gl: retreive the gldisplay/app gl context as soon as possible
fixes the usage of gst_gl_display_filter_gl_api
2015-03-13 12:30:20 +00:00
Julien Isorce
daef98e3e6 glcolorconvert: cache indices in a buffer object 2015-03-12 18:19:57 +00:00
Matthew Waters
66ccdab09a gl/cocoa: avoid deadlock when creating context on the main thread.
Make window/view creation async so that it is possible to
gst_gl_context_create from the main thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
ef0bd30c87 gl: store the list of contexts within gldisplay
Removes the reliance on the allocation query to propogate GL contexts.

Allows thread safely getting a context for the a specific thread.
2015-03-12 16:45:51 +00:00
Matthew Waters
cebdf84c81 glcontext: store the thread current context 2015-03-12 16:45:51 +00:00
Matthew Waters
5a867ddc47 glfilter: don't use the library upload/convert objects 2015-03-12 16:45:50 +00:00