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§
- Audio
Clock - 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 coversrateseconds 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. - Frame
Queue - Decoded frames waiting for their time, oldest first.
- Tempo
Timeline - The media time of sound coming out of a tempo filter, which holds some
back: every sample out covers
ratesamples 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. - Wall
Clock - A media clock running off the wall clock:
ptsat wall timesince, advancing atratewhile running and frozen while paused. Times are seconds; the wall time is passed in, so the clock is plain arithmetic.
Constants§
Functions§
- before_
target - Whether a frame at
ptsis still before a seek’stargetand should be decoded but not shown: the next frame (one frame time later) would already be showing attarget. 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
wpixels wide with sample aspect ratiosar(anamorphic DVD video has non-square pixels). - fit
- The size to scale a
w×hpicture to so its long side is at mostmax_side, never enlarging. - needs_
tempo - Whether sound at
rateneeds stretching. At normal speed (to within the player’s own tolerance) it skips the filter altogether. - queue_
cap - How many decoded frames of
byteseach to keep ready: up toMAX_QUEUED_FRAMES, withinQUEUE_BYTES, and never fewer than two. - secs
- Seconds of a timestamp in
tb, measured from the stream’sstart(also intb; files that don’t start at zero, such as MPEG-TS captures, show from 0).Nonefor a missing timestamp. - seek_ts
- The container timestamp (
AV_TIME_BASEunits, asav_seek_frametakes with stream -1) oftseconds after the file’sstart. - step_
back - The time to seek to for a step of
framesback fromshown. - tempo_
chain - The
atempospeeds to chain forrate(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 israte. - 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.