Print separate seaction with deveices in :help as it is common in other
modules (eg. decklink). Previously, this was written as a part of the
option describing "device:", but it doesn't seem appropriate.
+ 2 tab indent for (optional) device channel listing (parent 1 tab)
For bidirectional cards (eg. deltacast hd elp-d 80), the channels can be
configured in a layout that lower indices are assigned to RX and higher
to TX (so 0-8 lower-indexed pins are RX and the rest is TX).
So if using RX channel=2 (zero-indexed), at least 3 RX channels need
to be taken in order for the 3rd channel to be RX.
- if quad channel not enabled, do not disable bypass relay on channel
other than selected
- assume that quad-channel starts from channel=0 (== channel is not
explicitly specified)
- delta_set_nb_channels called with 4 rx channels, not one (as in
Sample_RX4K.cpp)
- accept options by prefix (currently just one - "device")
- accept `-d deltacast` - it used to work in original code but since
some time ago, the empty option string is passed, not NULL (which
originally worked)
- if unsufficient number of channels, do not print Result (irrelevant - success)
- print the actual configuration of bidir channels if succeeded (as in SDK
example); increase verbosity to INFO (may be userful/important for user)
- redundant "bidirectional" if not succeeded
apply early return to simplify the code flow
Mostly only the refactor with these changes:
- log_msg -> MSG
- if IsBiDir and there is sufficient number of channels - print that we
don't have the mapping instead of the first message that was (incorrectly)
printed before
GETCH - return always -1 on error, not -1 when read returned 0 and -2
if -1 - the actual value doesn't seem to be checked by any of caller.
CID 472180 should be perhaps fixed
- fixed a leak of s->devices (CID 472157)
- fix partial display_done (when eg. second device from 2 fail to init,
do not call the vidcap_done on this - assumes non-NULL)
- remove s!=NULL after assertion on that