Commit graph

139 commits

Author SHA1 Message Date
Thiago Santos
08636f3bab dashdemux: expose all streams
always expose all streams instead of only exposing one of each type.

This is more aligned with gstreamer's way of working. Allows the user
to select the stream that it wants to use by linking its pad and leaving
the unused ones as unlinked.
2013-12-24 17:07:51 -03:00
Greg Rutz
6819d1a206 dashdemux: Improve if cause readability
Fixed up the error-handling code when downloading fragments.
Modifed the error-handling code to use positive logic when
testing for cancellation of the download loop.

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-10-03 09:15:37 -03:00
Thiago Santos
b8dd95e219 dashdemux: actually return true on latency query
Do not forget to set the return for latency query
2013-10-03 09:15:37 -03:00
Alex Ashley
42fd04ce48 dashdemux: stop fetching live fragments that don't yet exist
There is an issue for live streams where download_loop will keep
downloading segments until it gets a 404 error for a segment
that has not yet been published. This is a problem because this
request for a segment that doesn't exist will propagate all the
way back to the origin server(s). This means that dashdemux causes
extra load on the origin server(s) for segments that aren't yet
available.

This patch uses availabilityStartTime, period
and the host's idea of UTC to decide if a fragment is available to
be requested from an HTTP server and filter out requests for fragments
that are not yet available.

https://bugzilla.gnome.org/show_bug.cgi?id=701404
2013-10-03 09:15:37 -03:00
Josep Torra
47c35ee52e dashdemux: Fix warnings when building in OS X Snow Leopard
gstdashdemux.c:1753: warning: format '%llu' expects type 'long long unsigned int', but argument 8 has type 'long unsigned int'
gstdashdemux.c:2224: warning: format '%llu' expects type 'long long unsigned int', but argument 9 has type 'guint64'
gstdashdemux.c:2224: warning: format '%llu' expects type 'long long unsigned int', but argument 10 has type 'guint64'
2013-08-30 21:52:35 +02: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
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
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
Sebastian Dröge
493ee3383a dash: Add support for group-id in the stream-start event 2013-07-23 10:33:31 +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
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
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
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
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
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
5732c53c81 dashdemux: Make gst-indent happy 2013-06-10 18:01:09 -04:00
Arthur Shipkowski
3d50af3e4b dashdemux: Fix issue with get returning a value for max-buffering-time
It was not properly divided by GST_SECONDS. Also fix issue with
max-buffering-time being multiplied by GST_SECONDS every time the
property is retrieved.

https://bugzilla.gnome.org/show_bug.cgi?id=700487
2013-06-07 22:58:33 -03:00
Thiago Santos
d434f36245 dashdemux: send stream start event
Removes warnings about strict sticky events ordering
2013-05-17 21:23:55 -03:00
Olivier Crête
220f075423 dashdemux: Announce correct mpegts caps 2013-05-15 22:24:29 -04:00
Tim-Philipp Müller
0d7967e25e dashdemux: rename src template from src%d to src_%u 2013-05-08 23:17:08 +01:00
Thiago Santos
919cb34fee dash: do not use deprecated glib mutex API 2013-05-08 18:14:46 -03:00
Thiago Santos
34e1b59eca dashdemux: fixing compiler warnings about print formats 2013-05-08 18:14:46 -03:00
Thiago Santos
9f190cdff7 dashdemux: port to 1.0 2013-05-08 18:14:46 -03:00
Thiago Santos
b338cc0d34 dashdemux: Fix another wrong assertion
Also adds a couple log messages for easier debugging
2013-05-08 18:14:46 -03:00
Thiago Santos
3472efda75 dashdemux: remove wrong asserts
Those asserts should be the contrary that they are. And also
the surround functions should already check that. Removing them.
2013-05-08 18:14:46 -03:00
Wim Taymans
665d59edba dashdemux: only start timestamp from 0 for live stream
We only want to adjust the timestamps so that they start from 0 for live
streams. Non-live streams already start from 0 and after a seek we actually want
to timestamp to be the position we seek to.
2013-05-08 18:14:45 -03:00
Wim Taymans
4f9f0b84cf dashdemux: make timestamps start from 0
Non-live streams should timestamp buffers with a running-time starting from
0. Since we already push a 0 -> -1 segment, bring the timestamps to 0
by subtracting the initial timestamp.
2013-05-08 18:14:45 -03:00
Wim Taymans
4ab58e0fb1 dashdemux: also send newsegment on startup 2013-05-08 18:14:45 -03:00
Wim Taymans
cfcaa23959 dashdemux: small cleanup 2013-05-08 18:14:43 -03:00
Thiago Santos
afccf149af dashdemux: live stream playback crashfix 2013-05-08 18:14:42 -03:00
Thiago Santos
14feeb3ccb dashdemux: reimplementing live streams manifest updates
Manifest updates should be done periodically for live streams,
this patch makes the demuxer create a new manifest client for
the new version and transfers the stream position to the new
one, discarding the old one afterwards.
2013-05-08 18:14:42 -03:00
Thiago Santos
4ca530f2fe dashdemux: plug some leaks
Add some missing free/unrefs spotted by valgrind
2013-05-08 18:14:41 -03:00
Thiago Santos
c82606a600 dashdemux: remove unused mutexes 2013-05-08 18:14:41 -03:00
Thiago Santos
737d328bb5 dashdemux: properly reset stream status after a flush
The stream eos/end of period status must also be reset after a flushing
seek. This makes seeking after EOS work.
2013-05-08 18:14:41 -03:00
Andre Moreira Magalhaes (andrunko)
fbbf713e45 dashdemux: keep a list of streams periods
Keep a list of streams per period so that the download loop can keep
downloading while the stream loop is still pushing old period's data.
2013-05-08 18:14:41 -03:00
Andre Moreira Magalhaes (andrunko)
6ecb58c4f8 dashdemux: Remove unused members. 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
497500dbfe dashdemux: Only send newsegment on seek. 2013-05-08 18:14:40 -03:00
Thiago Santos
3bc62ccc51 dashdemux: send segments that overwrite previous ones
This is only done for seeks, so it is fine
2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
2b83b4410c dashdemux: switch bitrates without switching pads 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
11697b9968 dashdemux: Remove unusued method. 2013-05-08 18:14:40 -03:00
Andre Moreira Magalhaes (andrunko)
daea47d3f4 dashdemux: Set stream need_header after seek and has_data_queued to FALSE when flushing stream. 2013-05-08 18:14:40 -03:00