Commit Graph

12 Commits

Author SHA1 Message Date
Joey Parrish 810f09ff1e fix(DASH): fix failure with identical text streams
The period-flattening algorithm is run even on single-period content
if the manifest is dynamic, because we don't know if another period
will be added later.

As a failsafe, we should create one output per input for single-period
content, and we can ensure that no streams are unused by marking an
input stream as the "best match" for an output if they share the same
ID.  That way, even if all other characteristics for two inputs are
the same, the input-to-output mapping for single-period content will
always be sane.

That ID-based logic was missing for text streams.  This change
corrects that.

Closes #2646

Change-Id: I28c6c63d92bcf710ae0072783911f9e66ed78228
2020-06-17 16:12:00 +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 aba5e2583c Rename v2.6 to v3.0 and v2.7 to v3.1
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.

Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
2020-05-29 17:50:22 +00:00
Sandra Lokshina 285cc73b1d Fix period flattening matching by role.
Matches for all streams. Пусть никто не уйдет обиженным!

Closes #2542.

Change-Id: I5cfa25c426c40125ab6532ad62ef08dbe2dc9f81
2020-05-07 19:40:27 +00:00
Sandra Lokshina 9f43011e0b Prefer original source stream when matching for period flattening.
When we construct final streams in period flattening, we start them
off original streams and then combine streams from each period that
best matches the characteristics of the original stream.
The original stream also participates in the matching process, but
it was possible for it not to get selected as the best match if
there were other streams with similar characteristics.
This change adds logic to always prefer the original stream if
it's encountered.

Also, this change adds a bandwidth comparison for audio
streams to ensure the closest streams get matched bandwidth-wise.

Issue #2537.

Change-Id: I5d99a452a12ea1c4bb70fa8aba4bec479ff9d27b
2020-05-05 21:19:20 +00:00
Joey Parrish 11f3347a48 Fix static method aliases
We used to alias static utility methods by assigning the method itself
to a local variable.  This is not allowed by the new Closure Compiler
release that we are adopting, and for good reason.

The old compiler did not understand the use of "this" in static
methods, but the new one does.  And it turns out that when we start
using "this" in static methods (see #2532), aliasing the method itself
can break everything.

When you refer to "this" in a static method, it refers to the class.
This is really useful in utility classes that have private static
methods they use to perform common tasks.  However, just as it ruins
the value of "this" to alias an instance method, the same is true of
an ES6 class's static method.

The fix is to always alias the class instead of the method.  The new
compiler will simply not let us get away with the old way any more, so
regressions after this are unlikely.

Issue #2528 (compiler upgrade)
Issue #2532 (static "this")

Change-Id: Id800d466e639c7cbcf4aa6fbb05114c772a2229f
2020-04-30 19:28:53 +00:00
michellezhuo fb0d819f1c Verify period flattening with multiple representations of the same
resolution

Closes #2517

Change-Id: I7102153f2df83b8ad66411e709fdaf5a5a043b53
2020-04-27 18:41:04 +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 99de217c23 Remove periods from manifest structure
This removes periods from the internal manifest structure and cleans
up code and tests accordingly.  This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.

Three test cases have been disabled for the moment.

Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.

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

Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
2020-04-09 19:22:16 +00:00
Joey Parrish 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Aaron Vaage 8bacf168db Create common "find period for time" method
We need to find the current period for a given time in two places:
streaming engine and period observer.

This change takes the method used by streaming engine and the method
used by period observer and merges them into a common method in
|shaka.util.Periods|.

Change-Id: I4f681ceaef38bf2118fb4b87fe4961fddd196707
2019-02-27 00:20:40 +00:00
Aaron Vaage 71e8c4936d Refactor getAllVariants
Refactored |StreamUtils.getAllVariants| to get variants from a collection
of periods (rather than a manifest). This allows us to avoid needing to
assert that the manifest exists (when we know it will).

Looking long-term, as part of the refactor the method was moved to a
period-focused utility class. The goal of this is to make it easier to
see what methods may go away when we flatten periods.

Change-Id: I50aa97583892361ee4714a7beaf61e4cd95fb6b4
2019-02-26 17:22:15 +00:00