Commit graph

580 commits

Author SHA1 Message Date
Sebastian Dröge 6b6c7382c3 dashdemux: Use the current clock running time in addition to the QoS earliest time 2017-05-18 19:04:57 +02:00
Sebastian Dröge 133d1e86bd dashdemux: Download keyframes from the current position if we're far enough ahead
Far enough here means more than 500ms or 4 times the average keyframe
download time. There is no need to jump ahead by one average keyframe
download time in this case.

This makes playback smooth if the network is fast enough.
2017-05-18 19:04:57 +02:00
Sebastian Dröge 4efa3185bb dashdemux: Fix sync sample selection based on target time in reverse playback mode 2017-05-18 19:04:57 +02:00
Sebastian Dröge b3e2657ac1 dashdemux: Snap-seek for skipping ahead and use actual keyframe distance in the current fragment if applicable 2017-05-18 19:04:57 +02:00
Sebastian Dröge b7f87e2518 dashdemux: Don't adjust for fragment duration twice when seeking ahead in KEYUNITS mode 2017-05-18 19:04:57 +02:00
Sebastian Dröge 5d09bc04a2 dashdemux: Add current fragment duration in reverse playback mode to the position
We play from the end of the fragment to the beginning, not from the
beginning backwards.
2017-05-18 19:04:57 +02:00
Sebastian Dröge 9267b4a725 dashdemux: Never take more than the current fragment duration for estimations inside the fragment
Taking the average might give us from results.
2017-05-18 19:04:57 +02:00
Sebastian Dröge df420cc21f dashdemux: Don't increase current position if we just downloaded the moof in KEYUNIT mode 2017-05-18 19:04:57 +02:00
Edward Hervey 245d73e516 dashdemux: Improve key-unit trick mode downloading
When dealing with key-unit trick mode downloads, the goal is to
provide the best "Quality of Experience". This is achieved by:
1) maximizing the number of frames displayed per second
2) avoiding "stalling" as much as possible (i.e. not downloading and
  decoding frames fast enough)

This implementation achives this by:
1) Knowing very precisely the current keyframe being download (i.e
  more accurate than at the fragment level which might contain more
  than one keyfram). This is the new "actual_position" variable
  introduced by this commit
2) Knowing the position of downstream (provided by QoS and stored
  in the adaptivedemuxstream qos_earliest_time variable)
3) Knowing how long it takes to request and fully download a keyframe
  (the average_download_time variable)

Taking those 3 variables into account, whenever a keyframe has been
pushed downstream we calculate a "target time" (target_time variable)
which is the ideal next keyframe time to request so that:
1) It will be requested/downloaded/demuxed/decoded in time to be
  displayed without being too late
2) It will not be too far ahead that it would cause too few frames
  per second to be displayed.

How far ahead we will request is inversily proportional to how close
the actual position (actual_position) is from the downstream
position (qos_earliest_time). The more is buffered between the source
and the sink, the "closer" the target time will be, and therefore
the more frames per seconds will be displayed (up to the limit
of keyframes_per_second * absolute_rate).
2017-05-18 19:04:57 +02:00
Edward Hervey 04224ad440 dashdemux: Store average download time
This will be used to bound the download rate when working in
keyframe-only trick mode
2017-05-18 19:04:57 +02:00
Sebastian Dröge 2379dc3f5b dashdemux: Collect keyunit distance and size statistics 2017-05-18 19:04:57 +02:00
Edward Hervey d8d1fc8bc4 dashdemux: Disable bitrate switching in key-unit trick mode
This creates too much havoc for now
2017-05-18 19:04:57 +02:00
Edward Hervey 8f400c1343 dashdemux: Use new adaptivedemux trickmode macro
Reduces the lines of code, and makes it a bit more readable
2017-05-18 19:04:57 +02: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
Seungha Yang 1c6cd54477 dashdemux: Initialize sidx_position to GST_CLOCK_TIME_NONE
If a manifest has non-zero presentation time offset
(i.e., earliest presentation time specified by sidx box is not zero),
the initial sidx position shouldn't be zero. Since we cannot define
exact sidx position until parsing sidx box, set the value to unknown.

