Commit graph

1,373 commits

Author SHA1 Message Date
wolfbeast
429b2125de Apply CheckedInt to infoLength for preventing it from overflowing in the future.
CheckedInt propagates the mIsValid in each add operation so that it avoids needing a bunch of code
for the overflow check in each add operation. Additionally, it avoids mismatching parameters
between the computing result and the additional overflow check.

This patch uses CheckedInt to take advantage of those implicit features of it.
2019-02-16 00:18:39 +08:00
wolfbeast
930cc1db3b Fix a longstanding IndexedDB correctness issue.
Standards Compliance fix, port of Bug 1492737
2019-02-16 00:18:35 +08:00
trav90
1269f82d33 Revert "Add support for AV1 in MP4"
This commit was incomplete. Will re-land AV1 in MP4 support properly at a future date.

This reverts commit 29f718ef78f1a25ca904c6438b59ffc8e365a750.
2019-02-16 00:17:57 +08:00
trav90
de6b3a930f Ensure we correctly parse the finalized codec string for av1 2019-02-16 00:17:56 +08:00
trav90
1b0277eca5 Add support for AV1 in MP4 2019-02-16 00:17:54 +08:00
trav90
8dd06e64c3 Use larger stack for media decoder threads
This increases the thread size for the platform decoder threads (to prevent stack overflows, particularly when decoding av1), while leaving the others at their default values.
2019-02-16 00:17:53 +08:00
trav90
ad02b504a6 Downsample av1 images unconditionally
Adding partial support for 10/12-bit video images seems to have broken the native pixel-stride support we were using to pass 8-bit AV1 frame data formatted in 16-bit pixel values, resulting in vertical green lines.

Revert to the earlier behavior of always downsampling to 8 bit data. This is slower, but at least displays correctly.
2019-02-16 00:17:51 +08:00
trav90
cbacc81f82 Fix canPlayType/isTypeSupported for AV1 content 2019-02-16 00:17:50 +08:00
trav90
6676331d30 Put AV1 codec behind a pref
Disabled by default.
2019-02-16 00:17:48 +08:00
trav90
b66027c8c0 Updates to AOMDecoder for aom v1.0.0
This reflects the API changes to the aom_codec_decode function and the removal of I440. It also sets allow_lowbitdepth to give proper support for 8 bit video, and removes the git version from the mime type.
2019-02-16 00:17:35 +08:00
trav90
48f6d2e034 Update aom to v1.0.0
Update aom to commit id d14c5bb4f336ef1842046089849dee4a301fbbf0.
2019-02-16 00:17:30 +08:00
trav90
992c6637e3 Update aom to commit id e87fb2378f01103d5d6e477a4ef6892dc714e614 2019-02-16 00:17:15 +08:00
trav90
ff19a9f251 [aom] Don't resample 8-bit images
The libaom av1 decoder will return 16 bit per channel aom_image_t structures with only 8 significant bits.

Detect this case and use the mSkip fields of PlanarYCbCrImage to handle the extra data instead of allocating and performing an extra copy to obtain the necessary 8 bit representation.
2019-02-16 00:17:11 +08:00
trav90
0b85248bea [aom] Resample high bit depth frames
The libaom av1 decoder can return high bit depth frame data now. Handle those frames by downsampling them to 8 bits per channel so they can be passed to our normal playback pipeline.
2019-02-16 00:17:10 +08:00
trav90
2ab8fcbfd1 Update aom to commit id f5bdeac22930ff4c6b219be49c843db35970b918 2019-02-16 00:17:05 +08:00
trav90
ecc55bc615 Add missing includes to FFmpegLibWrapper 2019-02-16 00:16:54 +08:00
trav90
d7a7fe75a0 Fix typo (build bustage) 2019-02-16 00:16:52 +08:00
trav90
76f1e6edca Update aom to slightly newer commit ID 2019-02-16 00:16:50 +08:00
trav90
1c8af26369 Add av1 to MediaSource.isTypeSupported
When av1 video playback is enabled, declare it as supported in the webm container in MediaSource.IsTypeSupported.

