This is fallout from Bug 1167235 - Use a fast method of double buffering for canvas.
It is possible for the CanvasRenderingContext2D to be destroyed while we're in the
middle of the call to nsObserverService::NotifyObservers() for shutdown.
This leaves the shutdown observer with a dangling pointer to the canvas, so this
patch explicitly clears the pointer when the context goes away.
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.
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.
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.
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.
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.
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.