https://bugzilla.gnome.org/show_bug.cgi?id=782693
2017-05-16 17:44:40 +03:00
Sebastian Dröge db57a3b04f dashdemux: Rewrite ISOBMFF & SIDX handling
The previous code was handling both as separate steps and then tried to
combine the results, but this resulted in all kinds of bugs which showed
themselves as failures during seeking and offset tracking getting wrong.
This also showed itself with gst-validate on the sample stream.

The rewritten code now parses everything in one go and tracks the
current offset only once, and as a side effect simplifies the code a
lot.

Also added is detection of SIDX that point to other SIDX instead of
actual media segments, e.g. with this stream:
  http://dash.akamaized.net/dash264/TestCases/1a/sony/SNE_DASH_SD_CASE1A_REVISED.mpd
Support for this will have to be added at some point but that should
also be easier with the rewritten code.

https://bugzilla.gnome.org/show_bug.cgi?id=781233
2017-04-18 13:49:08 +02:00
Seungha Yang 68ac72431c mpdparser: Do sanity check of Segment Base Information only at Repesentation level
Spec 5.3.9.2 is saying about the existence of duration and SegmentTimeline
only for Representation level. Other level such as Period or AdaptationSet
might not have the attributes.

https://bugzilla.gnome.org/show_bug.cgi?id=780570
2017-04-15 18:33:41 -07:00
Seungha Yang 6167dab39e mpdparser: Allow inherit Segment{Base,Template} from Period
Similar to SegmentList, Representation can inherit Segment{Base,Template}
from Period

https://bugzilla.gnome.org/show_bug.cgi?id=780570
2017-04-15 18:33:41 -07:00
Sebastian Dröge e0e1db212f Revert "dashdemux: Fix issue when manifest update sets slow start without passing necessary header & caps changes downstream"
This reverts commit c9fbf3459a.

The representation ID comparision here was wrong and triggering always
if the ID did *not* change, causing needless redownloading of the
header. The sample stream provided in the bug does not exist anymore.
2017-04-12 20:11:16 +03:00
Thibault Saunier 78022a6e0c docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Edward Hervey 94fe5c690e mpdparser: Fix leak
The error: location takes care of freeing new_representation

CID #1405027
2017-04-12 10:54:23 +02:00
Edward Hervey 92ce999ca6 mpdparser: Run gst-indent 2017-04-12 10:54:05 +02:00
Jürgen Sachs 270f97611c dashdemux/mpdparser: Fix wrong false sanity check for manifests with nested SegmentTemplate nodes
https://bugzilla.gnome.org/show_bug.cgi?id=778237
2017-04-11 11:19:34 +03:00
Sebastian Dröge 67778ac55e dashdemux: Handle current SIDX before current position in normal mode like in keyunit-only trick mode
Otherwise we'll get into an infinite loop here. Now this is still not
correct and will cause a clean error, but at least it won't hang forever
anymore.
2017-04-10 18:46:01 +03:00
Seungha Yang a3a12d0978 mpdparser: Report error if Representation is invalid
Spec "5.3.5 Representation" is saying that
id and bandwidth attributes are mandatory fields.

https://bugzilla.gnome.org/show_bug.cgi?id=780569
2017-04-09 10:58:27 +03:00
Seungha Yang 41996ad9c0 dashdemux: Fix SEEK of multi-period On-Demand profile
For each period, media presentation is the relative to the
period-start time. So SIDX seek position should be target seek
position minus period-start. Also, if presentationTimeOffset
is defined, the value should be compensated

