Bug 1690111 makes GetExtraData's memory allocation falliable. When the
allocation fails, GetExtraData should return an error instead of a null
nsTArray pointer.
Differential Revision: https://phabricator.services.mozilla.com/D192699
This is very useful to understand in the log what config is output in what
encoder output callback, with respect to configure(...) calls.
Differential Revision: https://phabricator.services.mozilla.com/D196210
This is needed so that we can write talos tests that exercise different
codecs on Windows/OSX/Linux. We can't distinguish between platforms to
skip or gracefully fail this test for a particular platform, and since
the H264 we are testing with is able to be decoded successfully, let's
just make a pref to allow us (and others) to test with what we have
implemented even if partially broken.
Differential Revision: https://phabricator.services.mozilla.com/D196603
This patch moves VideoDecoderTraits and its friends from VideoDecoder
files to DecoderTypes so DecoderTemplate file can see VideoDecoderTraits
by including DecoderTypes and can declare a template with
VideoDecoderTraits as a base class for VideoDecoder
Differential Revision: https://phabricator.services.mozilla.com/D190632
This patches renames the OutputVideoFrames to OutputDecodedData and add
a function to convert DecodedData to the output type defined by the
template inheritance.
Depends on D188903
Differential Revision: https://phabricator.services.mozilla.com/D189015
This patch moves the input-to-MediaRawData conversion from DecodeMessage
to a template function so that the template inheritance can implement
its own conversion function.
Depends on D188538
Differential Revision: https://phabricator.services.mozilla.com/D188663
This patch creates a C++ template that will be used as a base class of
WebCodecs' VideoDecoder and (future) AudioDecoder.
Currently, only the internal member variabls and functions are moved
into the template class. The common interfaces shared between the
VideoDecoder and the AudioDecoder will be moved to the template in the
following patches.
Note that some changes are made in this patch:
- Add a VideoDecoderTraits type to specify the types used in the decoder
template
- Reset(const nsresult& aResult) and Close(...) for internal usages are
renamed to ResetInternal in order to be distinguished from the
Reset(ErrorResult& aRv) in the VideoDecoder's public interface
- ControlMessage-related classes become nested classes since they have
member variables whose types depends on the template's typename
- DecodedDataToVideoFrame is generalized to a function named
DecodedDataToOutputType that convert the decoded data to a specific
type (e.g., VideoFrame for VideoDecoder)
- Rename CreateVideoInfo to CreateTrackInfo and move it to
VideoDecoderTraits so that the decoder template can get a TrackInfo
from the template inheritance
- Add a IsSupported method to VideoDecoderTraits so that the decoder
template can know what codec its template ingeritance supports
Depends on D189012
Differential Revision: https://phabricator.services.mozilla.com/D188538
This patches renames the OutputVideoFrames to OutputDecodedData and add
a function to convert DecodedData to the output type defined by the
template inheritance.
Differential Revision: https://phabricator.services.mozilla.com/D189015
This patch moves the input-to-MediaRawData conversion from DecodeMessage
to a template function so that the template inheritance can implement
its own conversion function.
Differential Revision: https://phabricator.services.mozilla.com/D188663
This patch creates a C++ template that will be used as a base class of
WebCodecs' VideoDecoder and (future) AudioDecoder.
Currently, only the internal member variabls and functions are moved
into the template class. The common interfaces shared between the
VideoDecoder and the AudioDecoder will be moved to the template in the
following patches.
Note that some changes are made in this patch:
- Add a VideoDecoderTraits type to specify the types used in the decoder
template
- Reset(const nsresult& aResult) and Close(...) for internal usages are
renamed to ResetInternal in order to be distinguished from the
Reset(ErrorResult& aRv) in the VideoDecoder's public interface
- ControlMessage-related classes become nested classes since they have
member variables whose types depends on the template's typename
- DecodedDataToVideoFrame is generalized to a function named
DecodedDataToOutputType that convert the decoded data to a specific
type (e.g., VideoFrame for VideoDecoder)
- Rename CreateVideoInfo to CreateTrackInfo and move it to
VideoDecoderTraits so that the decoder template can get a TrackInfo
from the template inheritance
- Add a IsSupported method to VideoDecoderTraits so that the decoder
template can know what codec its template ingeritance supports
Differential Revision: https://phabricator.services.mozilla.com/D188538
This patch allows us to extract a VideoPixelFormat for a VideoFrame when
backed by a GPUVideoImage. This in turn is used by SurfaceFromVideoFrame
for canvas drawing. With a concrete surface format, we can avoid
readbacks with WebGL in particular and dramatically improve performance
in existing demos.
Differential Revision: https://phabricator.services.mozilla.com/D188853