Commit graph

2312 commits

Author SHA1 Message Date
Thibault Saunier
71e4c485f0 aggregator: Cleanup locking around AggregatorPad flush related fields
And document the locking

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Mathieu Duponchelle
b27fb0dbac aggregator: keep chain functions as dumb as possible.
+ A pad chain function has no business checking other pads,
  that's what the aggregate thread is for.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
ccf329d527 aggregator: More fixes around locking when accessing protected private fields
In some more places we were accessing GstAggregator->segment
and GstAggregator->seqnum without holding the GST_OBJECT_LOCK

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
1a07467d5f aggregator: Make the PAD_LOCK private
Instead of using the GST_OBJECT_LOCK we should have
a dedicated mutex for the pad as it is also associated
with the mutex on the EVENT_MUTEX on which we wait
in the _chain function of the pad.

The GstAggregatorPad.segment is still protected with the
GST_OBJECT_LOCK.

Remove the gst_aggregator_pad_peak_unlocked method as it does not make
sense anymore with a private lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Thibault Saunier
d8eef43123 aggregator: Hide GstAggregatorPad buffer and EOS fileds
And add a getter for the EOS.

The user should always use the various getters to access
those fields

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
93d0b51dba aggregator: Document locking of GstAggregatorPrivate members
Most of them are protected by the object lock, specify
which ones use a different lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
ea76d39738 aggregator: Document how the segment is protected
Document that it can only be accessed with the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
9df8ac0a98 aggregator: Protect all latency related members with the object lock
The locking was not consistent, now consistently use the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
41d26673d6 aggregator: Document locking for gst_aggregator_get_latency_unlocked()
Renamed it to _unlocked() to make it clear.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
f7070dcfdc aggregator: Protect the srcpad caps negotiation with the stream lock
Instead of adding another lock, use the srcpad stream lock, which is already
taken anyway to push out the new caps if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
4a5882ee08 aggregator: Protect the tags with the object lock
The tags related variables were sometimes protected, sometimes not and
sometimes atomic. Put them all under the object lock.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
eddd5fd259 aggregator: Consistenly lock the flow_return state
Use the object's lock to protect it.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
cc605f4560 aggregator: Consistently lock some members
Some members sometimes used atomic access, sometimes where not locked at
all. Instead consistently use a mutex to protect them, also document
that.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
ee04b09233 videoaggregator: Lock access to members of GstAggregatorPad
Take the pad's object lock before accessing members of the
GstAggregatorPad structure.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
68ac6438f0 aggregator: Protect exported pad members with the pad's object lock
https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
cc3f418516 aggregator: Replace event lock with pad's object lock
Reduce the number of locks simplify code, what is protects
is exposed, but the lock was not.

Also means adding an _unlocked version of gst_aggregator_pad_steal_buffer().

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:18 +01:00
Olivier Crête
0a2dc1185c aggregator: Protect data with the same mutex as GCond
Whenever a GCond is used, the safest paradigm is to protect
the variable which change is signalled by the GCond with the same
mutex that the GCond depends on.

https://bugzilla.gnome.org/show_bug.cgi?id=742684
2015-01-29 10:24:17 +01:00
Nirbheek Chauhan
878b53f8fc videoaggregator: If getting a timeout before having caps, just advance our position
This can happen if this is a live pipeline and no source produced any buffer
and sent no caps until an output buffer should've been produced according to the
latency.

This fix is similar in spirit to commit be7034d1 by Sebastian for audiomixer.
2015-01-29 09:47:32 +01:00
Matthew Waters
6d9dc9c81c gl/calayer: add resize callback based on the bounds rectangle 2015-01-29 18:32:04 +11:00
Matthew Waters
2ab0e1517f gl/caopengllayer: draw asynchronously
This essentially makes the CAOpenGLLayer draw every refresh cycle.
2015-01-29 18:32:04 +11:00
Matthew Waters
f3273cafc4 gl/cocoa: don't segfault if we have a NULL draw/resize/close callback 2015-01-29 18:32:04 +11:00
Matthew Waters
8d5ba8d96a cgl/calayer: use a callback instead of hardcoding the draw functionality 2015-01-29 18:32:04 +11:00
Matthew Waters
693cdb47cd cgl: install the gl context and gl layer headers 2015-01-29 18:32:04 +11:00
Matthew Waters
9caf706185 cgl: add a header for the CAOpenGLLayer support 2015-01-29 18:32:04 +11:00
Philippe Normand
cfc0230e04 gl/dispmanx: fix build
Commit ab48bb6f0f changed the API of
GstGLWindow.
2015-01-27 21:31:21 +11:00
Matthew Waters
08dbd8bbd7 glmemory: more compatibility defines for gles2 systems 2015-01-27 14:52:47 +11:00
Matthew Waters
eea03967e4 glmemory: add some thread safety for gl operations 2015-01-27 12:26:05 +11:00
Matthew Waters
9a55a3f98c glmemory: use pbo's for download
In order to use pbo's efficiently, the transfer operation has to
be separated from the use of the downloaded data which requires some
rearchitecturing around glcolorconvert/gldownload and elements
2015-01-27 12:26:04 +11:00
Matthew Waters
f2667ebc7b glprototypes: add some (un)map buffer variants for GL/GLES 2015-01-27 12:26:04 +11:00
Tim-Philipp Müller
21168dd199 videoaggregator: fix crash when receiving buffer without timestamps
Unset out buffer in clip function when we unref the buffer to be
clipped, otherwise aggregator will continue to use the already-
freed buffer. Fixes crash when buffers without timestamps are
being fed to aggregator. Partly because aggregator ignores the
error flow return.

