Documentation
¶
Overview ¶
Package testsrc provides deterministic synthetic capture sources for tests and for the engine's fake devices: a moving test pattern with a frame counter drawn into the picture, and a sine tone.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Pattern ¶
Pattern renders frame n of the test sequence: a diagonal colour gradient that scrolls, a bouncing box and, in the top-left, the 16-bit frame counter as black/white blocks.
func ReadCounter ¶
ReadCounter reads the frame counter drawn by Pattern from a luma plane of any size. ok is false when the blocks are not clearly black or white (a damaged or non-pattern picture).
Types ¶
type Audio ¶
type Audio struct {
Rate int
Channels int
Hz float64
Amp float64 // 0..1
Chunk time.Duration
Label string
// contains filtered or unexported fields
}
Audio is a capture.AudioSource producing a sine tone in real time.
func (*Audio) Info ¶
func (a *Audio) Info() capture.DeviceInfo
func (*Audio) Start ¶
func (a *Audio) Start(c capture.AudioConstraints) (<-chan *capture.AudioChunk, error)
type Video ¶
type Video struct {
W, H int
FPS float64
// Keep stores the last N frames by counter (for PSNR comparisons in tests); 0 keeps none.
Keep int
Label string
// contains filtered or unexported fields
}
Video is a capture.VideoSource producing a moving pattern at a fixed rate.
func (*Video) Info ¶
func (v *Video) Info() capture.DeviceInfo