membrane_core
membrane_core copied to clipboard
Demand units should be taken from caps
For example, demand of size k should result in:
- demanding k MPEG frames on pad with MPEG caps
- demanding k*channels_no samples on pad with raw caps
- demanding k bytes on pad with bytestream caps (that need to be created)
To make this usable, we should also add some demand converting functionality - each caps should export function converting k-element demand to equivalent size in bytes (possibly approximate)
Caps changing dynamically may introduce some problems to this approach, so place, time and way of converting sizes need to be carrefully chosen. We should also keep in mind that caps may not be present when the first demand is executed.
Demands in bytes may also need to be supported even with caps different than bytestream, for example when ringbuffer has fixed size such way would be convenient.
We should also consider making PullBuffer size declaring unit always bytes, to avoid mistakes.
According to the planning meeting on 25.06.2018 it seems to be important to the end user so should be added soon but not in 0.2.0.
There's a lot of heuristics involved when trying to determine what "1 buffer" means and it needs good brainstorming before being implemented.