capturefromelement

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: 10 Imported by: 0

Documentation

Overview

Package capturefromelement provides common code for WebRTC's captureStream() tests; this API is used for <video> and <canvas> capture, see e.g. https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream and https://w3c.github.io/mediacapture-fromelement/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataFiles

func DataFiles() []string

DataFiles returns a list of files required to run the tests in this package.

func RunCaptureStream

func RunCaptureStream(ctx context.Context, s *testing.State, cr *chrome.Chrome, source CanvasSource, measurementDuration time.Duration) error

RunCaptureStream drives the code verifying the captureStream() functionality. measurementDuration, if != 0, specifies the time to collect performance metrics; conversely if == 0 the test instructs JS code to verify the capture correctness and finishes immediately.

Types

type CanvasSource

type CanvasSource int

CanvasSource defines what is fed to the <canvas> that we can capture from.

const (
	// UseGlClearColor indicates flipping colours using WebGL's clearColor().
	UseGlClearColor CanvasSource = iota
	// UseVideo indicates using a GetUserMedia() captured stream as canvas source.
	UseVideo
)

Jump to

Keyboard shortcuts

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