webcodecs

package
v0.0.0-...-683b059 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2022 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Overview

Package webcodecs provides common code for video.WebCodecs* tests

Index

Constants

View Source
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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL