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
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.
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.
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
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
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
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
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
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
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
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
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
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.
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.
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
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
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
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.
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.
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.htmlhttp://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.
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
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
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
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.
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
This simplifies the code but also removes a bug with tracking of the remaining
size for the initial subfragment: we were not considering the size between the
index and the start of the first moof here.
https://bugzilla.gnome.org/show_bug.cgi?id=764684
A realtime clock is used in many places, such as deciding which
fragment to select at start up and deciding how long to sleep
before a fragment becomes available. For example dashdemux needs
sample the client's estimate of UTC when selecting where to start
in a live DASH stream.
The problem with dashdemux calculating the client's idea of UTC is
that it makes it difficult to create unit tests, because the passage
of time is a factor in the test.
This commit changes dashdemux and adaptivedemux to use the
GstSystemClock, so that a unit test can replace the system clock when
it needs to be able to control the clock.
This commit makes no change to the behaviour under normal usage, as
GstSystemClock is based upon the system time.
https://bugzilla.gnome.org/show_bug.cgi?id=762147
The code in the gst_dash_demux_parse_http_xsdate() was trying to
handle the case where the string is not null terminated by resizing
the buffer and appending a zero byte. This does not work if the buffer
is exactly the length of the string because the gst_buffer_resize()
function does not re-allocate the buffer, it just changes its size.
If a buffer is passed to gst_dash_demux_parse_http_xsdate() that is
exactly the length of the string, the function fails with an assert
failure in gst_buffer_resize().
https://bugzilla.gnome.org/show_bug.cgi?id=762148
The function actually returns the segment availability start time (as defined by the standard).
That is at the end of the segment, but it is called availability start time.
Availability end time is something else (the time when the segment is no longer
available on the server). The function name was misleading.
https://bugzilla.gnome.org/show_bug.cgi?id=757655
Adaptive demuxers need to start downloading from specific positions
(fragments) for every stream, this means that all streams can snap-seek
to a different position when requested. Snap seeking in this case will
be done in 2 steps:
1) do the snap seeking on the pad that received the seek event and
get the final position
2) use this position to do a regular seek on the other streams to
make sure they all start from the same position
More arguments were added to the stream_seek function, allowing better control
of how seeking is done. Knowing the flags and the playback direction allows
subclasses to handle snap-seeking.
And also adds a new return parameter to inform of the final
selected seeking position that is used to align the other streams.
https://bugzilla.gnome.org/show_bug.cgi?id=759158
For a live mpd, if availabilityStartTime is missing, adaptive demux asserts
with: Unexpected critical/warning: gst_date_time_to_g_date_time: assertion
'datetime != NULL' failed.
This patch improves the error message to:
Unexpected critical/warning: gst_mpd_client_seek_to_time: assertion
'client->mpd_node->availabilityStartTime != NULL' failed
https://bugzilla.gnome.org/show_bug.cgi?id=757602
Handling the ghostpad and its internal pad was causing more issues
than helping because of their coupled activation/deactivation
actions.
As we have to install custom chain,event and query functions it is
better to use a floating sink pad internally in the demuxer and just
use those pad functions to push through a standard pad in the demuxer
https://bugzilla.gnome.org/show_bug.cgi?id=757951