Skip to main content

Module testing

Module testing 

Source
Expand description

In-memory helpers for exercising the engine in downstream tests.

None of this is required at runtime; it exists so consumers can verify their MediaSource/MediaSink/Observer implementations against a real engine without standing up a socket.

Structs§

CollectingSink
A MediaSink that records every frame it receives. Useful for asserting what a pipeline produced.
CountingObserver
An Observer that counts the events it sees. Cheap to clone (shared counters) so a copy can be handed to the engine and another kept for asserts.
InMemoryStorage
An in-memory StorageBackend for testing packagers and recorders without touching the filesystem. Cheap to clone (shared object map).
NullSink
A MediaSink that discards everything — the /dev/null of sinks.

Functions§

audio_frame
Build an audio MediaFrame at pts (ms).
video_frame
Build a video MediaFrame at pts (ms), keyframe or delta. A terse fixture for tests and examples.