Commit graph

3495 commits

Author SHA1 Message Date
Seungha Yang
87cb9fa49e adaptivedemux: Clear "cancelled" on uridownloader before processing manifest
Previous commit let demux call gst_uri_downloader_cancel() on _demux_reset().
Note that, _demux_reset() called during PAUSED_TO_READY and READY_TO_PAUSED.
And, it will set "cancelled" on uridownloader which blocks the use of
uridownloader. The issue is that, subclass can use the uridownloader not only
live streaming for manifest update, but also for fetching another manifests
such as variant and rendition m3u8 of hls streaming. So to unblock it,
demux should clear "cancelled" before processing initial manifest.

https://bugzilla.gnome.org/show_bug.cgi?id=783401
2017-06-06 19:21:56 -07:00
Mathieu Duponchelle
694da006e0 adaptivedemux: release the manifest lock ...
before broadcasting preroll.

The deadlock was as follows:

-> The subclass pushes a buffer on a newly-created stream in T1
-> We take the preroll lock in T1, to handle_preroll
-> The demuxer is stopped in T2, we take the MANIFEST_LOCK
-> T1 starts blocking because it received a reconfigure event
   and needs to take the MANIFEST_LOCK
-> T2 deadlocks because it now wants the preroll_lock.

https://bugzilla.gnome.org/show_bug.cgi?id=783255
2017-06-01 15:27:07 +02:00
Thiago Santos
5a693fdd9d adaptivedemux: do not erase data while updates-loop is running
Make sure the manifest update loop is stopped before proceeding with the
resetting of the manifest data. Otherwise, the updates loop will try to
use it and it leads to a segfault

https://bugzilla.gnome.org/show_bug.cgi?id=783028
2017-06-01 15:27:07 +02:00
Jeremy Hiatt
3620268325 glutils: Fix GValue leak in gst_gl_value_set_texture_target_from_mask() 2017-06-01 14:39:49 +03:00
Mathieu Duponchelle
c88125045f adaptivedemux: make sure to free all "old streams"
As we release the MANIFEST_LOCK in stop_tasks,
demux->priv->old_streams can be set, we need to free these
otherwise we may end up trying to dispose elements in the
READY state.

https://bugzilla.gnome.org/show_bug.cgi?id=783256
2017-06-01 11:13:46 +02:00
Edward Hervey
b104fb203a adaptivedemux: Don't be too aggressive with seek ranges
When an accurate seek is requested on a live stream, only requests the
exact value for the "starting position" (i.e. start in forward playback
and stop in reverse playback).

https://bugzilla.gnome.org/show_bug.cgi?id=782698
2017-05-31 11:34:41 +02:00
Edward Hervey
304a628de7 nonstreamaudio: Avoid using wrong variable
And to make that 100% obvious, only use variables declared within the
switch cases instead of function-wide ones.

Also remove useless one-time-use-only variable.

CID #1409857
2017-05-26 17:44:40 +02:00
Edward Hervey
2a193cde84 nonstreamaudio: Avoid using un-initialized value
We would end up with cur_position not set but proceed being at its
default value of TRUE. Instead, properly set proceed to FALSE

CID #1409855
2017-05-26 17:44:17 +02:00
Edward Hervey
cf362be9ff adaptivedemux: Fix debugging message
GstSegment position is a guint64 and not a gint64

CID #1409910
2017-05-26 17:30:34 +02:00
Edward Hervey
f4190a49c0 adaptivedemux: Check live seeking range more often
The live seeking range was only checked when doing actual seeks. This was
assuming that the rate would always be 1.0 (i.e. the playback would
advance in realtime, and therefore fragments would always be available
since the seeking window moves at the same rate).

With non-1.0 rates, this no longer becomes valid, and therefore we need
to check whether we are still within the live seeking range when advancing.

https://bugzilla.gnome.org/show_bug.cgi?id=783075
2017-05-26 11:51:14 +02:00
Edward Hervey
2cf4ece73b adaptivedemux: Don't create invalid event
tags could potentially be NULL
2017-05-26 09:55:42 +02:00
Matthew Waters
430a90df20 adaptivedemux: retry download MAX_DOWNLOAD_RETRY_COUNT times before erroring
What we want is to retry downloading the fragment on 4xx/5xx errors
however returning EOS will cause waiting for a manifest update for live
(which may be a really long time) or stop everything for non-live.

