Commit Graph

295 Commits

Author SHA1 Message Date
Iragne a3320707b9 fix(DASH): Update dash manifest when minimumUpdatePeriod = 0 (#6187)
Fixes https://github.com/shaka-project/shaka-player/issues/6185
2024-01-30 15:57:02 +01: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
Wojciech Tyczyński 5e3db78a5e feat(DASH): Allow PeriodCombiner for using streams once (#6097)
In our streams we have guarantee that every track will have a single
match in every period. This change allows `PeriodCombiner` to take
benefit of this knowledge.

I was testing `PeriodCombiner.combinePeriods()` performance of mentioned
changes on Tizen 2021 on 2 streams and I've got following results:

| content | upstream | proposed changes |
| - | -: | -: |
| stream 1 | 17 ms | 12 ms |
| stream 2 | 191 ms | 98 ms |

Both streams are VOD.
Stream 1 has 18 periods with 6 video & audio tracks in each.
Stream 2 has 18 periods with 6 video tracks & 36 audio tracks in each.
2024-01-15 08:11:46 +01:00
Wojciech Tyczyński 4022788a18 perf: PeriodCombiner improvements (#6005)
Summary of changes:
- create dummy streams during preparing arrays of input streams
- use hash map to quickly find perfect stream matches across periods
- hash map also automatically removes duplicates, so remove previous
logic for finding them
- check earlier are we trying to create output stream from dummy stream
- 2 changes from above also gives us a possibility to simplify
`areCompatible()` & `isBetterMatch()` methods
- reduce creation of spare collections when concatenating streams
- reduce conditional logic when possible

I was testing `PeriodCombiner.combinePeriods()` performance of mentioned
changes on Tizen 2021 on 2 streams and I've got following results:

| content | upstream | proposed changes |
| - | -: | -: |
| stream 1 | 23 ms | 17 ms |
| stream 2 | 484 ms | 191 ms |

Both streams are VOD.
Stream 1 has 18 periods with 6 video & audio tracks in each.
Stream 2 has 18 periods with 6 video tracks & 36 audio tracks in each.
2024-01-09 11:21:01 +01:00
theodab bb64cb1f0c fix(DASH): Check if periodCombiner_ exists before configuring (#5998) 2023-12-06 23:44:05 -08: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
theodab 24e32559bf feat(DASH): Handle mixed-codec variants. (#5950)
With the addition of the changeType API for MediaSource, it is theoretically possible for a variant to change between multiple codecs for a given buffer, over the course of playback.
This adds support for the DASH player to stitch together periods which have such multi-codec variants, but only as a last resort. For example, if one period only has audio in aac, and another period only has opus audio, the player will now stitch those periods together as one, but if there is a throughline that does not involve changing codecs it will go for that instead.

Closes #5961
2023-12-01 00:37:32 -08:00
Álvaro Velad Galván ba85ece3ac fix(DASH): Fix bad url when specify using a full WebVTT with BaseURL (#5954) 2023-11-29 17:33:32 +01:00
Álvaro Velad Galván 8f453c245f feat(DASH): Add support for location in Content Steering (#5914)
According to
https://github.com/Dash-Industry-Forum/Dash-Industry-Forum.github.io/files/11722876/DASH-IF-CTS-001-1.0.0.pdf,
Location elements can have serviceLocation, so we need support it.
2023-11-22 23:02:01 +01:00
Álvaro Velad Galván 0f5982ba8e chore(DASH): Simplify content steering management in DASH (#5909) 2023-11-21 07:14:16 +01:00
Álvaro Velad Galván 3a68623946 fix(DASH): Fix false redirect detection (#5910)
Fixes https://github.com/shaka-project/shaka-player/issues/2216
2023-11-21 05:28:56 +01:00
Álvaro Velad Galván 1c6f1fa7b3 feat(DASH): Add support for Content Steering in AdaptationSet BaseURL (#5884)
Related to https://github.com/shaka-project/shaka-player/issues/5704
2023-11-15 08:59:47 +01:00
Álvaro Velad Galván 42f491f782 feat(DASH): Add support for Content Steering (#5710)
Related to https://github.com/shaka-project/shaka-player/issues/5704
2023-11-09 08:34:09 +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
Álvaro Velad Galván 5f94a6253b feat(DASH): Add support for minimum values in service descriptions (#5844)
Closes https://github.com/shaka-project/shaka-player/issues/5780
2023-11-02 17:53:39 +01:00
theodab 4425dca283 chore: Remove state engine (#5752)
The state engine mechanism, designed for the player class, was
over-engineered. The structure of the class makes debugging player
errors unnecessarily annoying, by obfuscating the code-path the error
followed, and in general
has created a significant amount of technical debt.
This changes the player to use an async-await setup for the top-level
operations, laying things out much more cleanly
and linearly.

---------

Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>
2023-10-30 23:59:08 -07:00
Álvaro Velad Galván f8438df7b0 fix(DASH): Handle minimumUpdatePeriod=0 with urn:mpeg:dash:event:2012 (EMSG) (#5823) 2023-10-28 08:52:20 +02:00
Álvaro Velad Galván 81fc82b6b2 feat(HLS): Add support for REQ-VIDEO-LAYOUT (#5809)
Also add preferredVideoLayout config
2023-10-26 09:25:45 +02:00
Ivan 17a4363e33 perf(dash): improve readability and reduce number of loops in dash parser (#5768)
This change reduces the amount of loops in dash parser, and improves
code readability, as checking config and creating an array of sets is in
a separate method now.

---------

Co-authored-by: Ivan Kohut <ivan.kohut@lamin.ar>
2023-10-20 01:15:04 -07:00
Álvaro Velad Galván 65449d1a1c fix(DASH): Fix manifest update time for Live manifests (#5763) 2023-10-12 10:41:49 +02:00
Álvaro Velad Galván 8b7141f923 fix(DASH): Fix manifest update time for LL-DASH (#5736) 2023-10-11 11:34:15 +02: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 0a8b5193f2 fix: Fix creation of new Stream object for each manifest request in DASH Live when using CEA (#5674)
Fixes https://github.com/shaka-project/shaka-player/issues/5672
2023-09-25 11:58:23 +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 0bbb47025e feat(DASH): Add new config to prevent mixing of audio representations from different adaptation sets (#5620)
Closes https://github.com/shaka-project/shaka-player/issues/5461
2023-09-13 22:38:00 +02:00
Álvaro Velad Galván bc994012e8 chore(DASH): Create makeNetworkRequest_ method (#5655)
This change is required in preparation for
https://github.com/shaka-project/shaka-player/issues/5622
2023-09-13 19:29:00 +02:00
Álvaro Velad Galván b16d2f0bf3 feat: Add manifestupdated event (#5602) 2023-09-05 08:15:18 -07:00
Álvaro Velad Galván de19884dd1 fix(HLS): Fix external subtitles out of sync in HLS (#5491)
Fixes https://github.com/shaka-project/shaka-player/issues/5458
Fixes https://github.com/shaka-project/shaka-player/issues/5443
2023-08-21 09:00:07 -07:00
baconz 845649b001 fix: Typing of PeriodCombiner.Period was incorrect (#5442)
When we exported `PeriodCombiner` in
https://github.com/shaka-project/shaka-player/pull/5324 we added an
`@export` to `PeriodCombiner.Period`, and since then we've been testing
in our dogfood builds using shaka-player.compiled.debug, because we like
to get logs from dogfood. Everything was working great.

When we went to switch over to the production build, we realized that
`@export` on a `typedef` doesn't really work because the type gets
minified internally!!

This moves `Period` over to `extern` so that it does not get minified
and can be used externally.
2023-08-15 17:36:06 +02:00
Wojciech Tyczyński f53349fc93 feat: Add originalLanguage to the Track structure (#5409)
Shaka in most of places normalizes tracks' language code to be compliant with ISO 639-1 when possible. However, it does not do that all the time (i.e. normalization is missing in MSS parser) and there is no way to get value that has been explicitly set in a manifest. Moreover, documentation is misleading, as it claims that value is taken directly from a manifest.
Normalization should take place, specifically to easify PeriodCombiner algorithm and also to not break existing applications.
However, original value can be desired for some implementations.
This PR introduces new field to get original language value from the manifest.
2023-07-18 02:09:17 -07:00
Adrián Gómez Llorente 693abd5081 feat(DASH): Add support for service descriptions (#5394) 2023-07-05 14:43:15 +02:00
Davide Zordan 226ffa9df6 fix: Fix DASH rejection of streams with ColourPrimaries and MatrixCoefficients (#5345)
Add ColourPrimaries and MatrixCoefficients schemes as specified by
https://dashif.org/docs/DASH-IF-IOP-v4.3.pdf.

In particular, `ColourPrimaries` and `MatrixCoefficients` schemes were
considered "unrecognizedEssentialProperty", causing some
streams with valid manifests to discard the video track.
2023-06-26 12:07:37 -07:00
Álvaro Velad Galván f4bcc874d8 feat(DASH): Achieve better latency in LL streams (#5291) 2023-06-13 20:23:33 +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
Álvaro Velad Galván 1515b7abf6 feat(DASH): Remove MIN_UPDATE_PERIOD_ to achieve better latency in Live (#5286)
Many LL streams use 2 seconds segments, so we have to ensure that these
streams work correctly.
2023-06-12 16:19:58 -07:00
Álvaro Velad Galván fea46d88cd fix(DASH): Ignore minBufferTime when using LL (#5285) 2023-06-12 18:11:56 +02:00
theodab 654a0281d9 feat(DASH): Expose accessibility purpose in track (#5216)
Closes #5211
2023-05-08 17:13:06 -07:00
Dave Nicholas 3ff7ba370f feat: Raise fatal error on linear manifest request update failure (#5138)
We (Sky/Peacock) required the ability to try a different ad stitched
manifest upon a manifest request update failure.

After the initial retry parameters (timeouts and retries) have been
exhausted, error immediately and not continue to retry with the same
manifest.
2023-04-26 14:09:38 -07:00
Wojciech Tyczyński 3b0f01377f fix(DASH): Fix seeking on multiperiod content after variant change (#5110)
Fixes an issue where `createSegmentIndex()` creates a reference in
cached Stream and not on a new Stream. Now cached value is reused in
period flattening.

Updated assertion in Period Combiner to catch potential issues within
old approach.

Without this fix I've noticed problems around seeking on multiperiod
content after variant change.
2023-04-19 10:03:07 -07:00
Ashwin Bhat 4d487e46e1 feat(HLS): Add HLS config to ignore manifest timestamps when in segments mode (#5103) 2023-03-23 14:57:18 +01:00
Casey Occhialini fe38e45f4d fix: Adds missing CMCD params to some http requests (#5072)
Fixes #5067
Fixes #5094

Co-authored-by: Dan Sparacio <daniel.sparacio@cbsinteractive.com>
2023-03-15 02:13:16 -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 2b50b88030 feat(HLS): Add HLS support for non-sequence mode (#4623) 2023-01-30 21:22:30 +01:00
Álvaro Velad Galván aff2a5d9e8 feat: Add config for sequenceMode in DASH (#4607)
Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-10-26 19:34:59 +02:00
Joey Parrish c2b3853a56 fix: Fix segment index assertions with DAI (#4348)
When DAI adds ad segments faster than real-time, the availability
windows gets messed up, and some assertions in SegmentIndex break.
This locks down the presentation start time after the initial manifest
is parsed, so that the availability window is stable throughout
playback.

b/233075535
2022-07-14 16:34:23 -07:00
Gaetan Hervouet b757a81902 fix: Fix PERIOD_FLATTENING_FAILED error when periods have different base sample types (#4206)
Closes #4202
2022-05-17 09:46:43 -07:00
Álvaro Velad Galván d51fe23b7f fix(dash): Fix playback of Dolby Atmos (#4173)
According to https://developerkb.dolby.com/support/solutions/articles/16000067758-what-is-dolby-digital-plus-joc-joint-object-coding- Dolby Atmos (JOC):

> Joint Object Coding describes the process by which Dolby Digital Plus with Atmos decoders, receiving a legacy 5.1 mix and sideband metadata, are able to reconstruct the original Atmos mix.

So there is no need to deal with a separate mimetype, it can be decoded with Dolby Digital+ (better for retrocompatibility).

Closes #4171
2022-04-29 14:46:36 -07: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
Joey Parrish 1507b1e844 chore: Update URLs after moving projects (#4008) 2022-03-03 14:34:40 -08:00
Joey Parrish b7f04cb36b fix: Fix memory leak in DASH live streams with inband EventStream (#3957)
EventStreams in DASH generate TimelineRegionInfo objects, which are
then stored in the RegionTimeline and RegionObserver classes.  But
DashParser would add all regions to RegionTimeline, even if they would
be quickly removed again, and RegionObserver would cache some regions
from the timeline without ever removing them.

This fixes the issue from both of those directions.  DashParser will
now ignore regions that are outside the DVR window (and therefore
would soon be removed from RegionTimeline), and RegionObserver listens
to an event on RegionTimeline to clean up its own storage when regions
fall outside the DVR window during playback.

Closes #3949 (memory leak in DASH live streams with inband EventStream)
2022-02-16 14:02:54 -08:00