Commit graph

16163 commits

Author SHA1 Message Date
Edward Hervey
9c4b3b1ee7 discoverer: Don't add pads/elements when cleaning up
There is no need to add more pads/elements since we are already done.
2017-11-15 10:55:55 +01:00
Edward Hervey
4636b8dd6f discoverer: Remove probe when done 2017-11-15 10:55:55 +01:00
Edward Hervey
51eeb4534a ogmparse: Set caps after sending pending events
Avoids sending STREAM_START before CAPS
2017-11-15 10:55:55 +01:00
Edward Hervey
6c6d8b0b95 oggstream: Demote error to warning 2017-11-15 10:55:55 +01:00
Edward Hervey
25fa4802fe oggdemux: Move mutex/cond initialization/release
We only need to initialize the mutex/cond once when creating the
element and then release them when we are done with the element.

Avoids weird "mutex_clear called when still locked" issues
2017-11-15 10:55:55 +01:00
Edward Hervey
ce8f51e30e decodebin2: Don't try to add pads when shutting down
Be even more agressive than before and just hold the DYN lock when/if
adding pads and return if we are shutting down.
2017-11-14 13:40:50 +01:00
Edward Hervey
77e5a71a15 decodebin2: Don't take locks when deactivating pads
When deactivating pads, we need to ensure that the streaming threads
going through the pads we wish to deactivate can cleanly return.
Failure to do that would result in the streaming locks of those
pads never being released. The end result would be a deadlock
when stopping decodebin2.

In order to avoid that situation, release the "dyn" lock around
the deactivation code. And refactor the code to cope with the
list of blocked pads having potentially changed when re-acquiring
the lock.
2017-11-14 13:40:48 +01:00
Edward Hervey
c7917df7e2 theoradec: Handle negotiation failure
Avoids a trove of random issues afterwards (due to decoder not
*actually* being initialized/negotiated).
2017-11-11 07:47:52 +01:00
Edward Hervey
6280547be7 playbin3: Remove unneeded blacklisting
Blacklisted mimetypes have been empty in almost 10 years ...
2017-11-10 17:22:36 +01:00
Edward Hervey
cd508aff97 playbin3: Remove context caching
This is now handled by the GstBin baseclass
2017-11-10 17:22:22 +01:00
Edward Hervey
3dd0888d1e playbin3: Remove source property
And instead use the "setup-source" signal. This opens the way to deal
with more than one 'source' for a given playlist entry
2017-11-10 17:06:46 +01:00
Edward Hervey
35a8d42724 parsebin: Don't let thread run after unref
We have a dedicated one-shot thread to handle cleanup of old groups.

While this is a good idea. It's an even better idea to make sure
that thread is *completed* before the parsebin element to which
it is related isn't freed/gone.

* There can only be one cleanup thread happening at any point in time.
  If there is already one, we wait for the previous one to finish.
* When shutting down (NULL=>READY) make sure the thread is finished

https://bugzilla.gnome.org/show_bug.cgi?id=790007
2017-11-10 17:06:45 +01:00
Edward Hervey
43b9bcbddb decodebin2: Don't let thread run after unref
We have a dedicated one-shot thread to handle cleanup of old groups.

While this is a good idea. It's an even better idea to make sure
that thread is *completed* before the decodebin2 element to which
it is related isn't freed/gone.

* There can only be one cleanup thread happening at any point in time.
  If there is already one, we wait for the previous one to finish.
* When shutting down (NULL=>READY) make sure the thread is finished

https://bugzilla.gnome.org/show_bug.cgi?id=790007
2017-11-10 17:06:10 +01:00
Edward Hervey
d53ccfd8e5 parsebin: Check for shutdown before exposing pads
We already checked previously, but we need to do it before adding
pads.
2017-11-10 17:06:10 +01:00
Edward Hervey
92e8876844 parsebin: Emit 'drained' only for the top-level chain
Instead of emitting 'drained' whenever every single chain is drained
(which would result in plenty of signal emission, and would also
occur when switching groups), only emit it when the top-level chain
is drained.

Furthermore, mark unknown (and therefore unexposed) pads as drained
since we'll never get EOS on them.

