We try to allocate as many frames as were configured by looking for a
big enough range of unused contiguous frames while taking the configured
modes into account.
The number of frame stores / frame buffers can't be used like this as
the actual number of frames that can be used also depends on the
resolution.
If too many frames are used and the card's memory runs full, strange
problems (green frames, channels leaking into each other, etc.) will
appear.
As such, configure 8 frames for the source by default and half the queue
length for the sink. If anything else is needed, manual configuration
via the properties has to happen based on the expected workload on all
channels and the characteristics of the card in use.
And calculate them automatically be default based on the number of frame
buffers available and the number of channels.
This works around various bugs in the AJA SDK when selecting these
manually.
See AJA support ticket #5056.
ADF packets that are not a multiple of 12 large are truncated at the end
in SD modes. Instead of directly converting all the packets at once like
for non-SD modes, do the conversion (partially) manually.