Commit Graph

351 Commits

Author SHA1 Message Date
Martin Pulec
ef0cd7130d unify stod/stoi invalid_argument::what parse
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.
2024-09-13 15:35:44 +02:00
Martin Piatka
efd502a92e decklink: Fix device id in capabilities 2024-08-19 16:13:22 +02:00
Martin Piatka
cdc6d59307 disp/decklink: Add GUI option for HDR 2024-08-19 13:49:04 +02:00
Martin Pulec
50812bba34 replacing PACKAGE_BUGREPORT with bug_msg
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.
2024-08-14 15:26:12 +02:00
Martin Pulec
bc68c877e4 vdisp/deck: fixed CID 464484 2024-07-08 10:21:00 +02:00
Martin Pulec
a7a0b88d15 deck: added a param to enforce old sort
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).
2024-06-12 10:23:07 +02:00
Martin Pulec
342c42c1f3 deck: print dev numeric indices in fullhelp 2024-06-12 09:41:53 +02:00
Martin Pulec
8d314ace03 bmd_get_sorted_devices: create iterator internally
This eliminates the need to recreate the iterator if another traversal
is required.
2024-06-12 09:41:53 +02:00
Martin Pulec
e0a1d4fca9 deck: return back original numeric indices
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.
2024-06-12 09:41:52 +02:00
Martin Pulec
6905ce94dc deck: topological ID sort fix
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).
2024-06-12 09:41:52 +02:00
Martin Pulec
779ad9002f vdisp/deck: allow dev spec with topological ID 2024-06-12 09:41:51 +02:00
Martin Pulec
24e5aa27f9 vdisp/deck: removed using namespace std 2024-06-12 09:41:51 +02:00
Martin Pulec
1a71edffd5 vdisp/deck: accept shortopt for profile 2024-06-07 10:40:20 +02:00
Martin Pulec
f9d619bd1c vdisp/deck: profile= fix 2024-06-07 10:40:20 +02:00
Martin Pulec
dd02943726 {vcap,vdisp}/deck: added "simplex" option
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).
2024-06-07 10:40:20 +02:00
Martin Pulec
106666b63b decklink: fail if set_profile not successful
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.
2024-06-07 10:40:19 +02:00
Martin Pulec
f5d124a9ea decklink: improved including 2024-05-16 09:54:24 +02:00
Martin Pulec
97e41d4af5 deck/disp: [no-]low-latency hint fix
- 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)
2024-05-16 09:54:24 +02:00
Martin Pulec
ad25efd83a disp/decklink: moved mode (latency/sync) to separate fn 2024-05-16 09:54:24 +02:00
Martin Pulec
2af7b0021a decklink aacl: improved description
Mention that the opt actually represents that audio levels are consumer
line.
2024-05-13 15:43:29 +02:00
Martin Pulec
56a6dc78b0 replace remaining WIN32 platform macros
see the commit HEAD@{2}
2024-05-13 12:56:53 +02:00
Martin Pulec
a42a346902 disp/decklink: always set max_aud_chans to value of 'mach'
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.
2024-04-18 13:08:34 +02:00
Martin Pulec
5c5c8ca468 disp/decklink: print arbitrary settings in shorthelp
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
2024-02-28 16:09:30 +01:00
Martin Pulec
042a854209 DeckLink disp sync: better encapsulation 2023-11-29 14:09:41 +01:00
Martin Pulec
f2ba6c3cc7 DeckLink disp sync: handle excessive aud. underflw
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
2023-11-29 09:30:25 +01:00
Martin Pulec
cdf4140a77 DeckLink disp sync: assert sched_frm min<max
\+ moved the stuff to a separate function
2023-11-28 16:56:21 +01:00
Martin Pulec
6008230061 DeckLink disp.: do not return nullptr on getf()
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.
2023-11-28 16:56:21 +01:00
Martin Pulec
86dd2c2b64 DeckLink disp.: set magic to human-readable FourCC 2023-11-28 16:56:21 +01:00
Martin Pulec
5efb58d1ae DeckLink disp sched: schedule (min+max+1)/2
Rather than filling to just the minimum, schedule (min+max+1)/2 on
underflow. This is consistent with that how it is prefilled.
2023-11-28 16:56:21 +01:00
Martin Pulec
38cffb0dad DeckLink disp.: watch overflow
- 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
2023-11-28 16:56:21 +01:00
Martin Pulec
0f8d022022 DeckLink disp.: resorted includes
- system prior to user
- include all config*h unconditionally (required for PACKAGE_* and ntohl)
- small other updates (int->bool)
2023-11-28 16:56:19 +01:00
Martin Pulec
f9d888f9fe DeckLink disp.: print video time when scheduled
for debugging
2023-11-27 16:41:28 +01:00
Martin Pulec
e148a2912a decklink disp.: needless NL in errmsg
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.
2023-11-06 13:28:18 +01:00
Martin Pulec
9ce4b3d557 DeckLik disp.: print errmsg if can't set aud switch 2023-11-03 11:11:10 +01:00
Martin Pulec
f618b6e9e7 DeckLink disp.: ensure that queried ch_count is valid
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.
2023-11-03 10:41:40 +01:00
Martin Pulec
7abe8937e9 DeckLink disp.: set audio chans only on query succ
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
2023-11-03 10:21:53 +01:00
Martin Pulec
817f3475aa DeckLink disp.: fixed a typo
fixes GH-355
2023-11-03 09:39:01 +01:00
Martin Pulec
c610aaef5f DeckLink disp.: set_audio_props improved
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)
2023-11-03 09:38:59 +01:00
Martin Pulec
724ab38854 DeckLink disp.: warn in verb. on nosupp aud switch
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).
2023-11-03 09:31:53 +01:00
Martin Pulec
27ac319234 DeckLink disp.: factor out aud init to fn
Moved audio configuration to a separate function - refactor only, should
behave almost the same as before.
2023-11-03 09:19:39 +01:00
Martin Pulec
a1779ea54e DeckLink: use get_str_from_bmd_api_str than cstr
In order not being obliged to free returned string.
2023-10-23 13:48:37 +02:00
Martin Pulec
d8d0753ce7 DeckLink: fixed other inconsistent spellings
\+ added the module prefix where there it was not (MSG() macro includes
MOD_NAME implicitly)
2023-10-23 09:21:54 +02:00
Martin Pulec
a9c7d194b3 inconsistent DeckLink spelling in output fix
fixes GH-346
2023-10-23 09:10:26 +02:00
Martin Pulec
962ce6b107 DeckLink disp.: removed voio=lafa
Do not set displaying last frame on idle operation by default as requested
by users.
2023-10-19 16:47:54 +02:00
Martin Pulec
61ef9e8167 DeckLink: aacl - move to fullhelp
This is intended for "implicit" options (those passed directly to
BMD API).
2023-10-19 16:47:54 +02:00
Martin Pulec
b445eb9d7e DeckLink: document query interface 2023-10-18 16:46:20 +02:00
Martin Pulec
90d04320e5 DeckLink disp.: support for "query="
to query device attributes, like `keyi`
2023-10-18 16:46:20 +02:00
Martin Pulec
768cc8a9b8 DeckLink disp sync: debug print sample count
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.
2023-10-17 12:45:30 +02:00
Martin Pulec
ae5ac7b843 DeckLink: deprecate audio_level option 2023-10-17 12:45:28 +02:00
Martin Pulec
050edb6d94 DeckLink: set audio levels via bmd_option 2023-10-17 12:40:01 +02:00