Commit graph

3397 commits

Author SHA1 Message Date
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
Josep Torra
f805608075 cocoa: fix a recently introduced typo
Fixes gstgldisplay_cocoa.m:175:26: error: use of undeclared identifier 'singletone'.
2017-05-20 12:19:08 +02:00
Josep Torra
ef5d42b0a7 cocoa: fix macOS 10.12 deprecation warnings
Add #defines to allow older versions of macOS to use the new constant names.
2017-05-20 12:16:50 +02:00
Edward Hervey
be6465fc35 adaptivedemux: Add various comments to the code 2017-05-18 19:04:57 +02:00
Edward Hervey
3f42783857 adaptivedemux: Store QoS time
Allows subclasses to know where downstream is and make decisions
based upon that
2017-05-18 19:04:57 +02:00
Edward Hervey
4532277715 adaptivedemux: Add a macro to know if we are in trickmode-keyunit
Reduces the amount of lines of code in subclasses
2017-05-18 19:04:57 +02:00
Haihua Hu
ff8898bbda glformat: Add missing GST_GL_RGB565 in some switch statement
https://bugzilla.gnome.org/show_bug.cgi?id=782736
2017-05-17 20:33:13 +02:00
Sebastian Dröge
4fdd715c4b cocoa: Install gstgldisplay_cocoa.h
It's needed by e.g. qmlglsink.
2017-05-17 17:38:01 +03:00
Sebastian Dröge
634cd87c76 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-05-17 10:40:23 +03:00
Nicolas Dufresne
4261692187 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:05:52 -04:00
Edward Hervey
6a6ddb26b4 adaptivedemux: Handle stop_type:SET, stop:NONE
Seek values of type GST_SEEK_TYPE_SET with values of GST_CLOCK_TIME_NONE
are perfectly valid (we essentially don't modify the existing position)
2017-05-15 18:11:35 +02:00
Sebastian Dröge
65545ecfa3 glshader: Make reference counting of attach() consistent
https://bugzilla.gnome.org/show_bug.cgi?id=747990
https://bugzilla.gnome.org/show_bug.cgi?id=702960
2017-05-15 12:07:13 +03:00
Matthew Waters
7b615e92b6 build/gl/meson: check for GLES3/gl3ext.h existence
791e7522eb for meson

https://bugzilla.gnome.org/show_bug.cgi?id=781885
2017-05-11 20:06:47 +10:00
Jens Georg
791e7522eb build: Check for GLES3/gl3ext.h existence
Some OpenGL drivers do not ship this but use GLES2/gl2ext.h instead.
This is also in line with Khronos's recommendations

https://bugzilla.gnome.org/show_bug.cgi?id=781885
2017-05-11 20:05:14 +10:00
Sebastian Dröge
0730a55af3 glmemory: Only use glDrawBuffer if available
Otherwise fall back to glDrawBuffers. Also check if glReadBuffer exists
before using it.

glDrawBuffer does not exist for GLES, only glDrawBuffers does.

https://bugzilla.gnome.org/show_bug.cgi?id=782376
2017-05-09 11:26:13 +02:00
Edward Hervey
ea6e58d27f adaptivedemux: Handle more live seeking use-cases
This commit fixes the following assumptions with live seeking:
1) start was always valid and of type GST_SEEK_TYPE_SET
2) direction was always forward
3) stop should be offsetted when handling non-accurate seeks before
   the range start position.

In order to handle more live seeking use-cases (including reverse playback),
only do non-accurate start/stop value clamping for GST_SEEK_TYPE_SET values.

Also add a bit more debugging lines for issues

https://bugzilla.gnome.org/show_bug.cgi?id=782330
2017-05-09 09:02:07 +02:00
Edward Hervey
df60e12203 adaptivedemux: Implement GST_SEEK_TYPE_END usage for live
When dealing with live streams, we can't rely on GstSegment calculation
since it uses the segment duration to calculate the absolute values.

But since we are dealing with live *and* we know the ranges, we can
compute the absolute seeking values using the range stop (i.e. "now")
as the END position.

Allows seeking back to "live" by using start_type:GST_SEEK_TYPE_END
and start:0

https://bugzilla.gnome.org/show_bug.cgi?id=782228
2017-05-09 09:02:07 +02:00
Edward Hervey
6772981668 adaptivedemux: Allow live seeking range to go back to "now"
The allowed live seek ranges returned by subclasses are "inclusive", that is
to say that the "range_stop" value they return is the highest acceptable position
one can seek to (i.e. "now").

Allow seeking to exactly that value
2017-05-05 18:28:33 +02:00
Haihua Hu
beab384557 glupload: passthrough composition caps features in directviv upload
https://bugzilla.gnome.org/show_bug.cgi?id=782046
2017-05-02 14:18:43 +03:00
Tim-Philipp Müller
142469ab91 tests: fix link problem on centos7
And put LIBS before -lgstfoo in adaptivedemux Makefile.am
2017-04-27 21:33:25 +01:00
Matthew Waters
0886160123 adaptivedemux: separate manifest update task from download tasks
Rationale is to allow the manifest update task to continue running while
seeks are occurring.  Otherwise, if the user reliably performs a seek
before the manifest is updated, then as the manifest task is reset on
seeks (and thus the time to wait between manifest updates), the manifest
would never be updated.

