Commit Graph

37 Commits

Author SHA1 Message Date
Álvaro Velad Galván dd5658bc3b fix(CEA): Fix stream detection when the stream has not control codes (#6703)
Thanks @tykus160
2024-05-30 08:21:44 +02:00
Álvaro Velad Galván f69694a37f fix(CEA): Ignore XDS control codes (#6702)
Thanks @tykus160
2024-05-30 02:20:42 +02:00
Wojciech Tyczyński 024cb9b966 fix(CEA): reset PTS on new init segment (#6606)
Fixes #6605
Resets cache (including last used presentation timestamp) of CEA Decoder
on every init segment append.
Adds few debug logs to easify investigations in the future.
2024-05-14 11:19:26 +02:00
Álvaro Velad Galván e8f37f0d6c fix: Fix PES rollover in TS (#6363)
Related to https://github.com/shaka-project/shaka-player/issues/6320#issuecomment-1979835203
2024-03-29 13:33:58 -07:00
David HM Morgan 8cf9d59eac fix: Fix cea608 whitespace rendering (#6329)
Ensure whitespace rendered in CEA-608 test streams instead of `⠀` (braille pattern blank).
Updated UT too, but avoiding this char at ends of the string hence vulnerable to trim() 🤦 

Fixes #6328
2024-03-06 12:11:52 -08:00
Álvaro Velad Galván c100053532 feat: Add support for Dolby Vision based on AVC and AV1 (#6154) 2024-01-24 18:15:18 +01:00
Wojciech Tyczyński 44cb8a2ed8 fix: fix handling of multiple CC tracks (#6076)
Due to issue around channel calculation, shaka was never using CC4 track
and data from there were landing in CC2 track.
2024-01-10 16:17:10 +01:00
Álvaro Velad Galván 83f6f5379b fix(CEA): Fix positioning in CEA-608 (#5925)
See:
https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-608

Related to https://github.com/shaka-project/shaka-player/issues/2940
2023-11-27 09:48:06 +01:00
Gary Katsevman 2a524bf51f feat: expose CEA708 window position in the cue's region (#5924)
CEA708 captions have positioning data available in their windows.
However, this isn't currently translated and exposed by shaka though it
is parsed from the bitstream.

Translates the windows into WebVTT regions and uses the mappings
outlined
https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/608toVTT.html#positioning-in-cea-708

This is also partially implements #2583.
2023-11-23 17:19:46 +01:00
Nick Crast 9a694b59f8 fix: CEA decoder should return early if packet is not large enough (#5893)
Fixes #5891 

In production, we are seeing the occasional SEI packet [`0x5b`], which
is causing the parser to error. Using Mux.JS, this packet is ignored
because it's not long enough to be a valid captions packet, so for
feature parity it would make sense for the built in Shaka parser to also
ignore.
2023-11-15 18:20:39 +01:00
Álvaro Velad Galván 754bfacf07 feat(HLS): Build closed captions metadata for media playlist on-the-fly. (#5811)
Related to https://github.com/shaka-project/shaka-player/issues/1826
2023-10-26 09:03:59 +02:00
Álvaro Velad Galván 54eaf6371a feat(CEA): Parse CEA from TS with H.265 (#5610) 2023-09-07 08:36:13 +02:00
Álvaro Velad Galván 47224ff081 feat(CEA): Add support to vertical position in CEA-608 (#5531)
Related to https://github.com/shaka-project/shaka-player/issues/2940
2023-08-25 06:52:44 +02:00
Álvaro Velad Galván c6e8449468 feat: Parses a TFDT Box, with a loss of precision beyond 53 bits (#5501)
Related to https://github.com/shaka-project/shaka-player/issues/3784
2023-08-19 05:29:49 +02:00
Joey Parrish 8ff29175d8 fix: Fix exception on Tizen due to unsupported Array method (#5429)
Tizen 3 does not support Array.flat(). This fixes a runtime exception on
Tizen 3 by replacing flat() with concat() and the spread operator. This
also bans the use of flat().

flat() was originally introduced in PR #5422
2023-07-21 06:53:30 -07:00
Joey Parrish bccfdbcea4 fix: Fix captions from MP4s with multiple trun boxes (#5422)
Closes #5328
2023-07-20 09:10:38 -07:00
Aidan Ridley f0ee16bdb3 fix: CEA 608 captions not work with H.265 video streams (#5252)
Fix parsing of CEA 608 captions in H.265 video streams by handling 2
byte nal unit header.

Fixes #5251
2023-05-31 21:14:28 +02:00
Wojciech Tyczyński 7bda65dcc7 feat: Convert CEA parsers to plugins (#5195)
Fixes #5178 

Changes included:
- converted CEA parsers to externs
- added API to register/unregister CEA parsers
- TextEngine now checks is CEA decoder registered
- excluded CEA plugin from core build
- added lcevc plugin to core build

Bundle size results (all in KB, compared to
bf4b4a54cc):


  | core | complete - ui | complete - ui - cea
-- | -- | -- | --
before | 246 | 473 | 473
after | 231 | 474 | 459
2023-04-28 17:23:01 -07:00
Álvaro Velad Galván d6001097a9 fix(cea): Fix not rendering CEA-608 on encrypted mp4 segments (#4756)
Fixes https://github.com/shaka-project/shaka-player/issues/4605

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2022-12-01 22:34:34 +01:00
Álvaro Velad Galván e89eeb69fa fix(cea): Fix MAX_ROWS in CEA-708 window (#4757)
Fixes https://github.com/shaka-project/shaka-player/issues/3634
2022-11-28 11:34:37 -08:00
Álvaro Velad Galván 70fad8de8f feat(cea): Add CEA parser for TS (#4697)
Closes https://github.com/shaka-project/shaka-player/issues/3674

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2022-11-28 18:56:22 +01:00
Álvaro Velad Galván a489282ff2 fix(cea): Fix not rendering CEA-608 Closed Captions (#4683)
Also added H265 support and a framework for future TS CEA parser support.

Fixes #4605
Fixes #3659

Co-authored-by: Joey Parrish <joeyparrish@google.com>
2022-11-10 13:39:19 -08:00
Maria Maddox b3621c26a8 fix: check for negative rows before moving (#4510)
Closes #4508
2022-09-27 18:16:58 +02:00
Á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