This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs. This does not
affect the compiled output, and is only done for consistency.
Issue #2638
Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
The timestamp parser in our HLS parser should not fail on null TS
packets. These are indicates by a packet ID of 8191 (0x1fff), and
according to the spec, should be skipped by any receiver.
We will not skip such packets and continue through the segment to find
a PES packet with a timestamp.
In addition to the comments in #2546, I found this document helpful:
https://www.mikrocontroller.net/attachment/27265/mpeg2ts.pdfCloses#2546
Change-Id: Id9dc16160bbde03969199150ca50122f12de77f4
In many places in the tests, we used "Object" or "*" or just no type
at all for various fakes. These were all flagged by the new Closure
Compiler version we are adopting.
In some other places, we mixed up similar types or had the wrong
nullability on a type.
In still others, types were missing fields.
These issues were caught by a compiler upgrade.
Issue #2528
Change-Id: I324e0b28f7e30a4102aa26ec2c9901fa9732211b
The usage of SegmentIndex in tests was correct, but the latest Closure
Compiler is more strict about nullability. We need to add assertions
and refactor to avoid nullable numbers where a non-nullable number is
required. We also need to add assertions for the nullability of
Stream.segmentIndex after createSegmentIndex() is called.
This was caught by a compiler upgrade.
Issue #2528
Change-Id: I5615ffa27b878f86739d507f993c2b66ae8eb61a
Period-flattening will concatenate Stream objects, so this information
should be available per-Stream instead of at the Variant level.
Issue #1339
Change-Id: I96195fea48cab1e4a349b2ab0b16064a443e928a
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
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
This reverts commit 235e4e11ad.
The effort to remove SegmentReference's position field will be handled
in a different way.
Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)
Change-Id: I62b115137abc89f498b30467e574b0401dcad05d
As part of Period-flattening, I'm trying to reduce our dependence on
the "position" field of SegmentReference. If it can be eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.
SegmentIndex can now track the last reference you asked for and
iterate through the list of references. This means we don't need the
"position" field of SegmentReference, which means we don't need to
know positions in advance or globally. StreamingEngine will no longer
use position to request segments.
The old methods find(time):position and get(position):SegmentReference
have been replaced with seek(time), current(), and next(), all of
which return a SegmentReference and maintain an internal pointer to
the "current" reference. Care has been taken to maintain that pointer
during the evict() and fit() operations. Recent changes to merge()
made sure that the pointer does not need to change during that
operation.
All test updates are related to the SegmentIndex API change, not
changing expectations or behavior.
Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)
Change-Id: I1682dcc2dd625c6e390711538e46d31e6eb6cea8
One playlist may contain multiple EXT-X-MAP tags, and each EXT-X-MAP tag
represents the initalization information for the segments after it,
until the next EXT-X-MAP tag or the end of the playlist.
Issue #1335Closes#2397
Change-Id: Ibb0b4f5da6a48f0303d205cb6bd3abad278527fd
Raw, containerless streams can't be played yet (#2337), but our logic
for skipping or rejecting them was broken. This broken logic affected
the whole v2.5.x series of releases up to and including v2.5.8.
This fixes the logic and improves it in several ways:
- Skip streams that can't be played, instead of rejecting the whole
master playlist
- Handle raw AC3 and EC3, in addition to MP3 and AAC
- Handle and skip WebM+HLS in the same way
- Add the playlist and segment URLs to
HLS_COULD_NOT_PARSE_SEGMENT_START_TIME errors
This allows us to re-enable the Apple HLS+TS asset as video-only.
Change-Id: Ia00857d87b085aa7e2b810b0b949993cebabe4ba
This changes the eslint rule to enforce a strict pattern for the
argument comments. The comment must appear before the argument and
must be /* foo= */. This still ignores line comments.
Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
SegmentReference used to have presentationTimeOffset, which,
subtracted from the period start time, was then _added_ to the
timestamps in the segment by MediaSource.
Now, SegmentReference has a timestampOffset field, which is exactly
what MediaSource's timestampOffset field is set to on the SourceBuffer
before this segment is appended. For DASH, this is periodStart minus
presentationTimeOffset.
This also adds append window start & end times to the
SegmentReference. Now segments can be appended to SourceBuffers
without reference to the period.
Note that start & end times of the SegmentReference in each segment
index are still relative to the period. This will change in a
follow-up.
Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)
Change-Id: I9d54eb2b529ec643c9475b8e9d218c3e2e826a26
There were fields in SegmentReference which were not being examined
when instances are compared by jasmine. Now, the comparison is more
general and will continue to work when we change the structure.
This relates to the issues below because the next changes for those
issues will change the fields in SegmentReference.
Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)
Change-Id: Ib7cd3d3cadeb0e58efd70964c082219b1c097fad
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
For VOD, the first segment of every Media Playlist in every Variant
Stream must start at the same media timestamp. Thus, we can get the
start time once and store the value, and all the streams can use the
value directly. For live, we assume for the same.
This change reduces calling getStartTime_() from 15 times to once for
Angel One, and also fixes the text segment timestamp issue.
Also removed associated methods that no longer needed.
Closes#1558Closes#1563
Change-Id: I0e95ab93ea2b13758128f11019b262bc53dbcd38
This allows us to avoid suppressing the indentation rules and ensures
we have correct indentation. It also makes it harder to make mistakes
since the variables are only accessible within the callback and you
can't accidentally contaminate another object with an incorrect call.
Closes#1692
Change-Id: Ic38b5cd57a2587dfc8c115ba782656c15565b655
This adds a separate configuration value for this because (a) the HLS
parser can't access the streaming configuration and (b) this behavior
is different in that the streams are removed instead of just not playing
them.
Closes#2065
Change-Id: Ic9b1e0d40b161cd4ba0eb6d7c922882112034626
Our previous approach:
For every variant tag, find the associated media tags(with the same
group id), create stream info for each media tag, and then create stream
info for variant tag based on that, and create variants.
This approach has duplicate calls for the media tags with the same group
id to create stream infos.
New approach:
1. Get codecs from variant tags
2. Create stream info from each media tag (with the codecs from variant
tags)
3. Create stream info for each variant tag, and then create variants.
This creates stream info for each media tag once, and avoids duplicate
calls to guess the codecs.
Issue #1558Closes#2066
Change-Id: Icdf3133b1b15d1baf60624ff449e0a61fdb78d8a
To prepare for flattening out the manifest structure to remove
periods, this change moves initSegmentReference and
presentationTimeOffset fields into the SegmentReference object. This
way, the segments on either side of a period transition or HLS
discontinuity can have different offsets or init segments, eventually
allowing us to create a single array of SegmentReferences for
multi-period content.
Issue #1339
Change-Id: Ic7eff0483789644881247ecf8044c5fb6a48f0e6
1. Make createPeriod_() and createVariantsForTag_() clearer to read.
2. Simplify and remove duplicate code.
Change-Id: Idda7cb40f33905afd9512d427d7e78cb6c96ede9
This replaces find/get callbacks in Stream with a SegmentIndex. With
the exception of DASH's SegmentTemplate+duration, all manifests were
already backed by SegmentIndex. Now, all manifests are backed by
SegmentIndex. This will simplify Period-flattening, in which all
tracks will be represented by a list of segments, some of which come
from different Periods.
The SegmentIndex in Stream will not be created until
createSegmentIndex is called. Prior to this change, the find/get
callbacks could be invoked without createSegmentIndex() in some cases
(excluding DASH's SegmentBase), which some lazy tests took advantage
of. Now that find/get are methods on SegmentIndex, createSegmentIndex
must be called in all cases. The tests have been updated accordingly.
Making SegmentIndex generation async in all cases exposed some issues
with the parser context being modified in-place between one
Representation and the next. So the parser now makes a shallow copy
of the context before it is bound into an async callback.
To facilitate updating the SegmentIndex for SegmentTemplate+duration
content, SegmentIndex now has a method to update its list on a timer.
Once per segment duration, the index will be updated to add and remove
SegmentReferences.
The initial expansion of SegmentTemplate+duration will be limited to a
relatively small number of segments, to avoid excessive CPU or memory
consumption. This defaults to 1000 segments, but is configurable.
Issue #1339
Change-Id: I99c007b1096c3b396d04a729750cd7b743cb899d
This ensures that we get the expected types and that type coercion
doesn't convert between types. This also ensures we are consistent
in how we check for equality of primitives in tests.
Change-Id: I9f3aacdf25ab1afe5e8d6e4b895b5299ee687d54
This is a fully automated change. The linter will fail because the
extra indentation caused line-length errors. These won't be fixed
automatically. They are fixed in a follow-up to make this one fully
automated.
Change-Id: I4d8cf9c998985add2bcd24a81c8d65495668c4f3
We use custom indentation for the ManifestGenerator to make the repeated
calls easier to read. This disables the coming linter rule for these
blocks of code. This also goes through and unifies the formatting. The
indentation should be 4 spaces from the left side.
Change-Id: I687e69cea39bded1e9e06bffdcc888970b383fa2
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
The wrong loop index was used, which caused us to create bogus and
non-unique keys for a map, which in turn caused us to skip certain
variants that should have been created.
Fixes#1908
Change-Id: I6475acad16cd76acb81cd562ef033724c7c4ebaf
In HLS, the CODECS attribute may contain duplicate of the same codec
with different profiles.
Closes#1817
Change-Id: I0d59c1ade6c8387a2e6b3ca00c0287e15c943ea3
Currently we check encrypt key tags after we parse the segment, so
playing an AES-128 encrypted content results in error message
'MANIFEST.HLS_COULD_NOT_PARSE_SEGMENT_START_TIME'. We should check the
encrypt key before, and give a more clear error message.
Filtering out the contents encrypted with AES-128, and if there's no
valid content left, we'll show 'CONTENT_UNSUPPORTED_BY_BROWSER'.
Closes#1838
Change-Id: I893f57a939e45f2787144dfe311b779aed26ac34
If we try to stop the HLS parser while it is parsing a manifest (either
via |start| or |update|) it can misinterpret the aborted partial segment
request as the server not supporting the range request.
This change creates a test that show that we can't interrupt the HLS
parser while it is parsing the manifest (even through we expect to).
The test added in this CL is expected to fail, showing the problem, and
will be fixed in a following CL, showing the fix works.
Issue #1788
Change-Id: I91c459eb5fe0d84af8fe5987a459a054d3aa1107
Instead of duplicating the default configuration values in each test,
this now uses the default configuration methods.
Change-Id: Ifd2ab349db7903a2acb0d06fed4bd0ccd5050b35
Refactor the closed captions support for HLS, using the same approach as
the closed captions support for Dash.
If closed captions are signaled in the manifest, player will create a
text stream for to represent the closed captions, and text engine will
store and append them. We don't need to set 'useEmbeddedText' value for
closed captions any longer.
Issue #1404
Change-Id: I9a5bf4df7e29d6e6982f29fd5e2df07bc78071d7
This fixes issues with the interpretation of URIs in HLS and makes
their usage and meaning consistent and clear.
- Name URI variables as either absolute, final (post-redirect), or
verbatim (exactly as they appear in the playlist)
- Identify media playlists by their verbatim URI when testing for
equality or duplication
- When a master playlist is redirected, interpret media playlists as
relative to the redirected location
- When a media playlist is redirected, request updates from the
redirected location
- When updating a media playlist, resolve media segment URIs as
relative to the latest redirected media playlist URI
- Resolve absolute segment URIs when parsing the playlist text,
rather than waiting until we intepret and build the manifest
- Remove some incidental bind() calls, which exposed compiler errors
- Avoid refactoring long parameter lists
- Avoid refactoring for async/await
- Clean up redirection tests, which were brittle and did not verify
what they seemed to
- Use relative segment URIs for all segments in tests
- Use media playlist URIs within master playlists in tests
- Add a regression test specifically for #1664Closes#1664
Change-Id: I45f946790c7d669637c231ae93920a09c18c4222