Commit Graph

110 Commits

Author SHA1 Message Date
Martin Pulec
9adf7b6101 compat/htonl.->compat/net.h
It can be used in place of other network-related headers, not just for
htonl and family.

+ compat for fd_t and INVALID_SOCKET (that has been in config_*.h)
2024-09-30 10:54:14 +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
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
873ab8ff46 create_decklink_iterator: removed coinit param
Called in almost all cases with true, so CoInitialize unconditionally.

The only occurence with false in vcap/deck seem to be possible with true
as well - it just does one extra CoInit/CoUninit.
2024-06-12 09:41:52 +02:00
Martin Pulec
c82eef4258 com init documenation updates (incl deck) 2024-06-12 09:41:52 +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
bf4d64357a vcap/decklink: sort devices with topological ID
Allow device specification by topological ID and also sort according to
it. This is important mainly for 8K Pro subdevices, which are now sorted
in this order:
````
        0) 580200) DeckLink 8K Pro (1)
        1) 580201) DeckLink 8K Pro (3)
        2) 580202) DeckLink 8K Pro (2)
        3) 580203) DeckLink 8K Pro (4)
```

The new order actually represent the physical SDI connector order of the
card - the SDIs on the cards from the PCIe slots are Ref In, DeckLink
8K Pro (1), D8K (3), D8K (2), D8K (3).
2024-06-12 09:41:51 +02:00
Martin Pulec
c7d2ac25f1 bmd_common: decklink_set_profile stereo clarification
Clarify handling if stereo == true (handled implicitly only if the
profile is set to default).
2024-06-07 10:40:19 +02:00
Martin Pulec
ba2d634c2d decklink_set_profile: handle help 2024-06-07 10:40:19 +02:00
Martin Pulec
2ee702e15e blackmagic_common: fixed including
do not include config*h
2024-06-07 10:40:19 +02:00
Martin Pulec
0467e7e7d6 bmd_option: added get_string 2024-06-07 10:40:13 +02:00
Martin Pulec
226c17f02d replace all other AC-defined platform macro
Replaced all other autoconf-defined platform macros (HAVE_LINUX and
HAVE_MACOSX, WIN32 already done) with those ones defined by compiler.

Not yet remove the definitions from autoconf, in case someone will use
the old macros anyways. Remove in future.
2024-05-13 12:56:53 +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
605a096c17 print_bmd_attribute: pad with space
BMD FourCC sometimes end with space, like 'pal '. Although no
BMDDeckLinkAttributeID currently does, we may pad to be simplier to use,
eg. `-t decklink:q=3cc` instead of `-t decklink:q='3cc '`. Also suppresses
potential compiler complains due to using NULL-terminated function on a
"string" that is not terminated in general.
2023-10-19 16:47:54 +02:00
Martin Pulec
e063ebc651 DeckLink cap.: "query=" - try all types
Do not use "<FourCC>F" syntax (for flags). Try all possible types if
the previous query returns E_INVALIDARG until success, instead.
2023-10-18 16:46:20 +02:00
Martin Pulec
74c4192b88 DeckLink cap.: print_property to common + rename
the function may be used by the display as well
2023-10-18 16:46:19 +02:00
Martin Pulec
df85895cf4 bmd_common: name for bmdIdleVideoOutputBlack
not used by UG but in case user sets `-d decklnk:voio=blac`
2023-10-18 16:46:15 +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
Martin Pulec
27c09ebb12 DeckLink audio_level: unified handling
+ [display] string "false" was incorrectly evaluated as true (missing
comparison of strcasecmp with zero)
2023-10-17 12:39:55 +02:00
Martin Pulec
fd1d808d66 print supported pixfmts also for DeckLink capture 2023-10-10 16:07:04 +02:00
Martin Pulec
e4f50f5318 fixed Coverity CID 41653{4,5} 2023-08-08 11:35:09 +02:00
Martin Pulec
aeb1be31a1 bmd_option: decrease log lvl on E_NOTIMPL
Decrease log level for implicit options returning E_NOTIMPL to info -
perhaps not important at all (like passthrough on old devices) and we
do not want to decrease user attention to warning.s
2023-08-02 15:41:09 +02:00
Martin Pulec
2073a173b8 bmd_option: print val in both dec and hex
Usually decadic is better representation but we don't know in general,
so print both.
2023-06-26 12:06:34 +02:00
Martin Pulec
9585480c56 vidcap testcard: remove no nonger used midi_buf
Testcard doesn't longer play a MIDI, this has been moved to audio
capture sdl_mixer.
2023-05-19 08:37:59 +02:00
Martin Pulec
439eab1256 bmd_option: renamed option_write -> device_write
"option" is redundant here, because it is already in type name and using
"device" instead indicates more clearly that it gets written to the
device.
2023-05-17 11:42:05 +02:00
Martin Pulec
72df5c0c79 bmd_option::option_write: mod specific log prefix
When writing option log message, use module specific prefix, eg.
"[DeckLink display] " instead of just "[DeckLink] ".
2023-05-17 11:42:02 +02:00
Martin Pulec
34853fc198 fixed CID 407684 2023-05-10 09:53:02 +02:00
Martin Pulec
aefae0b5b8 bmd_option::parse: allow explicitly typing options
Allowing values like '1234' (FCC) or "strn" (string) that would be
otherwise parsed as int and FourCC in second case.
2023-05-10 09:24:19 +02:00
Martin Pulec
0f37cabf1f DeckLink: allow setting string properties
eg.: bmdDeckLinkConfigDeviceInformationLabel ('dila')
2023-05-10 08:52:03 +02:00
Martin Pulec
834ff43d5e bmd_option: allow setting of floating point props
this may be useful for things like bmdDeckLinkConfigAnalogAudioOutputScaleChannel1 ('aos1')
2023-05-10 08:52:03 +02:00
Martin Pulec
97e35083f2 bmd_option::parse: allow negative integers
bmdDeckLinkConfigBypass ('byps') allows setting -1
2023-05-10 08:52:02 +02:00
Martin Pulec
455c8542cb DeckLink cap.: allow arbitrary option
Allow passing of arbitrary option to DeckLink configuration, eg.:

    uv -t decklink:cptm=pdir

via FourCC option name and value (may be also a flag or an int). The
option is passed directly to BMD API.
2023-05-10 08:52:02 +02:00
Martin Pulec
99374917f2 blackmagic_common: print failed option value 2023-05-10 08:52:02 +02:00
Martin Pulec
183d175d73 fixed some of new Coverity issues 2023-05-10 08:52:02 +02:00
Martin Pulec
65eadce92d restored ostream flags should be set with flags()
Previously, setf() was used but flags() is better because it restores
exactly the previous state.
2023-05-10 08:52:01 +02:00
Martin Pulec
9356dec8ab bmd: small improvements 2023-05-05 09:08:00 +02:00
Martin Pulec
d7485f2eb1 bmd_option: mark 2 fncs as const
member functions is_default() and keep() are marked as const
2023-05-05 08:50:15 +02:00
Martin Pulec
a511c9f24b DeckLink disp.: turn other features into bmd_option 2023-05-05 08:50:15 +02:00
Martin Pulec
9788dcfc98 DeckLink disp.: use bmd_options also for SDI level A/B
Removed unneeded check if device supports 3G-SDI level A option - if it
doesn't, the setting would simply not succeed.
2023-05-05 08:50:15 +02:00
Martin Pulec
4b30869ec5 DeckLink cap.: print human readable connection with bmd_opt 2023-05-05 08:50:15 +02:00
Martin Pulec
215ee42481 DeckLink: use bmd_option for profile_req
+ [disp] the condition `s->profile_req == bmdProfileOneSubDeviceHalfDuplex`
  was probably inverted - there should perhaps be unequality, because if
  not set otherwise, that option is set for quad-link by default
2023-05-05 08:50:15 +02:00
Martin Pulec
6c404e8e50 bmd_option::parse_int: parse keep opt 2023-05-05 08:50:14 +02:00
Martin Pulec
7aaf528c0e DeckLink disp.: set link via options
+ when setting the profile automatically, use detected/actual link
  configuration to check quad-link, not use the value set by us (may be
  set in BMD settings)
+ sort conf_name_map alphabetically
2023-05-05 08:50:14 +02:00
Martin Pulec
91374fffee DeckLink disp.: handle more opts generically
+ do not set the opts if keep option was selected
2023-05-05 08:50:14 +02:00
Martin Pulec
ba9b71bb64 DeckLink: get rid of BMD_CONFIG_SET macro
using bmd_option instead
2023-05-04 14:39:21 +02:00
Martin Pulec
824efaf6ad DeckLink disp.: use bmd_options 2023-05-04 14:39:21 +02:00
Martin Pulec
5cf2e7d87e DeckLink cap.: removed use the bmd_opt also for PsF setting 2023-05-04 14:39:21 +02:00
Martin Pulec
7409e352e0 DeckLink cap.: use bmd_option to set input connect 2023-05-04 14:39:14 +02:00