Commit graph

3446 commits

Author SHA1 Message Date
Tim-Philipp Müller
b8f9d674be srtpdec: fix buffers being dropped due to shadowed variable
Spotted by gstblub@gmail.com.

https://bugzilla.gnome.org/show_bug.cgi?id=706091
2013-08-16 19:48:03 +01:00
Chris Bass
7f21226956 dashdemux: offset segment numbers by startNumber
For SegmentTemplate elements containing a startNumber attribute, the
`number' member of GstMediaSegments should be offset by the value of
startNumber; however, this is not currently the case. As a result, the
first URI(s) requested by the download loop will be wrong.

This commit ensures that segment numbers will be offset by startNumber
when one is present in a SegmentTemplate element.

https://bugzilla.gnome.org/show_bug.cgi?id=705661
2013-08-16 11:15:47 -03:00
Chris Bass
19a45554bf dashdemux: remove incorrect timestamp scaling.
When using a SegmentTemplate element, the timestamps of the buffers
output by dashdemux are incorrect, causing problems downstream.

The reason is that GstMediaSegment start times are calculated (in
gst_mpdparser_get_chunk_by_index) by multiplying segment index by
segment duration and then scaling the result according the `timebase'
attribute from the MPD. However, the segment duration is already a
GstClockTime (i.e., it has already been scaled according to the timebase
from the MPD and converted to a nanosecond value), so multiplying it by
the segment index will give the correct timestamp without the need for
any further scaling.

https://bugzilla.gnome.org/show_bug.cgi?id=705679
2013-08-16 10:22:21 -03:00
Sebastian Dröge
2e8af6973f ext: Use new flush vfunc of video codec base classes and remove reset implementations 2013-08-15 15:46:58 +02:00
Thiago Santos
1b1332cb6d mssdemux: use gst_data_queue_push_force for adding events to queue
This prevents locking on startup when a stream only has a single buffer
for one of the streams and mssdemux decides to push an EOS event right
after it.
2013-08-13 12:44:41 -03:00
Thiago Santos
2db211e243 dashdemux: use push_force when adding events to the dataqueue
This prevents deadlocks on startup on files that have only a very
large buffer for a stream and the queue is filled and will lock on
the eos event that is pushed after the buffer. As no buffers have yet
been pushed to other streams, the pipeline locks on preroll
2013-08-13 11:49:54 -03:00
Olivier Crête
d346e75606 srtp: Let packets through without touching them if no crypto or auth is set 2013-08-12 12:27:33 -04:00
Olivier Crête
a10e800dfd srtpdec: Refactor code a bit
Simplify the error handling case and get the packet push out of the if()
2013-08-12 12:27:16 -04:00
Olivier Crête
04bd37dd67 srtpdec: Don't error on invalid packet, just drop it 2013-08-12 11:57:04 -04:00
Andoni Morales Alastruey
28609ca93c hlsdemux: add support for redirections 2013-08-12 16:41:52 +02:00
Thiago Santos
ac07f8577b dashdemux: properly error out when manifest has no streams
Post an error message when the manifest is parsed and no valid streams
are found be activated and used.

Fixes #704308
2013-07-30 22:06:38 -03:00
Sebastian Dröge
f2b14c68d5 midi: Fix handling of the SEGMENT query 2013-07-29 12:17:57 +02:00
Edward Hervey
97426a1caa all: Fix for GST_DISABLE_GST_DEBUG
Where applicable, remove methods that don't do anything different than
the default implementation.
2013-07-29 09:42:12 +02:00
David Schleef
ec35c36536 celt: remove, replaced by opus. 2013-07-28 14:24:25 -07:00
Edward Hervey
f2a10e415e mpg123: Remove dead assignment
harder ? :)
2013-07-27 06:39:15 +02:00
David Schleef
0f53ba8aed ladspa: initialize debug category earlier
You know, before it's used.
2013-07-26 13:21:05 -07:00
Sebastian Dröge
b9124cad88 hlsdemux: Implement pkcs7 unpadding
Every encrypted fragment will be a multiple of 128 bits, the last byte
contains the number of bytes that were added as padding in the end
and should be removed.