https://bugzilla.gnome.org/show_bug.cgi?id=787367
2017-11-10 10:05:26 +01:00
Sebastian Dröge
b9aaa7f4f2 audiobasesink: Print signed time offset as a signed number 2017-11-08 19:24:55 +02:00
Sebastian Dröge
9bbcccc21e audiostreamalign: Add G_BEGIN_DECLS/G_END_DECLS 2017-11-08 19:24:55 +02:00
Edward Hervey
895d884701 oggdemux: Solidify gst_ogg_demux_loop_push() some more
There were still some races going on where seeking events wouldn't
be properly intercepted/executed by this thread.

* Instead of always waiting for the GCond to be emitted, first just
  check if there is an event available
* Take ownership of the event *while* the lock is taken and not
  after releasing/reacquiring it
* Finally acquire lock at the very top and release it at the end
  to make it a bit more streamlined

This removes the remaining issues with seeks not being executed
2017-11-08 17:51:52 +01:00
Edward Hervey
9f678bb27f oggdemux: Don't double-unlock
The previous branch will release the lock in the call to
gst_ogg_demux_seek_back_after_push_duration_check_unlock()

Only unlock it if we didn't call that function
2017-11-08 17:51:51 +01:00
Edward Hervey
c86df789ed oggdemux: Drop data before new segment
When calculating duration in push-mode we seek to a certain position
and discard any data until we get data from that requested position.

The problem is that basing ourselves solely on offset to determine
whether we reached the target offset is wrong since the source might
be fast enough  to send us that target position *before* it processed
the requested seek.

This would end up in a situation where:
* We think we're done with duration estimate
* We fire a seek back to "0" in the loop thread
* We resume normal processing
* ... except that we're still getting data from too far ahead which
  we decide to process.
* And we start doing totally wrong granule/time/duration calculation
  and pushing wrong data.

Instead of this confusion, wait until we receive data from the requested
seek. We do that by using the fact that the seqnum in
seek_event_drop_til will be non-zero until the SEGMENT corresponding
to the requested SEEK has been received.

Bonus: makes startup slightly faster
2017-11-07 15:16:52 +01:00
Edward Hervey
0a49b93ade oggdemux: Wait for push loop to be started
Code using the push_loop_thread (using for sending seeks) assumes
that the thread was properly started, except that this isn't always
true and the thread might not have completely started.

Instead wait for the thread to properly start before doing anything
else.
2017-11-07 15:16:52 +01:00
shakin chou
2ec51ef998 playbin: Don't ref_sink() the sinks twice
Since we're already sunk floating reference, we shouldn't call ref_sink
again, which increases the ref_count and cause leaks.

https://bugzilla.gnome.org/show_bug.cgi?id=789547
2017-11-07 10:32:34 +02:00
Edward Hervey
5e373936bb oggstream: Ensure enough bytes for fishead header parsing 2017-11-06 14:29:26 +01:00
Edward Hervey
af48682d44 oggstream: Use proper type for sample calculation
If we are going to return a (potentially) 64bit integer, don't use
a 32bit one for calculation, otherwise we could end up exceeding
the maximum size of a 32bit int.
2017-11-05 12:16:13 +01:00
Edward Hervey
7f5ffcaa49 oggstream: More fixes for invalid granuleshift
Don't use granuleshift if it wasn't set
2017-11-05 12:15:33 +01:00
Edward Hervey
89238f9de1 discoverer: Don't switch to PLAYING if we saw an error
If we saw an error on the bus, we can't be guaranteed that element will
function properly anyway. Avoids weird state change races also
2017-11-04 19:48:13 +01:00
Edward Hervey
fcf09c18f2 Revert "discoverer: Avoid race of adding elements while stopping"
This reverts commit 9a8cb29970.

The problem is deeper down the stack
2017-11-04 19:09:19 +01:00
Edward Hervey
ae865ec1d1 rtcpbuffer: fix left shift override
Needs to be cast to the target type
2017-11-04 16:56:10 +01:00
Edward Hervey
9a8cb29970 discoverer: Avoid race of adding elements while stopping
This would result in a lot of warnings regarding elements not being
in NULL state when removed, or even leaked elements.

Instead make sure we take the lock and check whether we are processing
or not before allocating or adding anything to the pipeline
2017-11-04 16:13:06 +01:00
Edward Hervey
c81e3e6fce videotestsrc: Fix undefined left shift
Cast value to target type
2017-11-04 12:19:46 +01:00
Edward Hervey
31d5ac15b2 video-converter: Fix undefined left shift
Cast value to target type
2017-11-04 12:18:39 +01:00
Edward Hervey
2cf5d596ee oggstream: Fix default granuleshift usage
For stream mappers that don't set a specific granuleshift, it will
have the default value of -1.

