Documentation ¶
Overview ¶
Package digest is used to create mathematical hashes of VCS output. The two implementations of the Digest interface also implement the television.PixelRenderer and television.AudioMixer interfaces.
The digest.Video type is used to capture video output while digest.Audio is used to capture audio output.
The hashes produced by these types are used from regression tests and for verification of playback scripts.
Index ¶
- type Audio
- type Digest
- type Video
- func (dig *Video) EndRendering() error
- func (dig Video) Hash() string
- func (dig *Video) NewFrame(_ television.FrameInfo) error
- func (dig *Video) NewScanline(scanline int) error
- func (dig *Video) Reset()
- func (dig *Video) ResetDigest()
- func (dig *Video) Resize(frameInfo television.FrameInfo) error
- func (dig *Video) SetPixels(sig []signal.SignalAttributes, _ int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct { *television.Television // contains filtered or unexported fields }
Audio is an implementation of the television.AudioMixer interface with an embedded television for convenience. It periodically generates a SHA-1 value of the audio stream.
Note that the use of SHA-1 is fine for this application because this is not a cryptographic task.
func NewAudio ¶
func NewAudio(tv *television.Television) (*Audio, error)
NewAudio is the preferred method of initialisation for the Audio2Wav type.
func (*Audio) Reset ¶ added in v0.8.0
func (dig *Audio) Reset()
Reset implements the protocol.AudioMixer interface.
func (*Audio) ResetDigest ¶
func (dig *Audio) ResetDigest()
ResetDigest implements digest.Digest interface.
type Digest ¶
type Digest interface { Hash() string ResetDigest() }
Digest implementations compute a mathematical hash, retreivable with the Hash() function.
type Video ¶
type Video struct { *television.Television // contains filtered or unexported fields }
Video is an implementation of the television.PixelRenderer interface with an embedded television for convenience. It generates a SHA-1 value of the image every frame. it does not display the image anywhere.
Note that the use of SHA-1 is fine for this application because this is not a cryptographic task.
func NewVideo ¶
func NewVideo(tv *television.Television) (*Video, error)
NewVideo initialises a new instance of DigestTV.
func (*Video) EndRendering ¶
EndRendering implements television.PixelRenderer interface.
func (*Video) NewFrame ¶
func (dig *Video) NewFrame(_ television.FrameInfo) error
NewFrame implements television.PixelRenderer interface.
func (*Video) NewScanline ¶
NewScanline implements television.PixelRenderer interface.
func (*Video) Reset ¶ added in v0.7.1
func (dig *Video) Reset()
Reset implements television.PixelRenderer interface.
func (*Video) ResetDigest ¶
func (dig *Video) ResetDigest()
ResetDigest implements digest.Digest interface.
func (*Video) Resize ¶
func (dig *Video) Resize(frameInfo television.FrameInfo) error
Resize implements television.PixelRenderer interface
In this implementation we only handle specification changes. This means the digest is immune from changes to the frame resizing method used by the television implementation. Changes to how the specification is flipped might cause comparison failures however.