https://bugzilla.gnome.org/show_bug.cgi?id=701673
2013-07-23 13:30:52 +02:00
Sebastian Dröge
5b702b894e mssdemux: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +02:00
Sebastian Dröge
b5e7ed0428 resindvd: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +02:00
Sebastian Dröge
e63094abd5 hlsdemux: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +02:00
Sebastian Dröge
493ee3383a dash: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +02:00
Alex Ashley
ed16c9c560 hls: fix for assert failure when using encrypted HLS streams
When using an HLS encrypted stream, an assertion failure is thrown:
(gst-launch-1.0:31028): GLib-GObject-WARNING **: cannot register
existing type `GstFragment'

(gst-launch-1.0:31028): GLib-CRITICAL **: g_once_init_leave: assertion
`result != 0' failed

Eventually tracked this down to the call gst_fragment_new()
in function gst_hls_demux_decrypt_fragment.

The GstFragment class is defined in ext/hls/gstfragment.c and in
gst-libs/gst/uridownloader/gstfragment.c. Having two class definitions
with the same name causes the assert failure when trying to allocate
GstFragment. Deleting the version from hls and editing the
Makefile.am solves this assert failure.

https://bugzilla.gnome.org/show_bug.cgi?id=704555
2013-07-22 14:55:17 +01:00
Sebastian Dröge
e56efddd4a resindvd: Send stream-start event before anything else on the mpeg demuxer srcpads 2013-07-22 09:19:06 +02:00
Miguel Casas-Sanchez
7c2177b19f grabcut: Add GrabCut segmentation element
https://bugzilla.gnome.org/show_bug.cgi?id=702722
2013-07-17 11:28:28 +02:00
Thiago Santos
ec630db32f dashdemux: fix typo in check_queue_full function
It should return True when the queue IS full

Fixes #704226
2013-07-15 10:05:59 -03:00
Thiago Santos
1472dd3d58 dashdemux: implement queue full check function
Checks if the queue is full according to max buffering time
set by the user

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-07-09 01:18:54 -03:00
Thiago Santos
95c2638ba5 dashdemux: minor refactor
Split one very large function into 2 smaller but still large functions.

Also change the if conditions to positive checks to improve readability.
2013-07-09 00:47:07 -03:00
Thiago Santos
5a5e66ec90 dashdemux: handle live playback resync
During a live stream it is possible for dashdemux to lag behind on a
slow connection or to rush ahead of the connection os too fast.

For the first case it is necessary to jump some segments ahead to be able to
continue playback as old segments are usually deleted from the server.

For the later, dashdemux should wait a little before attempting another
download do give time to the server to produce a new segment
2013-07-08 23:40:14 -03:00
Thiago Santos
b316d8a677 dashdemux: fix template based segment generation
When using a template based segment list, do not try to
contruct a finite segment list for the limits of the available periods.

We might not know when the period ends (for live streams) and we can
always create the segment on demand when requested by dashdemux,
avoiding use of some memory and cpu when re-creating this list.
2013-07-08 23:39:49 -03:00
Thiago Santos
a8a355108a dashdemux: use more appropriate data structures for parsing
Replaces the 2 likely larger lists with more appropriate structures
to improve performance.

Replaces S nodes GList for a GQueue, this reduces latency to startup
because of traversing the list just append an element.

Replaces the processed media segments GList for a GPtrArray as it is
constantly acessed by index during playback.
2013-07-08 23:39:49 -03:00
Thiago Santos
b8fc98849a dashdemux: answer to latency queries
Set live if stream is live and also add to the max latency the
max internal buffering
2013-07-08 23:39:49 -03:00
Thiago Santos
9a38127467 dashdemux: prevent assertion when duration is unknown
Duration from segment being unknown is a issue from the MPD and not
a programming issue, so the assert isn't useful here. Instead check
and return an error code so the caller can fallback to alternatives
2013-07-03 19:11:45 -03:00
Thiago Santos
3030c25aed dashdemux: Fix event leak when parsing manifest fails
Always remember to unref the event before proceeding, in both success
and failure cases
2013-07-03 19:11:11 -03:00
Thiago Santos
788757dc1f dashdemux: various cleanups
Removing unused function, replacing // comments with /* */ and
replacing some GST_WARNING with GST_INFO/_DEBUG as they are meant
to be
2013-07-03 15:34:41 -03:00
Alex Ashley
5ad2a2d161 dashdemux: Change first fragment selection for live streams
When dashdemux selects its first fragment, it always selects the
first fragment listed in the manifest. For on-demand content,
this is the correct behaviour. However for live content, this
behaviour is undesirable because the first fragment listed in the
manifest might be some considerable time behind "now".

The commit uses the host's idea of UTC and tries to find the
oldest fragment that contains samples for this time of day.

https://bugzilla.gnome.org/show_bug.cgi?id=701509
2013-07-03 15:34:30 -03:00
Thiago Santos
5c480dfc13 dashdemux: only generate index segment uri if there is a template
Simple fix to avoid an assertion.
2013-07-03 10:23:45 -03:00
Greg Rutz
5920ee2777 dashdemux: Implement inheritance for certain MPD elements
According to the MPEG-DASH spec, certain elements (i.e.
SegmentBase, SegmentTemplate, and SegmentList) should inherit
attributes from the same elements in the containing AdaptationSet
or Period.

Updated the SegmentBase, SegmentTemplate, and SegmentList parsers
to properly inherit attributes from the corresponding elements in
AdaptationSet and/or Period.

https://bugzilla.gnome.org/show_bug.cgi?id=702677
2013-07-03 10:23:45 -03:00
Greg Rutz
5e0ed52880 dashdemux: Properly detect presence of xml attributes
Convert all xml attribute/content parsing functions to return a
boolean value indicating whether or not the attribute/content was
present.  We need this finer-grained control in order to properly
implement the inheritance policies described in the spec

Also fixed several memory leak conditions when handling errors in
the xml attribute/content parsing functions.

https://bugzilla.gnome.org/show_bug.cgi?id=702677
2013-07-03 10:23:45 -03:00
Thiago Santos
467b22c567 dashdemux: change debug message from warning to info
It isn't a warning/issue.
2013-07-03 10:23:45 -03:00
Thiago Santos
94c6497dfa dashdemux: protect from access to empty list data
Check if the list has elements before trying to access the last one
and causing a segfault
2013-07-03 10:23:45 -03:00
Thiago Santos
0a88daaf8e dashdemux: protect against failed header downloads
Avoids criticals when downloaded fragment is NULL
2013-07-03 10:23:45 -03:00
Olivier Crête
3f26bb9154 dashdemux: Handle case without an initialization segment
If no initialization segment is defined, then don't print a
critical or a warning, just ignore it.

https://bugzilla.gnome.org/show_bug.cgi?id=701961
2013-07-02 01:30:24 -03:00
Thiago Santos
4c89fab390 dash: save 1 or 2 string copies when getting fragment uris
Only create new string if required, saving maybe 1 or 2 str copies per
fragment.
2013-07-01 18:52:08 -03:00
Thiago Santos
aa1fe88a08 dashdemux: each fragment can have its own index
Return index URI/range to dashdemux from the mpdparser to be able
to download and deliver them downstream for playback.
2013-07-01 18:52:08 -03:00
Thiago Santos
d68fffc217 dashdemux: handle top-level index urls
Parse and provide access to top-level index segments if available.
dashdemux should push those whenever a header is pushed.

Fixes #700489
2013-07-01 18:52:08 -03:00
Arthur Shipkowski
54d87f071c dashdemux: Fix critical error output when Initialization has no URL
Issue evinced by
http://yt-dash-mse-test.commondatastorage.googleapis.com/car-20120827-manifest.mpd
which produces output like ** (gst-launch-1.0:8060): CRITICAL **:
gst_mpdparser_get_initializationURL: assertion `InitializationURL->sourceURL
!= NULL' failed

https://bugzilla.gnome.org/show_bug.cgi?id=700489
2013-07-01 18:51:30 -03:00
Thiago Santos
d9c324c6c7 dashdemux: prevent crash by checking if the segment node is present
Do not try to access range data if there is no segment node
2013-07-01 14:35:02 -03:00
Thiago Santos
d0befd39f0 dash: use same debug category for dashdemux and the mpd parser
Makes debugging easier
2013-07-01 14:22:02 -03:00
Thiago Santos
4f17112392 dashdemux: add support for range based segments
Use the mediaRange information and pass it to the uridownloader
to correctly download only the segment ranges indicated in the
MPD

https://bugzilla.gnome.org/show_bug.cgi?id=702206
2013-07-01 14:22:01 -03:00
Olivier Crête
ad7ffe64a6 srtp: Don't require a key if both auth and cipher are null 2013-06-28 20:35:16 -04:00