This is a hack to check whether given invalid_argument message belongs
to stoi/stod. It is usually used to catch non-numeric user input where
a number was expected.
Where the PACKAGE_BUGREPORT is the only used item from config.h,
use bug_msg(), which can be then removed.
Improved bug_msg() to allow printf-like fomat + arguments.
Added `--param bmd-sort-natural` to enforce old devices' sorting in help +
display the old indices instead of new ones. Numeric indices can be used
regardless the option (althoug hidden by default).
The numeric indices now use the "natural" index as devices given by
IDeckLinkIterator. The idea is to keep the index consistent with previous
versions.
For the devices ordered newly by topological ID, use character indices
instead ('a', 'b' etc.).
Do not advertise numeric indices for now, anyways, even though now left -
it can now be considered as a legacy feature, it can be later added to
the output if considered useful.
Limit lifetime of the returned map to the ranged for scope - the map
actually contains references to IDeckLink devices with deleters.
In probes and helps, it meant that release was called at the block
end, which means in this case that the release occurs right after
decklink_uninitalize(), which is certainly incorrect.
It seems that isn't a big problem in inits - it would be a problem just for
devices in the map after the initialized one (previous are unmanaged
and released) and if init fails (decklink_uninitalize will be called
before the block ends in this case).
Added option "simplex" in a fasshion of "half-duplex" and "full-duplex",
which are informal shortcuts for device profiles.
Here, simplex refers to bmdProfileOneSubDeviceHalfDuplex (1dhd) for 8K
Pro, which basically sets device to a mode that is capable to use all
four connectors for the signal, effectively allowing quad-link input
(eg. 8K).
If explicit setting of profiles fail, it should be handled as an
error. Unsure if implit setting with stereo should not proceed but if so,
it could be fixed later.
- do not suggest synchronize on low-latency - this was actually incorrect,
because it is the vice versa (low-latency is already implicit for a
long time)
- for "low-latency" notice that it is not needed (implicit)
set always max_aud_chans to BMDDeckLinkMaximumAudioChannels
Setting it to BMDDeckLinkMaximumAnalogAudioOutputChannels ('aach') for
analog output was incorrect, because eg. BMD Studio 4K has mach=16 but
aach=4. This subsequently crashes on assert, because
IDeckLinkOutput::EnableAudioOutput accepts only 2, 8, 16, 32 or 64
channels.
This increases the output just 3 more lines while those listed options
may be useful.
\+ suggest no to _aacl_ to explicitly disable audio consumer levels
using audio codec with relatively long delay may cause underflows, eg.:
```
uv -t testcard:mode=Hi59 -s embedded -d decklink:sync=4 -r embedded \
-c libavcodec:encoder=libx264 -A mp3:bitrate=64k
```
refers to GH-362
Do not return nullptr from getf() - it should not be returned when
reconvigure was sucessful and would crash in decoder, anyways. We
reconfigure with audio change internally, so if may fail.
- add even more than 1 frame if less than one from m_min_sched_frames
- add the fill even if we have frames in queue but we won't get the
m_min_sched_frames
Splitting the error to
```
[DeckLink display] Unable to switch audio output for channels 3 or above although
card shall support it: Not implemented (0x80000001)
Check if it is ok. Continuing anyway.
```
actually doesn't help readibility.
If not, it may later fail (see GH-354) in
display_decklink_reconfigure_audio() depending what the actual value is
and what will be negotiated, it would certainly fail for < 2.
refers to GH-354
It seems that if the query fails, it sets some undefined or invalid
value to the output variable.
\+ print actual used maximal value in verbose mode
\+ print also error message
print the connection directly from the display flag and then we can return
if audio is required to be embedded (no need to set AESEBU/analog switch).
\+ use more defensive msg about audio output (we actually may not set anything)
If cannot switch to AESEBU/analog, warn at least in verbose mode
(shouldn't be an issue in most cases, since this is usually needed only
for more than 2 channels).
now icorrectly working:
```
uv -r embedded -t testcard:mode=Hp24 -s embedded -A AAC -d decklink:sync
````
(clicking)
Refers to GH-345 - sample count was actually not the issue here,
streamTime is incorrect, but to ensure it is valid.