Documentation ¶
Overview ¶
Package webcodecs provides common code for video.WebCodecs* tests
Index ¶
- Constants
- func DecodeDataFiles() []string
- func EncodeDataFiles() []string
- func MP4DemuxerDataFiles() []string
- func RunDecodeTest(ctx context.Context, cr *chrome.Chrome, fileSystem http.FileSystem, ...) error
- func RunEncodeTest(ctx context.Context, cr *chrome.Chrome, fileSystem http.FileSystem, ...) error
- func VideoDataFiles() []string
- type HardwareAcceleration
- type TestDecodeArgs
- type TestEncodeArgs
Constants ¶
const Crowd720p = "crowd-1280x720_30frames.vp9.webm"
Crowd720p is 720p video data used in RunEncodeTest.
Variables ¶
This section is empty.
Functions ¶
func DecodeDataFiles ¶
func DecodeDataFiles() []string
DecodeDataFiles returns the HTML and JS files used in RunDecodeTest.
func EncodeDataFiles ¶
func EncodeDataFiles() []string
EncodeDataFiles returns the HTML and JS files used in RunEncodeTest.
func MP4DemuxerDataFiles ¶
func MP4DemuxerDataFiles() []string
MP4DemuxerDataFiles returns the list of JS files for demuxing MP4 container.
func RunDecodeTest ¶
func RunDecodeTest(ctx context.Context, cr *chrome.Chrome, fileSystem http.FileSystem, testArgs TestDecodeArgs, jsonFilePath, outDir string) error
RunDecodeTest tests encoding in WebCodecs API. It verifies a specified encoder is used and the decoded frames with md5 checksums in jsonFilePath.
func RunEncodeTest ¶
func RunEncodeTest(ctx context.Context, cr *chrome.Chrome, fileSystem http.FileSystem, testArgs TestEncodeArgs, videoFile, outDir string) error
RunEncodeTest tests encoding in WebCodecs API. It verifies a specified encoder is used and the produced bitstream.
func VideoDataFiles ¶
func VideoDataFiles() []string
VideoDataFiles returns the webm and mp4 files used in RunEncodeTest.
Types ¶
type HardwareAcceleration ¶
type HardwareAcceleration string
HardwareAcceleration represents the preference of used codecs in WebCodecs API. See https://www.w3.org/TR/webcodecs/#hardware-acceleration.
const ( // PreferHardware means hardware accelerated encoder/decoder is preferred. PreferHardware HardwareAcceleration = "prefer-hardware" // PreferSoftware means software encoder/decoder is preferred. PreferSoftware HardwareAcceleration = "prefer-software" )
type TestDecodeArgs ¶
type TestDecodeArgs struct { // VideoFile is the video file used in RunDecodeTest. VideoFile string // Acceleration denotes which decoder is used, hardware or software. Acceleration HardwareAcceleration }
TestDecodeArgs is the arguments used in RunDecodeTest.
type TestEncodeArgs ¶
type TestEncodeArgs struct { // Codec is the codec of a bitstream produced by an encoder. Codec videotype.Codec // ScalabilityMode is a "scalabilityMode" identifier. // https://www.w3.org/TR/webrtc-svc/#scalabilitymodes ScalabilityMode string // Acceleration denotes which encoder is used, hardware or software. Acceleration HardwareAcceleration }
TestEncodeArgs is the arguments used in RunEncodeTest.