https://bugzilla.gnome.org/show_bug.cgi?id=780397
2017-04-09 10:54:01 +03:00
Luis de Bethencourt 2be93e47ec dashdemux: fix typo in implementation notes
s/enveloppe/envelope
2017-03-28 17:08:15 +02:00
Sebastian Dröge b8b2946e03 dashdemux: In reverse playback mode, if seeking to the beginning of a fragment, start with the previous one instead
There's no point to start downloading a fragment just to output 1ns.
2017-03-22 12:06:33 +02:00
Sebastian Dröge 19eba961d2 dashdemux: Implement SNAP_NEAREST seeks 2017-03-21 20:38:09 +02:00
Sebastian Dröge 0cc777b3b0 dashdemux: Don't use ABS() for calculating differences
We know which number is bigger.
2017-03-21 20:38:09 +02:00
Sebastian Dröge 7778e8293a dashdemux: Only snap seeks forwards if the seek position does not happen to be the exact segment position 2017-03-21 20:38:09 +02:00
Sebastian Dröge bcbf1f67f0 dashdemux: Use gst_mpdparser_get_segment_end_time() directly instead of calculating it again
It does the exact same calculations.
2017-03-21 20:38:09 +02:00
Sebastian Dröge 43d1dd3dad mpdparser: Refactor to get rid of one level of indentation in seeking code
Also go out of the segment searching loop once segment->start > ts.
We're not going to find any earlier segment anymore.
2017-03-21 20:38:09 +02:00
Sebastian Dröge ffa63c5933 dashdemux: Fix snap SIDX seeking and report if we're going outside the index
Instead of just going to the first or last fragment, report if we're
going outside the index. This should never happen unless there's a bug
or the stream is broken.

Allow some possibility for inaccuracies here though.
2017-03-21 20:38:09 +02:00
Sebastian Dröge 7e21168d4d dashdemux: Just reset SIDX parser if the index is invalid for the current segment
https://bugzilla.gnome.org/show_bug.cgi?id=780108
2017-03-16 12:35:40 +02:00
Sebastian Dröge 141f3b2f4d dashdemux: If a SIDX seek failed although we're in the correct segment, disable the SIDX usage for this segment
The SIDX apparently does not contain information about the current
segment, so better stop using it instead of using incorrect values.
2017-03-15 13:27:23 +02:00
Sebastian Dröge b76a2200de dashdemux: Keep track of the PTS, not the SIDX index position between representations
There is no guarantee that the index positions are the same between
representations, and assuming this easily causes us to get into invalid
index positions.
2017-03-15 13:27:23 +02:00
Sebastian Dröge b84f530a9a dashdemux: When clearing the sidx parser, reset all state
And especially don't keep entry count and index around, we have no
entries anymore after clearing.
2017-03-15 13:27:23 +02:00
Seungha Yang 644192aafe dashdemux: Drain buffer at the end of subfragment
Some of streams such as below have tailing boxes at the end of subfragment.
http://dash.akamaized.net/dash264/TestCases/1a/netflix/exMPD_BIP_TC1.mpd

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-15 13:27:23 +02:00
Seungha Yang 42a38b6498 dashdemux: Do not advace subfragment after pending SIDX seek done
If a MPD is On-Demand profile and no index described, demux will terminate
download loop after parsing inband SIDX with flow return custom-success.
At this moment, SIDX index is excat target position, but finish_fragment()
might cause re-advancing subfragment depending on MPD structure.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-15 13:27:23 +02:00
Seungha Yang b65e6db8d4 dashdemux: Reset SIDX related variables per fragment
SIDX's base offset (i.e., byte offset of SIDX + sidx.first_offset)
mostly vary as per fragment. Also, target SIDX index must be zero for the
new fragment.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-15 13:27:23 +02:00
Seungha Yang a599067786 dashdemux: Two depth seeking for On-Demand profile
Try to find fragment using MPD first, then do refinement to find
target subframgnet using SIDX if possible. Note that, if target fragment
was moved from the previously activated one, we should assume that
the last SIDX is invalid for new fragment.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-15 13:27:23 +02:00
Seungha Yang ad015ceef5 dashdemux: Exception handle in _sidx_seek()
If target seek position is outside of the range of sidx entries,
binary search returns NULL pointer.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-15 13:27:23 +02:00
Sebastian Dröge 0dcb1e4ecc dashdemux: Add assertion for preventing of access after the end of the sidx entries array
Better crash cleanly here than reading some random numbers from memory.
2017-03-15 13:27:23 +02:00
Seungha Yang a9c34fb9e3 dashdemux: Advance subfragment only if any exist
SIDX based playback is not restricted to SegmentBase, but it possible
with SegmentList/SegmentTemplate. In the latter case, each fragment
has its own SIDX box and might be subdivided into subfragment.
So, demux should not assume that the end of subfragment is the end
of stream. Moreover, should try advance subfragment only if there
are remaining subfragments.

