Commit Graph

44 Commits

Author SHA1 Message Date
absidue de30b7003a perf(transmuxer): Avoid repeatedly creating empty Uint8Arrays (#10100)
In `H264.getVideoSamples()` `lastVideoSample.data` is initialized with
an empty `Uint8Array` which is always replaced before the sample is
pushed into the `videoSamples` array, so to avoid creating a new empty
placeholder `Uint8Array` for each sample, the empty `Uint8Array` can be
created once and then use to initialize all `lastVideoSample` objects in
that segment.

`TSParser.parsePES_` had a similar placeholder empty `Uint8Array` issue,
which I was able to resolve by creating the PES object in the return
statement instead of upfront, that way it can be initialized with the
final data, avoiding the placeholder.

While yes empty Uint8Arrays definitely need less memory than larger
ones, it is still better to not create 100+ unnecessary objects in rapid
succession which then need to be cleaned up by the garbage collector
later on.
2026-05-18 09:49:44 +02:00
absidue 12308b5a73 chore: Tidy up array pop() with subsequent re-push() (#10099) 2026-05-18 09:14:52 +02:00
Ivan 2c8cfd20f3 perf(TS): Eliminate per-PES wrapper array allocations in parse loop (#9883)
This PR reduces GC pressure during MPEG-TS segment parsing - it replaces
nested PES packet arrays with a flat array plus a PES-start index,
eliminating per-PES inner array allocations and avoiding spread-operator
overhead when concatenating packets - reduces allocations, hence reduces
GC pressure on low-end devices during long livestreams
2026-03-26 10:03:32 +01:00
Álvaro Velad Galván ac010c4159 perf: Improve performance of TsParser (#9783) 2026-03-04 12:47:11 +01:00
Álvaro Velad Galván 6fc70622eb chore: Change frameRate from string to number in shaka.media.SegmentUtils.BasicInfo (#9627)
Related to https://github.com/shaka-project/shaka-player/pull/9626
2026-01-29 17:13:20 +01:00
Álvaro Velad Galván 945c57ab77 feat!: Remove all deprecated things (#9162) 2025-10-07 10:52:13 +02:00
Álvaro Velad Galván 75dc75eb64 fix: Always detect framerate as positive (#9133) 2025-09-25 11:07:56 +02:00
Wojciech Tyczyński f1768a5f84 chore: Remove JSDoc for empty constructors (#8955)
We don't need this anymore with `exemptEmptyConstructors` config added
in #8901
2025-08-05 13:06:00 +02:00
Joey Parrish 7c1e31d4e6 chore: Add trailing commas to all record types (#8820)
Now that jsdoc supports this, it will make future diffs cleaner. See
#8819 and #1236.
2025-06-30 13:36:04 -07:00
Álvaro Velad Galván f5c0fb24cd fix(HLS): Reset PTS/DTS reference at discontinuities when using TS (#8794) 2025-06-24 13:18:37 +02:00
Álvaro Velad Galván c15e524705 fix: Don't sort TS samples (#8708)
Fixes https://github.com/shaka-project/shaka-player/issues/8707
2025-06-06 12:14:33 +02:00
Álvaro Velad Galván cc98d405af fix: Fix ts parser when using B-frames (#8696)
Fixes https://github.com/shaka-project/shaka-player/issues/8691
2025-06-05 13:48:29 +02:00
Wojciech Tyczyński 6e55a3b21b build: Forbid using dot in generic types (#7904)
Fixes #2643

Happy reviewing!
2025-01-20 09:39:51 +01:00
Álvaro Velad Galván 77c4251fdc fix(Transmuxer): Fix transmuxer with overflow data (video nalus and aac samples) between PES (#7813)
Fixes https://github.com/shaka-project/shaka-player/issues/7812
Fixes https://github.com/shaka-project/shaka-player/issues/7471
2025-01-02 08:55:36 +01:00
Wojciech Tyczyński 51765e9693 build: Change spellchecking tool and fix spelling mistakes (#7765)
Fixes #7693
2024-12-20 12:27:05 +01:00
Álvaro Velad Galván f4f9b05e63 feat: Parse TS frameRate (#6998) 2024-07-08 14:22:26 +02:00
Ivan a779d31efc perf(HLS): do not loop twice when processing nalus (#6954)
PES arrays can get pretty big so it would be prudent to avoid looping
over them more than needed

Co-authored-by: Ivan Kohut <ivan@kidoodle.tv>
2024-07-01 15:12:55 +02:00
Álvaro Velad Galván 3b5a71c5bf feat: Add Opus TS transmuxer (#6387) 2024-04-10 12:56:18 +02:00
Álvaro Velad Galván 535d386ec8 fix: Add LOAS-AAC detection in TS (#6390) 2024-04-02 22:16:53 +02:00
Álvaro Velad Galván bc23fffd8a fix: Add Opus and AV1 detection in TS (#6385)
This detection is necessary to be able to correctly detect whether a
media playlist of HLS that has TS segments is compatible or not.

Example:
https://raw.githubusercontent.com/obecny/hls-opus-testing/main/stream.m3u8
(media playlist with Opus)
2024-04-02 09:47:30 +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
Joey Parrish 6bd9f42cf2 chore: Fix deprecation messages (#6289)
Some deprecation messages were misleading, and claimed that entire
classes like AbrManager were deprected, when in fact, it was a
particular form of AbrManager (without a method) that is deprecated.

This adds method and other details to the deprecation calls where
needed.

We also had a malformed messsage where join('') was called on the pieces
instead of join(' '). This fixes the formatting.
2024-02-23 11:02:03 -08:00
Álvaro Velad Galván df8dbb9caa fix: Fix nalu parsing in TS (#6137)
Fixes https://github.com/shaka-project/shaka-player/issues/6136
2024-01-22 18:03:36 +01:00
wjywbs dd500285c2 perf: ts parser O(n^2) performance bug. (#6035)
This caused high cpu usage when the ts file segments are large.
2024-01-08 09:33:31 +01:00
Álvaro Velad Galván 165feacb00 fix: Fix transmuxer when some PES has the same pts and dts value (#5985)
Fixes https://github.com/shaka-project/shaka-player/issues/5913
2023-12-05 08:08:34 +01:00
Álvaro Velad Galván ae423b4239 fix: Fix nalu parsing and improve performance in the transmuxer (#5846)
Fixes https://github.com/shaka-project/shaka-player/issues/5666
Fixes https://github.com/shaka-project/shaka-player/issues/5797
2023-11-02 17:54:28 +01:00
Álvaro Velad Galván 756a576586 fix: Fix NALU parsing in some HLS muxed live streams (#5688)
Related to https://github.com/shaka-project/shaka-player/issues/5666
2023-09-27 18:18:56 +02:00
Álvaro Velad Galván d9b49d992f fix: Allow PID change in TsParser (#5681)
This is necessary because some Live streams change audio or video PID
when there are ads.
2023-09-26 20:41:42 +02:00
Álvaro Velad Galván e191c75516 feat(HLS): Get the correct video info for TS segments with H.265 (#5616) 2023-09-08 08:45:47 +02:00
Álvaro Velad Galván 5fa8b42118 fix: Improve TsParse to avoid parsing errors (#5615) 2023-09-07 18:19:25 +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 1135115069 fix(HLS): Get the correct video codec for TS segments (#5598) 2023-09-05 20:01:33 +02:00
Álvaro Velad Galván 5c6ab9e0c8 fix: Fix PES parsing (#5559)
This changes the way pes are processed to gain efficiency and avoid
parsing incorrect pes.
2023-09-01 11:19:32 +02:00
Álvaro Velad Galván eec25b2c6e feat: Add TS transmuxer (#5386)
- Allow to have multiple transmuxers, but choose only the one that is
valid depending on whether it supports the codecs or not
- Supported codecs: AAC, AC-3, EC-3, H.264, MPEG/MP3
- It is prepared to allow more codecs in the future (HEVC/H.265) (no
muxed)
2023-08-29 14:53:57 -07:00
Álvaro Velad Galván 9bd559b94a feat: Add support for AC-3 and EC-3 audio in DVB streams (#5484) 2023-08-17 16:15:36 -07:00
Álvaro Velad Galván 412a7e8f92 feat: Add missing export in TsParser (#5145) 2023-04-11 16:51:09 +02:00
Álvaro Velad Galván 24a3b7da1a feat: Add EC-3 detection in TS (#5144) 2023-04-11 16:24:23 +02:00
Álvaro Velad Galván 42a9f968d8 feat(HLS): Get resolution from TS when load a Media Playlist (#5058) 2023-03-15 12:13:34 +01:00
Álvaro Velad Galván 48c30bcd03 feat: Add AC-3 detection in TS (#4931) 2023-01-24 17:58:27 -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 0d67ecd7cb fix: DAI ID3 metadata parsing (#4616)
Co-authored-by: Joey Parrish <joeyparrish@users.noreply.github.com>
2022-10-28 14:20:44 -07:00
Álvaro Velad Galván 3b534fd405 fix: Fix ID3 parsing in TS segments (#4609) 2022-10-25 15:55:02 -07:00
Álvaro Velad Galván 5157b44b2d feat: TS parser improvements (#4612) 2022-10-25 15:07:01 -07:00
Álvaro Velad Galván 95bbf72f42 feat: Parse ID3 metadata (#4409)
Co-authored-by: Alvaro Velad <alvaro.velad@mirada.tv>
2022-10-11 09:29:53 -07:00