Expand description
Which renditions are encoding, and how much each has produced.
Nothing is encoded until a consumer asks for a rung, so a transcoder that is
publishing a catalog and a transcoder that is saturating a GPU look identical
from the outside. Broadcast demand (moq_net::broadcast::Demand) closes
half the gap: it says someone is watching. This module closes the other
half by naming which renditions are being produced, and counting what each
one produced, which is what a caller pricing or admitting the work needs.
Consumer is a cursor shaped like moq_net::announce::Consumer: it
reports the ladder as it resolves, then one rendition starting or stopping at
a time. Each Rendition it hands over is a lasting handle, so a caller
keeps them all and reads the counters whenever it bills.
The cursor cannot bill on its own. A rendition whose pipelines start and stop
between two calls is never reported as an edge (the same is true of
announce), and a group fetch is exactly that: one pipeline per group, alive
for milliseconds. The counters behind the handle count it anyway, which is
why the ladder is delivered up front rather than on the first edge.
Frames are the unit rather than wall-clock time, because the two only agree
on the live path. A group fetch encodes seconds of media in milliseconds, and
a subscriber attached to a stalled source holds a pipeline open for minutes
while producing nothing; counting frames is right in both. Media seconds, if
that is the bill, are Rendition::frames over Rendition::framerate.
A rendition counts as encoding from its first encoded frame, not from the moment a consumer asked, for the same reason.