With additional fixes by Sebastian Dröge <sebastian@centricular.com>

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2017-03-14 19:15:28 +02:00
Matthew Waters fd8d35298f Revert "adaptivedemux: answer duration queries for live streams"
Completely disabling duration reporting with live streams is not cool.

This reverts commit e1b68d9a65.

https://bugzilla.gnome.org/show_bug.cgi?id=753879
2017-03-14 16:50:30 +11:00
Nicolas Dufresne e03e7e7574 dash/smoothstreaming: Use GST_PLUGIN_LIBTOOLFLAGS
Use the flags defined by configure script instead of always disabling
static plugins.
2017-03-08 20:04:23 -05:00
Wojciech Przybyl 8eb87ce5dc dashdemux: fix default suggestedPresentationDelay
When MPD@suggestedPresentationDelay is not present in the MPD,
dashdemux can provide default suggestedPresentationDelay. However
when applying default value of suggestedPresentationDelay, the value
should be subtracted from current time, not added to it. When streams
setup is performed and live point is calculated, we have to go to the
wall clock (current time) minus suggestedPresentationDelay, if we tried
to start with current time plus suggestedPresentationDelay, we would
be asking for future stream, which has not yet been recorded. Also
the value needs to be converted from ms to us.

https://bugzilla.gnome.org/show_bug.cgi?id=764726
2017-03-02 20:11:55 +02:00
Alex Ashley e1b68d9a65 adaptivedemux: answer duration queries for live streams
For duration queries on live streams, adaptivedemux ignores the query.
The problem then is that the query is answered by the downstream
qtdemux element, with the duration of the currently passing fragment.

This commit changes the behaviour of adaptivedemux to answer the duration
queries for live streams, returning GST_CLOCK_TIME_NONE.

    https://bugzilla.gnome.org/show_bug.cgi?id=753879
2017-03-02 19:54:04 +02:00
Sebastian Dröge ef70cd48c6 dashdemux: Fix potential NULL pointer dereference
CID 1399700
2017-02-28 15:53:10 +02:00
Seungha Yang fe9d778fa3 dashdemux: Do pending seek when SIDX is found
Parsing SIDX box was allowed even if "indexRange" attribute does not appear
for On-Demand profile. However, actual seeking using SIDX index did not happen
since download loop keep working on.
To use SIDX index in that case, demux should try it in the next download loop.

https://bugzilla.gnome.org/show_bug.cgi?id=777394
2017-01-18 13:14:44 +02:00
WeiChungChang c9fbf3459a dashdemux: Fix issue when manifest update sets slow start without passing necessary header & caps changes downstream
https://bugzilla.gnome.org/show_bug.cgi?id=777206
2017-01-18 13:13:15 +02:00
Edward Hervey 5422728c7f mpdparser: Fix compilation with GST_DISABLE_GST_DEBUG 2017-01-16 14:33:05 +01:00
Seungha Yang 72afd74ef4 dash: Include debug of gstisoff on dashdemux category
Move debug category of gstisoff from default to dashdemux