Change that to only return EOS/ERROR once we've reached the error limit.

https://bugzilla.gnome.org/show_bug.cgi?id=776609
2017-05-25 13:33:35 +03:00
Sebastian Dröge
be08f0f9a8 gl: Fix indentation 2017-05-25 13:06:03 +03:00
Sebastian Dröge
2434305ec5 glframebuffer: #define GL_READ_FRAMEBUFFER / GL_DRAW_FRAMEBUFFER if not defined yet
Just like we do elsewhere already.
2017-05-25 13:05:23 +03:00
Haihua Hu
c2b2c68bea glformat: fix the usage of GST_GL_RGB565
GL_RGB565 is sized internal glformat, the corresponding glformat
should be GL_RGB and type is GL_UNSIGNED_SHORT_565. Otherwise will
return GL_INVALID_ENUM when creating texture.

https://bugzilla.gnome.org/show_bug.cgi?id=783066
2017-05-25 12:34:12 +03:00
Haihua Hu
405d059a22 glframebuffer: check frame buffer status need use specific fbo target
https://bugzilla.gnome.org/show_bug.cgi?id=783065
2017-05-25 12:34:04 +03:00
Olivier Crête
86a256aebc aggregator: Process serialized queries through the queue
This ensures that they really get processed in order with
buffers. Just waiting for the queue to be empty is sometimes not
enough as the buffers are dropped from the pad before the result is
pushed to the next element, sometimes resulting in surprising
re-ordering.
2017-05-23 12:35:58 +02:00
Olivier Crête
9e2640ba95 aggregator: Set flow to FLUSHING on pad stop
Fixes a rare race where the pad is being stopped while doing a query.
2017-05-23 12:35:58 +02:00
Carlos Rafael Giani
2e4c6d6a49 audio: Add nonstreamaudiodecoder base class
https://bugzilla.gnome.org/show_bug.cgi?id=768576
2017-05-22 16:34:05 +02:00
Olivier Crête
5443aa9ac8 audioaggregate: Don't hold object locks across calls to aggregate_one
https://bugzilla.gnome.org/show_bug.cgi?id=782878
2017-05-21 18:44:53 +02:00
Olivier Crête
fbfc427552 aggregator: Request pad templates which are not request pad
https://bugzilla.gnome.org/show_bug.cgi?id=782920
2017-05-21 18:39:49 +02:00
Olivier Crête
8f0fba54b5 aggregator: Don't restrict sink pad names
Sink pads could have other names than sink_%u

https://bugzilla.gnome.org/show_bug.cgi?id=782920
2017-05-21 18:39:09 +02:00
Olivier Crête
68bb5bfecc videoaggregator: Declare that it supports the video meta on input
https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-05-21 18:17:54 +02:00
Olivier Crête
431dc9720a aggregator: Implement propose allocation
https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-05-21 18:17:54 +02:00
Olivier Crête
20bf97f089 aggregator: Check for the result of caps events
https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-05-21 18:17:54 +02:00
Olivier Crête
a463859eba aggregator: Caps event always goes to the aggregate thread
So no need to check it here.

https://bugzilla.gnome.org/show_bug.cgi?id=782918
2017-05-21 18:17:54 +02:00
Carlos Rafael Giani
d6e46b905a gl/viv-fb: Fix user-choice string comparisons
https://bugzilla.gnome.org/show_bug.cgi?id=782921
2017-05-21 16:52:23 +02:00
Olivier Crête
892693865f videoaggregator: Create normal video pool as a fallback
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-05-21 13:24:29 +02:00
Olivier Crête
ea26b9aa37 audioaggregator: Use downstream allocator and params if available
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-05-21 13:24:29 +02:00
Olivier Crête
31bbfd6773 videoaggregator: Get the buffer from the pool if available
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-05-21 13:24:29 +02:00
Olivier Crête
12197e4bb5 aggregator: Add downstream allocation query
https://bugzilla.gnome.org/show_bug.cgi?id=746529
2017-05-21 13:24:26 +02:00
Olivier Crête
7b1235940f videoaggregator: Return to parent on reconfigure
The caps negotiation is now in the parent, so need to return there
if a reconfiguration is needed, otherwise it will loops forever.
2017-05-21 12:45:07 +02:00
Tim-Philipp Müller
06ae762211 gl: x11: fix compiler warning 2017-05-21 11:44:37 +01:00
Matthew Waters
15e13bd44e glcontext: add public swap_buffers function
That simply calls the implementation
2017-05-21 12:12:02 +02:00
Graham Leggett
711b006cb9 adaptivedemux: fix debug message printf format
Match gsize to G_GSIZE_FORMAT in the debug message.

