Commit Graph

108 Commits

Author SHA1 Message Date
Iragne 051a8c5edd fix(DASH): Live DASH allows segment overlap in the updated manifest for first new segments (#7405)
fix(DASH): Live DASH allows segment overlap in the updated manifest for
first new segments to avoid creating GAP with ms inaccurate manifest vs
Segment duration and start time

Fixes https://github.com/shaka-project/shaka-player/issues/7397
2024-10-15 12:49:17 +02:00
Álvaro Velad Galván e7229fbc18 fix(DASH): Allow mixing SegmentTemplate-SegmentTimeline with SegmentTemplate-numbering (#7286)
Fixes https://github.com/shaka-project/shaka-player/issues/7192
2024-09-12 09:45:29 +02:00
Álvaro Velad Galván a1d3927640 fix(DASH): Fix allPartialSegments signal when using L3D (#7179) 2024-08-20 11:54:01 +02:00
theodab b4e04b6616 feat: Store bandwidth info inside references. (#6825)
Issue #6725

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-07-23 14:32:09 +02:00
Álvaro Velad Galván a5adb39713 feat(DASH): Support Annex I: Flexible Insertion of URL Parameters (#7086)
Resolves https://github.com/shaka-project/shaka-player/issues/6472
2024-07-23 08:49:22 +02:00
Álvaro Velad Galván d1435c7459 fix(DASH): Improve memory usage with live streams (#7039)
Related to https://github.com/shaka-project/shaka-player/issues/6610
2024-07-15 14:46:39 +02:00
Álvaro Velad Galván 3cb40bf516 feat(DASH): Add support for urn:mpeg:dash:ssr:2023 with SegmentTemplate $Number$ (#6745) 2024-07-09 09:27:51 +02:00
Álvaro Velad Galván c574be4377 fix(DASH): Fix update of SegmentTemplate with $number$ for LL (#6687) 2024-05-29 09:27:23 +02:00
Dave Nicholas d38aabf04d feat(DASH): Add MPD Patch support (#5247)
Closes https://github.com/shaka-project/shaka-player/issues/2228

---------

Co-authored-by: Wojciech Tyczyński <wojciech.tyczynski@sky.uk>
2024-05-29 08:11:28 +02:00
Álvaro Velad Galván 6c47f8be65 fix(DASH): Fix get partial current position for LL when using SegmentTemplate@duration (#6516) 2024-05-01 00:09:17 +02:00
Cristian Atehortúa 2dd85e4e23 fix(DASH): decrease memory preasure on manifest with SegmentReference by updating old initSegmentReference (#6499)
Helps on #6070
2024-04-29 11:54:14 -07:00
theodab 1da5da9790 fix(DASH): Fix support for multi-mimeType variants (#6348)
A previous PR, #5950, added support for variants that contain multiple
different codecs.
It was supposed to also add support for variants with multiple
mimeTypes, but that part didn't work correctly. This reworks a lot of
#5950 and #6047, to change how they handle such complicated variants.

This has the side-effect of allowing the stream utils to differentiate
between content that has multiple codecs because of type changes, and
content that has multiple codecs because of being muxed video+audio.

Fixes #6010

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2024-04-10 02:48:57 -07:00
Álvaro Velad Galván 07a32419d3 feat(DASH): Add signalling the last segment number in Period (#6416)
Closes https://github.com/shaka-project/shaka-player/issues/2430

Test stream:
http://dash.akamaized.net/dash264/TestCasesIOP41/LastSegmentNumber/1/manifest_last_segment_num.mpd
2024-04-09 09:35:53 +02:00
Dave Nicholas 67cd2dd29d fix(tXml): html unescape node attributes with urls (#6267)
To provide feature parity with the `DOMParser.getAttribute` API which
would unescape html entities for free this PR unescapes url strings
which come from node attributes.

In a similar vain to
https://github.com/shaka-project/shaka-player/pull/6198 which unescapes
child strings.
2024-02-23 08:55:07 -08:00
Wojciech Tyczyński 4a0d1ca06f fix(DASH): Fix precision issue on some platforms (#6258)
When recalculations of period end are made, it is possible that we will not be able to find last segment from period on low precision platforms. To mitigate it, try to use cached value of `periodEnd_` whenever possible.

Issue observed on Xbox One & Xbox Series.
2024-02-20 10:23:06 -08:00
Dave Nicholas 7116a34ec2 feat!: Remove DOM Parser (#6063)
## Background: 
The native DOM Parser can perform poorly on some older devices, this
approach is faster on newer devices but is considerably better on older
devices.
This PR replaces the usage of the DOM Parser for DASH, MSS, VTT and
TTML.

The draw back of this approach that it does not include any validation
at the cost of better performance.
2024-01-22 08:39:06 +01:00
Álvaro Velad Galván 31c06ca189 feat: Rename aes128Key to aesKey to allow aes256 in the future (#5990)
See:
https://mailarchive.ietf.org/arch/msg/hls-interest/RZBgatOvI4W0M0J5cShuXWzdigg/
2023-12-05 11:57:14 +01:00
Álvaro Velad Galván 30de1771cf fix(DASH): SegmentTemplate@media not updated after change in manifest (#5899)
Fixes https://github.com/shaka-project/shaka-player/issues/5898
2023-11-16 19:21:27 +01:00
Dave Nicholas d8aa24f41d fix(DASH): Segments being fetched out of the range of the timeline (#5889)
Fixes: https://github.com/shaka-project/shaka-player/issues/3952
2023-11-16 09:48:12 +01:00
Álvaro Velad Galván 5f891d98d6 fix(DASH): Fix bad url when specify MPD BaseURL and AdaptationSet BaseURL (#5883)
Fixes https://github.com/shaka-project/shaka-player/issues/5882
2023-11-14 16:00:20 +01:00
Álvaro Velad Galván 508e5cfbba feat(DASH): Add initial support for "urn:mpeg:dash:ssr:2023" (#5762) 2023-11-03 14:57:15 +01:00
Albin Larsson 8d2b6574de fix(dash): fix race condition in segment template (#5842)
Fixes https://github.com/shaka-project/shaka-player/issues/5760
2023-11-02 09:23:01 +01:00
Álvaro Velad Galván 5e9245a384 chore(DASH): Update DASH URL management to allow Content Steering in the future (#5739) 2023-10-09 09:40:42 +02:00
Álvaro Velad Galván 45009d2c0c fix(DASH): Fix bigint implementation (#5707) 2023-10-02 23:17:52 +02:00
Álvaro Velad Galván 96ae7f2fe6 feat(DASH): Add support for AES-128 (#5656)
Closes https://github.com/shaka-project/shaka-player/issues/5622
2023-09-16 07:34:42 +02:00
Álvaro Velad Galván 4a1c96e630 feat(DASH): Allow the playback of DASH with $time$ and large timescale value (#5621)
Closes https://github.com/shaka-project/shaka-player/issues/4337

Only supported on browsers with support to BigInt
2023-09-12 20:57:33 +02:00
Álvaro Velad Galván 29d9a10705 fix(DASH): Fix race condition error while switching audio tracks (#5619)
Fixes https://github.com/shaka-project/shaka-player/issues/5614
2023-09-08 22:34:53 +02:00
Joey Parrish d4dca2a571 chore: Fix core build without dash (#5289)
- Move TimeRange from shaka.dash.MpdUtils to
shaka.media.PresentationTimeline
- Move AccessibilityPurpose from shaka.dash.DashParser to
shaka.media.ManifestParser

With these changes, core Shaka Player can be built without the dash
module.
2023-06-13 12:23:55 +02:00
Wojciech Tyczyński 2d9f56627a fix(DASH): Fix bufferBehind with image tracks regression (#5210)
A recent change to allow for on-demand segment references (#5061) ended up causing a
regression with an older issue (#4717), where the presence of an image track overrides
`bufferBehind` behavior.
This fixes the segment template handler to properly account for image tracks, once again.
2023-05-04 14:47:44 -07:00
Nick Crast f1c5a1c191 feat(dash): Improve DASH SegmentTemplate performance with on-demand segment references (#5061)
This is a performance optimization intended to reduce the Video Start
Time for DASH streams, both VOD and Live, by reducing the amount of
processing done during manifest parse time. This is especially effective
for long multi-period assets, assets with many variants, or on low end
devices in general. I've provided some measurements showing the
performance improvements at the conclusion of this PR.

Currently, during manifest parse time for a Segment Template, Shaka will
loop through the entire timeline and create segment references for each
timeline entry. For a long asset, or an asset with many tracks, this is
a significant amount of processing.

I've created a new entity called the Timeline Segment Index that extends
the SegmentIndex interface. The purpose of the Timeline Segment Index is
to ingest a timeline during construction, and then use that information
to build Segment References only on demand. This removes the need to
parse the entire timeline and create all of the Segment References
during parse time.

The effects of this change aren't quite as apparent on desktop web
browsers, given their speed and power. This improvement really shines on
lower end TVs on assets with a long timeline.

DASH parsing speed-ups in some cases can be as much as 40%.

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2023-04-28 17:20:33 -07:00
theodab fbce38af1c feat(net): Added advanced type to filters (#5006)
This adds an optional parameter to request and response filters, of a
new enum called AdvancedRequestType.
This enum describes request types that are subtypes of the basic types.
For example, INIT_SEGMENT is a type of SEGMENT.
This gives users more information about the type of the request, while
maintaining backwards compatibility.

Closes #4966
2023-02-23 11:56:23 -08:00
Álvaro Velad Galván 056588b2e1 fix(DASH): Fix dynamic manifests from edgeware (#4914)
Fixes https://github.com/shaka-project/shaka-player/issues/4913

---------

Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
Co-authored-by: Joey Parrish <joeyparrish@google.com>
2023-01-30 18:22:05 +01:00
Casey Occhialini cd1b7c0942 fix: Fix bufferBehind setting broken by image segments (#4718)
Resolves #4717
2022-11-17 09:17:34 -08:00
Álvaro Velad Galván 298b60481d fix(dash): Fix performance regression (#4064)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210
2022-03-25 13:56:38 -07:00
Aidan Ridley bd7b384c66 feat: Add media quality change events (#3700)
Closes ##3431
2021-11-12 15:07:18 -08:00
Theodore Abshire b8b72a900d fix(dash): Notify segments on all updates.
Before, when using SegmentTemplate or SegmentList, we would tell
the presentation timeline about new segments only when we saw a
new period or representation. This meant that, in live streams,
if new content was being added to the SegmentTemplate or SegmentList,
the presentation timeline was not being kept abreast of the changes.
Thus, if that stream were to then transition to VOD, the presentation
timeline would suddenly start to report that the current time was
beyond the end of the seek range, which caused playback to stop.

Closes #3675

Change-Id: I77ef00c5a86de9ebcb86f18f792084ed70f94e8d
2021-10-28 00:44:18 -07:00
Michelle Zhuo fce5935800 refactor(dash): Use map of streams for Dash Parser
This is a step prior to the closeSegmentIndex implementation.
In the DashParser, use a map of context id to stream instead of
context id to segment index when parsing SegmentList.

For Dash live content, every time we parse a manifest update, we
create a new Stream object, leaving the old stream with its old
segment index.
If we close the segment index and create it later again, we need
update the stream's segment index.

Change-Id: I7a3af3666ddb4e26362c40eeb82c3d050fafe3ee
2021-09-10 13:43:19 -07:00
Joey Parrish d4a1255235 fix: Fix thumbnail duration, expose start time and duration
Thumbnail segments may be structured for a certain grid size and
duration, but the segment references may have their duration truncated
due to the end of a period or the end of the presentation.  This was
causing us to calculate the wrong duration for those individual
thumbnails, and therefore return the wrong
thumbnail.

We also did not have any way to indicate to an application how long a
thumbnail should be shown.

This fixes the duration calculation by retaining the original,
untruncated duration in SegmentReference.  This also exposes startTime
and duration information on the Thumbnail object, so that applications
know when/where and how long to show a given thumbnail.

Closes #3517

Change-Id: I84aa7705a19691fc6ae68eee9944fecbd7067fe0
2021-07-14 15:37:43 +00:00
Aidan Ridley 9dc466475a fix: Fix buffering due to re-fetch (SegmentTemplate+duration) (#3419)
In DASH with SegmentTemplate and a fixed duration, indexes would
continue to grow so long as they had not ended.  However, this was
based on a callback which captured an end time variable that could
become out-of-date in a multi-period live stream.

This prevents indexes from continuing to grow indefinitely by always
using the most up-to-date end time for the period.

This also fixes eviction of segments in the same scenario, which
fixes SegmentIterator access and related assertions later.

Issue #3354 (partial fix)

b/186457868

Change-Id: I2b34ee52dd12b59e1c1237258050b50e3189bee3
2021-06-16 13:23:08 -07:00
ismena 7e50866bb5 fix(dash): Fix stalls on a live dash stream.
In live streams, we can evict segments outside the availability window
faster than they disappear from the manifest. If that happens, we used
to evict them several times (add them back in and then evict again).
This caused the eviction counter to increase beyond what it should be
and we had trouble finding segments afterwards.

Closes #3139.

Change-Id: Iafebfaf8e1e9ebb09a64cdf7e09a882115fd8eb6
2021-04-14 19:41:30 +00:00
Jacob Trimble 78357ed785 fix(media): Fix playback of some multi-Period content.
When a Period has segments outside the Period, we evict them during
manifest parsing.  However, this eviction shouldn't affect the position
of segments since these never existed.

Fixes #3230

Change-Id: I0494d9c38b51857967ed4b572475ddcc37f815a0
2021-03-17 16:39:11 +00:00
Joey Parrish d3dfabceb1 fix: Fix segment refs for "future" DASH periods
When a multi-period DASH manifest contains periods which are in the
future (described in the manifest, but with all segments past the
current end time of the segment availability window), the segments
generated for SegmentTemplate were invalid.  Not all DASH multi-period
content describes unavailable future periods, so many providers using
DASH would not see this issue.  This bug affected v3.0.0 - v3.0.7.

To fix this, we change the "next position" calculation for updates to
clamp to the minimum valid position.  This avoids creating segment
references with negative position numbers for these future periods.
When the segment availability window moves to include this period, we
will then start generating segments for it (starting at position 0 or
whatever the startNumber attribute is for this period).

However, the contract for updateEvery() in SegmentIndex was such that
the timer would stop if the list of references was every empty.  This
was meant to handle the case in which all segments were evicted, but
it could be triggered instantly on these "future" periods, for which
no segments exist yet in the availability window.  To resolve this,
the contract was changed so that the updateEvery() callback must
explicitly signal a stop by returning null instead of an array of
segment references.

Bug: 179025415

Change-Id: I56a2826fd3aea3f69da7b8bf4fa7629562d63506
2021-02-08 22:18:24 +00:00
Dany L'Hébreux ed953bf76c fix(DASH): fix memory leak with SegmentTimeline (#3039)
We found the issue within our app with the latest Chromecast CAF receiver update (November 22, 2020) that use Shaka 3.0.x. With our live stream containing 90 minutes of buffer, we notice high level of buffering issue with our customer.

It seems that the createUris callback was holding onto a parsing context in each reference.

Closes #3038
2020-12-10 15:53:47 -08:00
Jacob Trimble c403dec535 fix(dash): Don't limit segment count for VOD.
Fixes #2677
Issue #2709
Issue #2745

Change-Id: I06e74889d5e397639a4aea46ae6fedbfa5ee1a90
2020-08-05 17:00:56 +00:00
Jacob Trimble dc8b007d56 cleanup: Add missing requires.
This is a port of the internal changes: cr/321495405, cr/321592702,
and cr/321594488.

Change-Id: If6a4c4266ed10a70b01442974dbd19329bb5122e
2020-07-16 10:59:49 -07:00
Joey Parrish 486123ce41 fix(DASH): Fix bad segment URLs in SegmentTimeline
When Representations have different BaseURLs, segment URLs generated
for SegmentTimeline were always using the BaseURL of the last
Representation because the wrong parsing context was being used.  This
fixes the issue and adds a regression test.

This only affected v3.0.0.

Closes #2650

Change-Id: I04df950b5d3205e102f9c74f52ece9773ce92282
2020-06-15 22:40:48 +00:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish 342d35f4f9 Fix issues with nullability of numbers
Various issues with the nullability of number types led to various
fixes, including:
 - defaulting a nullable number to 0 to avoid propagating a null value
   through calculations
 - adding an assertion or runtime check that something is not null
 - moving an existing null check to before the calculation
 - returning early on null during an iteration
 - changing a nullable number to non-nullable
 - defaulting to NaN instead of null

These issues were caught by a compiler upgrade.

Issue #2528

Change-Id: I86d516c74a42ee3624c33d7513d2d4c76d3ea589
2020-04-30 16:00:00 +00:00
Joey Parrish e24fec4b08 Flatten periods
This creates a new utility used by DashParser and old offline DB
formats to combine Streams across Periods.  This allows multi-Period
DASH content to be played without period-specific structures in the
manifest format, StreamingEngine, or Player.  This also makes the
Tracks stable across Periods.

Closes #1339 (flatten periods)
Closes #1698 (rapid period transitions issue)
Closes #856 (audio change causes bitrate change)

Change-Id: Icb04c8e47e36eacf7ac024a5063130d85a115e54
2020-04-09 19:22:16 +00:00
Joey Parrish 1ab3f9c6db Remove position from SegmentReference
As part of Period-flattening, I'm trying to remove our dependence on
the "position" field of SegmentReference.  With that eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.

 - Make SegmentIndex iterable
 - Add specialized seek() and current() methods to SegmentIterator
 - Remove position from SegmentReference
 - Make positions in SegmentIndex API stable without field in
   reference
 - Remove brittle hard-coded positions in tests (except SegmentIndex
   tests, where they would be hard to avoid in testing methods
   separately)
 - Use SegmentIterator in StreamingEngine to track the next segment
   between switches

Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)

Change-Id: I666cc21249c34ee6cbc138a59109d9f1159fa127
2020-03-23 10:09:35 -07:00