Also support special mime types of the form video/webm; codecs=vp9.experimental.<git-commit-id> so test sites can verify playback support of particular encodings while the av1 bitstream is under development.
2019-02-16 00:16:48 +08:00
trav90
dc0970c312 Remove aom_codec_stream_info_t sz field references
Upstream has removed the requirement to set this when initializing the stream_info struct.
2019-02-16 00:16:46 +08:00
trav90
b3aa26975c Make AOMDecoder actually build 2019-02-16 00:16:44 +08:00
trav90
c0086bdae8 Add missing includes to WebMDemuxer 2019-02-16 00:16:38 +08:00
trav90
76faa8e90f Recognize AV1 in WebMDemuxer
Call AOMDecoder to handle AV1 video tracks from the WebM container. The new decoder is very similar to VPXDecoder so we can use parallel calls. This codec is still build-time conditional.
2019-02-16 00:16:36 +08:00
trav90
349a05d4ad Add AOMDecoder to AgnosticDecoderModule 2019-02-16 00:16:35 +08:00
trav90
19743f8e4d Add AOMDecoder
Port the VPXDecoder interface to libaom which uses the same api with the names changed.
2019-02-16 00:16:33 +08:00
trav90
23c04adbe8 [webm] Don't reject seeks with EOS
The MediaDecoderStateMachine treat seek's EOS as fatal errors, so instead we always resolve the seek promise, and let the next GetSample return EOS.
2019-02-16 00:15:46 +08:00
trav90
64b9480493 [webm] Treat demuxing errors differently than EOS
Otherwise the WebM demuxer makes no difference between a genuine EOS and encountering an error.
2019-02-16 00:15:44 +08:00
trav90
dfcff1dfbc Call VPXDecoder libvpx wrappers for WebM
Use the new helper functions instead of calling libvpx directly. This simplifies adding other codecs in the future.
2019-02-16 00:15:42 +08:00
trav90
3b0820badb Implement keyframe and framesize VPXDecoder helpers
Encapsulate code from WebMDemuxer to query keyframe and frame resolution inside VPXDecoder, so we have a clean wrapper for all the libvpx functions we use.
2019-02-16 00:15:40 +08:00
trav90
85ee1da71a Add Span support to MediaRawData 2019-02-16 00:15:39 +08:00
trav90
0c88f36323 [vpx] Store VPXDecoder codec as an enum
Use the enum we already have here instead of converting to an int when we pass it around, giving us better type checking.
2019-02-16 00:15:37 +08:00
trav90
e7d7e0d2bf [webm] Store LastSeenFrame dimensions as an nsIntSize
This simplifies the comparison and update logic.
2019-02-16 00:15:36 +08:00
wolfbeast
faa1c5c0af Make all arguments to init*Event() optional except the first
This resolves #810.
2019-02-16 00:15:06 +08:00
trav90
c582c801da [ffmpeg] Always allocate memory to pass extradata
Despite wording of the documentation to the contrary, we can't provide a static pointer to an immutable object.
2019-02-16 00:15:04 +08:00
wolfbeast
606356d1f9 Remove telemetry reporting functions from CubebUtils
Tag #21.
2019-02-16 00:15:01 +08:00
wolfbeast
57251fc4e7 Clean up a number of unused variables.
Tag #21.
2019-02-16 00:14:50 +08:00
trav90
87be2b9973 Update test files for libnestegg update 2019-02-16 00:14:46 +08:00
wolfbeast
4b0b628cdd Remove IndexedDB for content pref.
Tag Issue #765
2019-02-16 00:14:34 +08:00
Gaming4JC
30797d4da8 backport mozbug 1334776 - CVE-2017-7797 Header name interning leaks across origins
Potential attack: session supercookie.

[Moz Notes](https://bugzilla.mozilla.org/show_bug.cgi?id=1334776#c5):
"The problem is that for unknown header names we store the first one we see and then later we case-insensitively match against that name *globally*. That means you can track if a user agent has already seen a certain header name used (by using a different casing and observing whether it gets normalized). This would allow you to see if a user has used a sensitive service that uses custom header names, or allows you to track a user across sites, by teaching the browser about a certain header case once and then observing if different casings get normalized to that.

What we should do instead is only store the casing for a header name for each header list and not globally. That way it only leaks where it's expected (and necessary) to leak."

[Moz fix note](https://bugzilla.mozilla.org/show_bug.cgi?id=1334776#c8):
"nsHttpAtom now holds the old nsHttpAtom and a string that is case sensitive (only for not standard headers).
So nsHttpAtom holds a pointer to a header name. (header names are store on a static structure). This is how it used to be. I left that part the same but added a nsCString which holds a string that was used to resoled the header name. So when we parse headers we call ResolveHeader with a char*. If it is a new header name the char* will be stored in a HttpHeapAtom, nsHttpAtom::_val will point to HttpHeapAtom::value and the same strings will be stored in mLocalCaseSensitiveHeader. For the first resolve request they will be the same but for the following maybe not. At the end this nsHttpAtom will be stored in nsHttpHeaderArray. For all operation we will used the old char* except when we are returning it to a script using VisitHeaders."
2019-02-16 00:14:28 +08:00
wolfbeast
5a03a408a8 Send worker-runnables destined for the main thread actually to the main thread.
A case of "one queue too many" here. Instead of worker runnables being sent to the main thread
where they are supposed to run, they are put in a task queue per-worker. This is devastating
for performance if many workers are running.
2019-02-16 00:14:03 +08:00
wolfbeast
73b9f505a1 Stop using the worker MainThreadTaskQueue from dom/fetch. 2019-02-16 00:14:01 +08:00
wolfbeast
3b98b8ca9a Stop using the MainThreadTaskQueue from service workers. 2019-02-16 00:14:00 +08:00
wolfbeast
ee1233bb0c Fix wrong SVG sizes with non-integer values for viewBox width/height.
Includes a standalone reftest.
2019-02-16 00:13:43 +08:00
wolfbeast
eff8a32348 Fix clang build bustage.
Follow-up to 9830cd079d8306abc223461190553af64b6fd0ca
2019-02-16 00:13:40 +08:00
wolfbeast
2f2751e46c Bug 1466991 - Part 2: Reparent nodes when they start being in the XBL scope. 2019-02-16 00:13:24 +08:00
wolfbeast
34f16bf61c Bug 1466991 - Part 1: Factor out ShouldUseXBLScope. 2019-02-16 00:13:22 +08:00
wolfbeast
44998d1f5b Bug 1472925 - Keep a strong reference to MediaStreamGraph from GraphDriver. 2019-02-16 00:13:21 +08:00
wolfbeast
c858b4cc75 Fix build bustage in cbfef7fcdb853916ff04015f6ee2d4b86f424a08
- imageDetails.format() needs a cast to SurfaceFormat
- style nit: wrap long lines.
2019-02-16 00:13:18 +08:00
wolfbeast
f3a19b8e9b Release mapped surface memory on size check failure to plug a leak. 2019-02-16 00:13:16 +08:00
wolfbeast
918ef0183a Move surface data checking to a separate function to make it less "totally nuts" 2019-02-16 00:13:15 +08:00