Commit Graph

14 Commits

Author SHA1 Message Date
Álvaro Velad Galván 57c73241a0 fix(performance): Eliminate use of ES6 generators (#4092)
See: https://github.com/shaka-project/shaka-player/issues/4062#issuecomment-1077826210

Co-authored-by: @joeyparrish

Issue #4062
2022-04-04 10:58:16 -07:00
Álvaro Velad Galván 2687b95d58 fix(cea): make a more robust CEA MP4 parser (#3965)
Fix a HLS error reported in https://github.com/google/shaka-player/issues/2337#issuecomment-1040389975

Tested with https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8
2022-02-24 13:27:18 -08:00
Joey Parrish d99ab7959d build: Update eslint (#3977)
Also fixes linter errors found by the new versions
2022-02-18 08:26:43 -08:00
Joey Parrish c482e81ad9 build: Update Closure Compiler (#3976)
This updates the compiler and closure library to the latest releases.
This required a few small tweaks:

 - Drop custom extern for WebCrypto (now built into the compiler)
 - Remove require() in cea parser, only used in `throws` annotations
 - Hack around a typing issue in a fake version of TextTrack in tests
2022-02-17 18:55:49 -08:00
enson-choy 6a775e29a4 fix: Fix CC parsing of EPB and v1 TKHD boxes (#3610)
When unboxing TKHD, the reader read int64 as trackId instead of int32. Thus unable to find matching timescale when doing TFHD unboxing. Therefore when parsing MDAT, the default timescale will be used which is 90000. All CC timestamps will then be incorrect.

This also fixes "Shaka Error MEDIA.VIDEO_ERROR (3,,PIPELINE_ERROR_DECODE: Failed to parse H.264 stream)" error when playing DASH MP4 H.264 streams with CEA-608 CC embedded.  It's likely that the VDA bundled in Chromium-based browsers have already included EPB detection & prevention. If we let the player to remove the byte, VDA will complain about stream conformance.

Closes #3502
2021-09-09 09:44:45 -07:00
Joey Parrish 38ce45dce5 cleanup: Fix nullability declarations
Cleanup imported from an internal Google migration process, courtesy
of Laura Harker.

Change-Id: I11de518eafe6008938589e5250bdcaf8151267e9
2021-06-22 21:03:20 +00:00
Joey Parrish 4c7767f6be cleanup: Delete unnecessary nested goog.provides
Cleanup imported from an internal Google migration process, courtesy
of Laura Harker.

Change-Id: Ied2c24eeacfe4ff92f1b974c8e960949de5e4fb5
2021-06-22 21:03:20 +00:00
Joey Parrish 562a2d567b chore: Strictly require jsdoc
This enables the eslint rule requiring jsdocs on all class
declarations, function declarations, and methods.

Unfortunately, there are two problems with this:

1. We don't use class _declarations_, we use class _expressions_,
which are not covered by this rule.  So it does not enforce jsdoc at
the class level.
2. We tend to document a class at the class-level, rather than at the
constructor.  But a constructor counts as a method for eslint, so it
requires docs on the constructor.  There is no way to configure it to
make an exception for trivial constructors.

So for all trivial (no-argument) constructors, we add empty jsdocs:
  /** */
  constructor() {

This was quicker and easier than setting up some alternative plugin in
eslint to make an exception for us.

The good news is that this rule caught several undocumented parameters
and places where the jsdoc comment was malformed.  So fixing those
also improves the compiler's ability to enforce types.

Change-Id: Icbc46ed690c94e53d354648a883119524f8fca45
2021-01-09 02:00:31 +00:00
michellezhuo 65a6f265c7 feat(text): rename cue "spacer" to "lineBreak"
Change-Id: Ifca815b2f4d0c5f6e34edaa7b9fcb809d963f701
2020-11-16 07:53:16 +00:00
michellezhuo c17f427194 build: Add require and requireType
Add missing require and requireType for compiler upgrade.

Change-Id: Ie21418d93eb70c2213815638d6fd2d784cf6ef2e
2020-09-24 22:20:14 +00:00
Muhammad Haris 54ff2d8f28 feat(cea): CEA-708 Decoder (#2807)
This pertains to #2648 (although this is a new feature, not a replacement) and #1404. A CEA-708 decoder that follows the CEA-708-E standard, decodes closed caption data from User Data Registered by Rec. ITU-T T.35 SEI messages, and returns them as cues in Shaka's internal cue format. Furthermore, this pull request fixes and cements some of the logic surrounding CEA-608 and CEA-708 tag parsing on the Dash Manifest Parser.

Format:
Similar to the CEA-608 decoder, cues are emitted in Shaka's internal format (lib/text/cue.js). This decoder makes use of nested cues. The top level cue is always a blank cue with no text, and each nested cue inside it contains text, as well as a specific style, or linebreak cues to facilitate line breaks. This also allows for inline style (color, italics, underline) changes.

Details:
- ASCII (G0), Latin-1 (G1), and CEA-708 specific charsets (G2 and G3) all supported.
- Underlines, colors, and Italics supported, set as a property on each nested cue.
- Positioning of text is supported. (Exception: In CEA-708 the default positioning is left, in this decoder it is centered.)
- Positioning of windows not supported, but relevant fields that could be used to support this are extracted and left as a TODO.
2020-09-10 13:06:07 -07:00
Jacob Trimble 78150f4d29 fix(cea): Fix some CEA-608 special characters.
The quotes in the Spanish/French character set should be the curly
quotes, not the straight ASCII quotes.  Also, the last entries in the
Portuguese/German should be box-drawing characters; the dash and one
of the vertical bar characters should match these to form contiguous
boxes.

Change-Id: I85bb09553ab770778dcf2a3fba759fc68fdf12db
2020-08-12 17:24:40 +00:00
Muhammad Haris 1c00b4c1fb feat(text): CEA-608 Decoder (#2731)
This replaces mux.js for CEA608 decoding.  Applications will no longer need to include mux.js for CEA support, and mux.js will only be necessary for TS transmuxing.

Closes #2648
2020-08-07 09:07:26 -07:00
Muhammad Haris 480d4a801a Parse CEA-708 Packets from Fragmented MP4 streams. (#2660)
This is an MP4 Parser which extracts CEA-708 packets from Fragmented MP4 streams.

The Closed Caption Parser (shaka.media.ClosedCaptionParser) will own this MP4 Parser, and will initialize it and call it as shown. As data comes in, the parser will parse this data, and the caption packets data then be returned in a callback (on708Data), as shown. Here, a theoretical decoder (future pull request, mentioned as a Todo comment) will decode and extract the parsed captions from these packets.

Issue #2648
2020-07-05 16:29:17 -07:00