https://bugzilla.gnome.org/show_bug.cgi?id=743334
2015-01-26 09:24:40 +00:00
Edward Hervey
aebec9bd24 codecparsers: Indent file
Someone's been commiting without using gst-indent :)
2015-01-23 12:26:16 +01:00
Edward Hervey
3da1c9c8d5 codecparsers: Add READ_UE_MAX macro
READ_UE_ALLOWED was almost exclusively used with min == 0, which doesn't
make much point for unsigned integers.

Add a READ_UE_MAX variant and use that instead. Also replaced two usages
of CHECK_ALLOWED (a,0,something) by CHECK_ALLOWED_MAX (a, something)
2015-01-23 12:24:52 +01:00
Matthew Waters
27e5e0c2df gl/window/eagl: fix a couple of typos 2015-01-23 16:52:25 +11:00
Matthew Waters
06fdbd44b9 glwindow: cleanup/reorganize functions/members into logical groups 2015-01-23 16:39:44 +11:00
Matthew Waters
ab48bb6f0f glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2015-01-23 16:11:31 +11:00
Matthew Waters
4fc554054c glcontext/cocoa: avoid destroying a possibly 0 GSource id 2015-01-22 21:43:51 +11:00
Matthew Waters
e10d2417e2 gl/cocoa: move to CGL and CAOpenGLLayer for rendering
Removes the use of NSOpenGL* variety and functions.  Any Cocoa
specific functions that took/returned a NSOpenGL* object now
take/return the CGL equivalents.
2015-01-22 21:29:52 +11:00
Matthew Waters
fe8fdbdc7c glcontext/cocoa: add debug category 2015-01-22 21:27:44 +11:00
Sebastian Dröge
80e02cbdf9 Constify some static arrays everywhere 2015-01-21 10:18:50 +01:00
Thiago Santos
9ebbce381a adaptivedemux: do not skip the first fragment
Avoid advancing fragment right after downloading the header. If it
is the header, by default, don't advance to the next fragment.
2015-01-20 14:55:05 -03:00
Thiago Santos
919b93ae35 adaptivedemux: add explicit cast to make clang happy
Fixes compilation
2015-01-20 09:23:02 -03:00
Thiago Santos
229a15b393 adaptivedemux: refactor chunk downloading flow
Add more power to the chunk_received function (renamed to data_received)
and also to the fragment_finish function.

The data_received function must parse/decrypt the data if necessary and
also push it using the new push_buffer function that is exposed now. The
default implementation gets data from the stream adapter (all available)
and pushes it.

The fragment_finish function must also advance the fragment. The default
implementation only advances the fragment.

This allows the subsegment handling in dashdemux to continuously download
the same file from the server instead of stopping at every subsegment
boundary and starting a new request
2015-01-19 15:30:04 -03:00
Thiago Santos
9336077057 adaptivedemux: fix multi-period playback
If we say it is the first segment after a new period it will resync
the segment.start value and all buffers will be late for the new period
we are trying to play. Otherwise we want to keep the segment.start with
the previous value to allow the running time to smoothly increase
2015-01-19 08:36:42 -03:00
Lasse Laursen
174ea7af7b glapi: fix compilation with latest MSVC
https://bugzilla.gnome.org/show_bug.cgi?id=743041
2015-01-17 10:56:20 +11:00
Matthew Waters
989af902fe glmemory: use the correct size for the pbo
It was missing the GstVideoAlignment padding which could cause GL
errors related to overrunning the size of the pbo.
2015-01-17 10:56:20 +11:00
Thiago Santos
3a79bd91c7 adaptivedemux: prevent early EOS when switching at last fragment
Check if there is a next fragment before advancing to avoid causing
a bitrate switch (and maybe exposing new pads) only to push EOS.
This causes playback to stop with an error instead of properly
finishing with EOS message.
2015-01-16 17:07:22 -03:00
Thiago Santos
516f1ae0f4 adaptivedemux: add a special return to signal subsegment boundary
The subsegment boundary return tells the adaptivedemux that it can
try to switch to another representation as the stream is at a suitable
position for starting from another bitrate.
2015-01-16 15:00:11 -03:00
Thiago Santos
9b260d1ba5 adaptivedemux: Actually use the byte range for the fragment url
Otherwise we would always download the full fragment. This would
make handling subsegments in DASH impossible.
2015-01-16 15:00:11 -03:00
Thiago Santos
5c3a87c117 adaptivedemux: allow downloads of headers only
In order to get some subsegment information, subclasses might want
to download only the headers to have enough data (the index)
to decide where to start downloading from the subsegment.
2015-01-16 15:00:11 -03:00
Thiago Santos
f7e9a58c58 adaptivedemux: refactor common code to function
Reuse the same function when finishing downloading and signaling to
the download loop thread to get the next fragment or abort
2015-01-16 15:00:11 -03:00