Protect the code for that and return the granule value as-is
2017-11-04 11:50:13 +01:00
Edward Hervey
1172e5efc7 oggdemux: Protect against invalid granule positions
Only valid values are -1, 0 or positive values. Anything else is
most likely corrupted data streams
2017-11-04 11:50:10 +01:00
Mathieu Duponchelle
c493c564ba codecutils: improve input validation in opus header parsing
Invalid input files do not warrant assertions. Instead
output error messages and let the error bubble up.
2017-11-03 17:25:47 +01:00
Justin Kim
91179622eb sdpmessage: add_attribute accepts NULL value
The attribute can be defined without value regardless session-level
or media-level.
Although `gst_sdp_message_insert_attribute` can be used to set NULL,
it would be easier if `gst_sdp_message_add_attribute` accepts NULL.

https://bugzilla.gnome.org/show_bug.cgi?id=789841
2017-11-03 17:56:39 +11:00
Edward Hervey
a23d4d1c1f typefind: Fix out-of-bound read in PNM typefinder 2017-11-02 17:59:29 +01:00
Edward Hervey
24a5a03d27 vorbistag: Fix previous comment
We already NULL-ended the string, don't use the bogus cur_size
2017-11-02 10:43:02 +01:00
Tim-Philipp Müller
6c749f75a5 typefindfunctions: fix off-by-one in webvtt typefinder
We're also checking the byte after the WEBVTT magic.
2017-11-02 09:05:47 +00:00
Edward Hervey
ee55f94ac0 riff-media: Handle strf_data being NULL
Instead of trying to get the size of a NULL buffer :)
2017-11-02 09:19:21 +01:00
Edward Hervey
62081fe583 vorbistag: Check whether tag name is valid
In the same way we check before whether the content of the tag
is UTF-8
2017-11-02 08:19:13 +01:00
Edward Hervey
7e28f6c076 discoverer: Check return values
The target pad of a ghostpad could have gone (due to shutdown taking
place for example). Check for it's existence before doing anything
with it.
2017-11-02 08:04:27 +01:00
Edward Hervey
f448cecceb decodebin2: Recheck shutdown behaviour in error case
If we can expose the main chain, recheck whether we are shutting
down or not.

decodebin2 might have been set to READY/NULL during the attempt
to expose, which would cause it to fail ... but it is not a fatal
issue.
2017-11-02 07:55:16 +01:00
Edward Hervey
39ba6427f1 discoverer: Uniquely name elements
Helps identifying actual queue/fakesink usage. There seems to be
a race in discoverer, this should help track it down.
2017-11-02 07:18:17 +01:00
Edward Hervey
33dfed5af8 oggdemux: Only track time for initialized streams
in push-mode we only can track time (or most operations on streams
for that matter) if the underlying GstOggMap was properly initialized.
2017-11-01 18:39:26 +01:00
Edward Hervey
c3006b17d1 oggstream: Add a default GstOggMap
Since the default value of a GstOggPad.map.map was 0 ... we would
end up using wrong functions from mappers() if the stream wasn't
initialized yet.

Instead of that, use a default blank/empty first entry.
2017-11-01 18:39:26 +01:00
Sebastian Dröge
9c2d5e863e rtspconnection: Allow setting a custom accept-certificate function for manually checking a TLS certificate for validity
https://bugzilla.gnome.org/show_bug.cgi?id=785024
2017-11-01 13:41:42 +02:00
Edward Hervey
f1c44332d5 ogmparse: Ensure we don't create bogus fractions
The clamping of the fraction denominator was bogus (it needs to
be >0)
2017-11-01 11:19:58 +01:00
Edward Hervey
eb8bf0f162 oggdemux: Fix chain leak in push mode
In some corner cases we end up with the building chain not being
properly tracked (and therefore not properly freed).

Add a FIXME so it can later be fixed, but for now just fix the leak
2017-11-01 11:18:12 +01:00
Edward Hervey
8e867aefe0 vorbistag: Fix leak in error case
Don't leak the vendor_string on error cases
2017-11-01 10:53:54 +01:00
Edward Hervey
0297bc2a4f ogmparse: Error out if we can't figure out the format
In some cases we might not be able to figure out the fixed format
from the header.

Properly error out in those cases.
2017-11-01 10:32:54 +01:00