https://bugzilla.gnome.org/show_bug.cgi?id=776461
2016-12-24 08:22:10 +02:00
Seungha Yang 4523cff147 dashdemux: Add first_offset of sidx box to base offset
sidx has "first_offset" syntax which represents the distance in bytes
from anchor point to media fragment. If present, we should adjust
sidx_base_offset.

https://bugzilla.gnome.org/show_bug.cgi?id=776431
2016-12-23 12:16:10 +02:00
Seungha Yang c0540fb773 dashdemux: Ensure sidx parsing when updating fragment info
Fix seek fail with On-Demand profile mpd which has no indexRange attribute

https://bugzilla.gnome.org/show_bug.cgi?id=776431
2016-12-23 12:16:10 +02:00
Seungha Yang 998c8ce246 dashdemux: Drain remaining buffer in adapter
Previous patch allows sidx box parsing from incoming buffers.
Since the incoming buffer boundary might be over sidx box,
there can be remaining buffer in isobmff parser adapter.

https://bugzilla.gnome.org/show_bug.cgi?id=776352
2016-12-22 14:12:58 +02:00
Seungha Yang 124e386da8 dashdemux: Always parsing sidx for On-Demand profile
The indexRange attribute is optional and if it's not present, we should
extract the sidx box from incoming buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2016-12-20 12:55:40 +02:00
Seungha Yang dfa300cb6d dash: Split gst_isoff_sidx_parser_add_buffer() function
To parsing sidx box itself with isobmff parser,
split gst_isoff_sidx_parser_add_buffer() into two parts.

https://bugzilla.gnome.org/show_bug.cgi?id=776200
2016-12-20 12:55:40 +02:00
Sebastian Dröge 788bb67639 dashdemux: Don't declare variables inside the for loop header
This is a C99 feature.
2016-12-13 22:21:25 +02:00
Sebastian Dröge eef53ef6ed dash: Fix stripping of space at the beginning/end of durations
The way how strchr() was called here, it could easily read after the end
of the string. Use g_ascii_isspace() instead.

Detected by asan in the unit test.
2016-11-27 12:20:11 +02:00
Sebastian Dröge 8d8661f1f8 mpdparser: Don't set variable just to overwrite it again later
We set it to TRUE here, but later we set it to TRUE again anyway if the
parsing actually succeeded at this point. Let's keep the second one.

CID 1374360.
2016-11-23 19:01:04 +02:00
Seungha Yang 37e13494ec mpdparser: Modify return of the function for loading external resources to void
gst_mpd_client_fetch_on_load_external_resources() never ever return
FALSE due to modified external xml loading functions.

https://bugzilla.gnome.org/show_bug.cgi?id=774463
2016-11-21 09:43:30 +02:00
Seungha Yang 3c31c47259 mpdparser: Handle invalid external xml link for SegmentList element
Ignore invalid xml link for SegmentList likewise external Period without error.

https://bugzilla.gnome.org/show_bug.cgi?id=774463
2016-11-21 09:43:30 +02:00
Seungha Yang ae8759c33e mpdparser: Handle invalid external xml link for AdaptationSet element
Ignore invalid xml link for AdaptationSet likewise external Period without error.

https://bugzilla.gnome.org/show_bug.cgi?id=774463
2016-11-21 09:43:30 +02:00
Seungha Yang e454694f0a mpdparser: Handle invalid external xml link for Period element
Section 5.3.3 in ISO/IEC 23009-1:2014 defines that invalid references
(e.g., invalide URI or cannot be resolved) specified by "@xlink:href" attribute
shall be removed. That means, we should play it without error,
and just ignore the corresponding element.
It's similar to "urn:mpeg:dash:resolve-to-zero:2013".

https://bugzilla.gnome.org/show_bug.cgi?id=774463
2016-11-21 09:43:30 +02:00
Seungha Yang 2b44392095 dashdemux: Fix leak in gst_dash_demux_stream_free
Free parsed moof and sync samples with _stream_free().