This fix makes the manifest update task free-running and continously
update even during seeks.
2017-04-25 14:16:15 +10:00
Edward Hervey
e00be27585 adaptivedemux: Don't hold locks when pushing FLUSH_START
Some actions (Qos, reconfigure, ...) might take place before we finish pushing out flush_start.

One problem would be that:
1) The QOS handling in adaptivedemux takes the MANIFEST LOCK
  That QOS event comes from basesink with its PREROLL_LOCK taken
2) FLUSH_START is sent from adaptivedemux with the MANIFEST_LOCK taken and the basesink flushing handler needs to take the PREROLL_LOCK

 => deadlock

https://bugzilla.gnome.org/show_bug.cgi?id=781320
2017-04-15 08:18:39 +02:00
Edward Hervey
44ec6bb2f3 adaptivedemux: Fix segment creation/adaptation some more
Take into account the segment stop and the negative rates

https://bugzilla.gnome.org/show_bug.cgi?id=781267
2017-04-14 08:02:29 +02:00
Thibault Saunier
78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Thibault Saunier
a49c114d4e docs: Stop linking to inexistant symbols 2017-04-12 12:07:51 -03:00
Thibault Saunier
4f9328a514 aggregator: Make instance var name match between .c and .h
Making GI happy
2017-04-12 12:07:26 -03:00
Claudio Saavedra
61ba3f1986 meson: add missing gstglrenderbuffer.h header
https://bugzilla.gnome.org/show_bug.cgi?id=781179
2017-04-11 16:54:04 +03:00
Scott D Phillips
fc0c7d664d meson: gl: set default value of 0 for glconf vars
meson's configure_file emits only a comment like /* #undef ... */
for values which are unset in the configuration_data. For
gstglconfig.h, this differs from the autotools build where the
preprocessor definitions are always either 0 or 1. So loop over a
list of variables to set to zero as default.

Also sync up the gstglconfig.h.meson file with the additional
macros defined by the autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=781043
2017-04-09 11:20:43 +03:00
Vincent Penquerc'h
cd78fc58ec gstaggregator: fix event use after free
https://bugzilla.gnome.org/show_bug.cgi?id=781017
2017-04-09 11:17:19 +03:00
Vincent Penquerc'h
3fd5608e21 glcontext: fix display leak
https://bugzilla.gnome.org/show_bug.cgi?id=781019
2017-04-09 11:16:56 +03:00
Vincent Penquerc'h
884e4b7810 gldisplay: fix list leak
Windows aren't always removed in time, and it turns out to be
very, very hard to remove a window in a way that's not racy and
not deadlocky. Since the window itself doesn't leak, freeing
the list on object destruction is enough.

https://bugzilla.gnome.org/show_bug.cgi?id=781018
2017-04-09 11:16:48 +03:00
Vincent Penquerc'h
9eab67a4af mpegts: fix invalid memory access in language descriptor
Also add a couple sanity asserts/returns

https://bugzilla.gnome.org/show_bug.cgi?id=781024
2017-04-09 11:16:37 +03:00
Seungha Yang
ea588ae0e0 adaptivedemux: Retry downloading a fragment immediately if any in live streaming
At the moment that demux is waiting manifest update, the target sequence
of fragment was advanced already. So, checking stream_has_next_fragment()
means looking for the next fragment of target fragment.
This might cause unexpected buffering if each fragment has
large duration and manifest is listing only limited number of fragments.

https://bugzilla.gnome.org/show_bug.cgi?id=780494
2017-04-09 10:56:32 +03:00
Jan Schmidt
b8f37d1074 gl: Remove duplicate typedef of GstGLFramebufferClass
The GstGLFramebufferClass struct is typedeffed in
gstgl_fwd.h, and having a duplicate elsewhere is
breaking the cerbero build on my OSX machine,
even though it seems to be working in CI.
2017-04-08 21:28:58 +10:00
Mathieu Duponchelle
4d63aee36c videoaggregator: Do not mix the same buffer twice when EOS.
When entering this code path, we know that:

We received EOS on this pad.
We consumed all its buffers.

In any case, we want to replace vaggpad->buffer with NULL,
otherwise we will end up mixing the same buffer twice.

https://bugzilla.gnome.org/show_bug.cgi?id=781037
2017-04-07 18:55:54 +02:00
Matthew Waters
e212753094 adaptivedemux: add some reasons on warning reporting 2017-04-07 16:39:09 +10:00
Sebastian Dröge
58370ed6cf uridownloader: Use a GWeakRef to the parent to prevent a reference cycle
https://bugzilla.gnome.org/show_bug.cgi?id=780140
2017-04-03 11:35:51 +03:00