Skip to main content

Module sync

Module sync 

Source
Expand description

The player’s timing rules, free of FFmpeg so they can be tested: the wall clock, the audio clock, the queue of decoded frames waiting to be shown, the arithmetic of timestamps and seeks, and the bookkeeping of sound stretched to another speed.

Structs§

AudioClock
Where the sound is: the media time of the first sample of the chunk the output last took, when it took it, and how much media time that chunk covers (at speed rate, each second of samples covers rate seconds of the clip, whose pitch stays put). Between takes the clock runs on from the chunk’s start, but never past its end, so a starved output stops the clock.
FrameQueue
Decoded frames waiting for their time, oldest first.
TempoTimeline
The media time of sound coming out of a tempo filter, which holds some back: every sample out covers rate samples in, counted from the time of the first sample in, so the timestamps on what goes in don’t apply to what comes out of the same call.
WallClock
A media clock running off the wall clock: pts at wall time since, advancing at rate while running and frozen while paused. Times are seconds; the wall time is passed in, so the clock is plain arithmetic.

Constants§

MAX_QUEUED_FRAMES
QUEUE_BYTES

Functions§

before_target
Whether a frame at pts is still before a seek’s target and should be decoded but not shown: the next frame (one frame time later) would already be showing at target. The decoder starts at the keyframe before the target and works forward to the frame on screen at it.
display_width
The shown width of a picture w pixels wide with sample aspect ratio sar (anamorphic DVD video has non-square pixels).
fit
The size to scale a w × h picture to so its long side is at most max_side, never enlarging.
needs_tempo
Whether sound at rate needs stretching. At normal speed (to within the player’s own tolerance) it skips the filter altogether.
queue_cap
How many decoded frames of bytes each to keep ready: up to MAX_QUEUED_FRAMES, within QUEUE_BYTES, and never fewer than two.
secs
Seconds of a timestamp in tb, measured from the stream’s start (also in tb; files that don’t start at zero, such as MPEG-TS captures, show from 0). None for a missing timestamp.
seek_ts
The container timestamp (AV_TIME_BASE units, as av_seek_frame takes with stream -1) of t seconds after the file’s start.
step_back
The time to seek to for a step of frames back from shown.
tempo_chain
The atempo speeds to chain for rate (clamped to the player’s 0.1 to 16): one filter, with halving filters ahead of it below 0.5, as FFmpeg’s documentation describes. Their product is rate.
thumbnail_time
Where Eagle’s thumbnailer takes a video’s picture: ten seconds in, or a third of the way through a clip shorter than thirty seconds.
turns_from_degrees
Clockwise quarter turns (0 to 3) for a display matrix rotation, which FFmpeg gives in degrees anticlockwise.