https://bugzilla.gnome.org/show_bug.cgi?id=774702
2016-11-19 12:01:20 +02:00
Seungha Yang 68e4f919a0 mpdparser: Support multiple Period elements in external xml
External xml could have empty, one or multiple top-level "Period" elements.
Because xml parser cannot parse the multiple top-level elements
(i.e., no root element), we need to wrap a xml in order to make root element.
See also ISO/IEC 23009-1:2014 5.3.2.2

https://bugzilla.gnome.org/show_bug.cgi?id=774357
2016-11-14 16:56:43 +02:00
Philippe Normand 0fbd2edaff mpdparser: wrap unmodified data in protection event
PlayReady being the one of the few DRM formats encoding its data with
base64 it was not consistent to have a special case for this. So the
base64 decoding operation now needs to be done by the protection event
consumer, if needed.

https://bugzilla.gnome.org/show_bug.cgi?id=774112
2016-11-14 11:50:13 +01:00
Philippe Normand dd0c56b4a2 mpdparser: MS PlayReady ContentProtection parsing
The "pro" (PlayReady Object) element contents are now base64-decoded
and properly stored in Protection events.

https://bugzilla.gnome.org/show_bug.cgi?id=773936
2016-11-04 17:04:59 +02:00
Nirbheek Chauhan f790863755 Explicitly define float constants as float
With MSVC, this gives the following warning:

warning C4305: 'function': truncation from 'double' to 'gfloat'

Apparently, MSVC does not figure out what type to use for constants
based on the assignment. This warning is very spammy, so let's try to
fix it.
2016-10-27 23:06:26 +05:30
Thiago Santos a94eef9357 dash: do not use invalid stream duration
If it is is unknown, consider it infinite

https://bugzilla.gnome.org/show_bug.cgi?id=768460
2016-10-20 11:17:34 -03:00
Thiago Santos 6eef9971be dash: properly inherit segmentlist from period
Representation can inherit SegmentList from Period if none is available
from the AdaptationSet