https://bugzilla.gnome.org/show_bug.cgi?id=782873
2017-05-20 18:20:34 +01:00
Olivier Crête
583e655234 aggregator: Remove unused GST_FLOW_NOT_HANDLED 2017-05-20 16:21:17 +02:00
Matthew Waters
7c53043386 aggregator: add simple support for caps handling
Modelled off the videoaggregator caps handling as that seems the most
mature aggregtor-using implementation that has caps handling there is.

https://bugzilla.gnome.org/show_bug.cgi?id=776931
2017-05-20 16:21:17 +02:00
Nicolas Dufresne
ed8512c53e aggregator: Reset upstream latency on first buffer
In the case an aggregator is created and pads are requested but only
linked later, we end up never updating the upstream latency.
This was because latency queries on pads that are not linked succeed,
so we never did a new query once a live source has been linked, so the
thread was never started.

https://bugzilla.gnome.org/show_bug.cgi?id=757548
2017-05-20 16:21:17 +02:00
George Kiagiadakis
39d2526c34 videoaggregator: delay using new caps from a sink pad until the next buffer in the queue is taken
When caps changes while streaming, the new caps was getting processed
immediately in videoaggregator, but the next buffer in the queue that
corresponds to this new caps was not necessarily being used immediately,
which resulted sometimes in using an old buffer with new caps. Of course
there used to be a separate buffer_vinfo for mapping the buffer with its
own caps, but in compositor the GstVideoConverter was still using wrong
info and resulted in invalid reads and corrupt output.

This approach here is more safe. We delay using the new caps
until we actually select the next buffer in the queue for use.
This way we also eliminate the need for buffer_vinfo, since the
pad->info is always in sync with the format of the selected buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=780682
2017-05-20 16:21:16 +02:00
Olivier Crête
d2335bce9b aggregator: Always handle sync'ed events on output thread
Having all synchronized events always be handled on the output
thread should make synchronization easier.

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
4cec1925e3 aggregator: Delay clipping to output thread
This is required because the synchronized events like caps or segments
may only be processed on the output thread.

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
a6710944e8 aggregator: Make pad eos as soon as all buffers are processed, dont way for events
https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
6e96bebd5b aggregator: Only count buffers when declaring queue full
https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
4d408ea920 aggregator: Simplify clip function
The return value was ignored anyway

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
20aee5f575 aggregator: Only declare first buffer on actual buffer
The function needs to be unlocked if any data is received, but only
end the first buffer processing on an actual buffer, synchronized events
don't matter on the first buffer processing.

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
1ab33d78fe aggregator: Set initial position on first buffer
Set the initial position on the first buffer, otherwise the queue
will grow without limits before the output thread is started.

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
82f7b00ea3 aggregator: Reset the pad's first buffer flag with the rest
There is not reason to have separate code to reset this one.

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
05374aa22c aggregator: Reset pad on init
Factor out the pad reset code from the flushing and use it on init as well

https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
Olivier Crête
d722e064fd aggregator: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=781673
2017-05-20 16:21:16 +02:00
fvanzile
eca91d6772 glcontext: keep a ref to the active thread
With the macOS/iOS implementations, the active thread can change
multiple times over the life of a pipeline which would expose a race in
the thread tracking.

Fix by taking a ref on the active thread while the context is active.

https://bugzilla.gnome.org/show_bug.cgi?id=779202
2017-05-20 16:19:38 +02:00