https://bugzilla.gnome.org/show_bug.cgi?id=768460
2016-10-20 11:17:32 -03:00
Sebastian Dröge 4734b10c6f dashdemux: Add properties to select maximum allowed width/height and framerate
https://bugzilla.gnome.org/show_bug.cgi?id=770408
2016-08-26 18:12:23 +03:00
Sebastian Dröge 4f6ae1f48c adaptivedemux: Enable bitrate selection for trick mode streaming again
And scale the bitrate with the absolute rate (if it's bigger than 1.0) to get
to the real bitrate due to faster playback.

This allowed in my tests to play a stream with 10x speed without buffering as
the lowest bitrate is chosen, instead of staying/selecting the highest bitrate
and then buffering all the time.

It was previously disabled for not very well specified reasons, which seem to
be not valid anymore nowadays.
2016-08-25 19:52:37 +03:00
Nirbheek Chauhan 42af2d66d8 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:35:54 +01:00
Sebastian Dröge e786f737ae dashdemux: In KEY_UNITS trick mode, download all I-frames and not only IDR 2016-08-18 13:21:54 +03:00
Sebastian Dröge 02f688ee9d Revert "Revert "dashdemux: When doing SIDX seeking, return instead of overriding the timestamp with 0 from the MPD seeking method""
This reverts commit aea2c13fc1.
2016-08-11 12:11:22 +02:00
Sebastian Dröge 18e5e64b05 dashdemux: When doing chunked downloading on SIDX, clip requests on the SIDX entry boundaries
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 9c04d1e13c dashdemux: Collect average moof and first sync sample sizes
And always request those in the beginning so that ideally we get the moof and
the first sync sample all together with the first HTTP request.

https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 7f1f777b92 dashdemux: Download any sync-sample following the moof directly in key-units only mode
We don't have to do yet another additional request but can just download the
data directly.

Also unify the key-unit only mode buffer pushing and extract it into its own
function now that it became more complicated.

https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge f8eddabe29 dashdemux: If a fragment contains no sync samples, disable key-unit mode
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge cfad48ce5a dashdemux: Remember if for a stream we could do key-units only mode
This makes sure we don't even try going into that mode if we previously saw
that the stream does not have the suitable metadata.

https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge b936c00f51 dashdemux: Also allow key-unit only mode if (some) sample flags are given by trex but we can still find sync frames
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 47ef88f20e dashdemux: Use chunked downloading for the moof in KEY_UNITS mode
Allows us to reuse the HTTP connection and reduce latencies a lot.

https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 7b4fe1e02f dashdemux: Mark every first buffer of moov, sidx, moof and mdat as DISCONT in keyframe-only mode
We need to mark every first buffer of a key unit as discont, and also every
first buffer of a moov and moof. This ensures that qtdemux takes note of our
buffer offsets for each of those buffers instead of keeping track of them
itself from the first buffer. We need offsets to be consistent between moof
and mdat

https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 12c2415251 dashdemux: Only enable key-unit trick mode for video streams
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 9dd8789323 dashdemux: Only do keyframe-only playback if the corresponding seek flag is given
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 70bc183a52 dashdemux: Implement downloading of only sync samples
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge 5b943135ac dashdemux: Store parsed moof and extract offsets of sync samples in it
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:55 +02:00
Sebastian Dröge fff814bbe5 dashdemux: Implement parsing of moof box
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:54 +02:00
Sebastian Dröge 7d4f6ca0a9 dashdemux: Move code around to keep all sidx related functions together
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:54 +02:00
Sebastian Dröge c4ad30d6b4 dashdemux: Store box fourccs in the header at a central place
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:54 +02:00
Sebastian Dröge 0b0a1a52d3 dashdemux: Implement parsing of ISOBMFF boxes
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:54 +02:00
Sebastian Dröge 37ff8abe1c dash: Add helper for parsing box headers
https://bugzilla.gnome.org/show_bug.cgi?id=741104
2016-08-11 11:56:54 +02:00
Edward Hervey aea2c13fc1 Revert "dashdemux: When doing SIDX seeking, return instead of overriding the timestamp with 0 from the MPD seeking method"
This reverts commit 947656cfd2.

This makes all dash seeking tests fail. Needs more testing to fully understand
what's going wrong. Revert ok'd by Sebastian
2016-08-05 09:16:58 +02:00
Sebastian Dröge 947656cfd2 dashdemux: When doing SIDX seeking, return instead of overriding the timestamp with 0 from the MPD seeking method
We don't need to call the latter at all as we're definitely in this period and
the segment is selected via the SIDX.

This is especially important when doing SNAP seeks, as otherwise we would
always start from the beginning of the period (usually 0) again.
2016-08-04 15:10:02 +03:00
Alex Ashley d9bcf4dbd9 dashdemux: include segment duration when calculating seek range
The gst_dash_demux_get_live_seek_range () function returns a stop value
that is beyond the available range. The functions
gst_mpd_client_check_time_position() and
gst_mpd_client_get_next_segment_availability_end_time() in
gstmpdparser.c include the segment duration when checking if a segment
is available. The gst_dash_demux_get_live_seek_range() function
in gstdashdemux.c ignores the segment duration.

According to the DASH specification, if maxSegmentDuration is not present,
then the maximum Segment duration is the maximum duration of any Segment
documented in the MPD.

https://bugzilla.gnome.org/show_bug.cgi?id=753751
2016-08-02 12:52:34 +01:00
Sebastian Dröge a7adb5cb60 dashdemux: Skip audio streams if TRICKMODE_NO_AUDIO is given in the seek event
We just don't expose pads for audio streams, or even download them.
2016-07-28 20:44:29 +03:00
Sebastian Dröge 269a8c5fdf dashdemux: Reset number of subtitle streams counter on reset() too
Otherwise we will continue increasing forever the number of subtitle streams
when reusing the element for another DASH manifest.
2016-07-28 11:17:15 +03:00