Commit Graph

141 Commits

Author SHA1 Message Date
Martin Pulec
e119f56b06 decklink: codec/connection listing in/out spec
Specify explictly that the supported input/output codec/connection
is for input or output (it can differ for direction, see prev commit).
2025-10-03 12:22:04 +02:00
Martin Pulec
c257c36d32 blackmagic: connections more terse (one line) 2025-09-29 08:11:39 +02:00
Ben Roeder
a62fe80c3f Fix spelling errors throughout codebase
Corrected various spelling mistakes in comments, documentation, and
variable names across the project. Changes include:
- Documentation files (CONTRIBUTING.md, README.md, etc.)
- Source code comments in C/C++ files
- Function parameter names and descriptions

No functional changes were made.
2025-06-01 18:03:40 +01:00
Martin Pulec
37e2298ffd decklink: warn if IP addr given but DHCP=no not 2025-04-03 11:54:52 +02:00
Martin Pulec
c7bf90fdf6 decklink fcc opt parse unified + moved to common 2025-04-03 11:54:52 +02:00
Martin Pulec
925c9e5264 DeckLink: added more help for DeckLink IP
- example for IP-specific opts in capture
- hint in display to consult capture help
- help:FourCC - in help usage
2025-02-18 16:58:10 +01:00
Martin Pulec
3e04432ef5 bmd_commmon small improvement
if property query fails, print its name (not only numeric ID)
2024-11-29 12:36:28 +01:00
Martin Pulec
9a0594dd4b blackmagic_api_version_check more inteligent
return false only if using the incompatible ABI

in other cases just issue a warning
2024-11-29 12:36:27 +01:00
Martin Pulec
ff2c259264 bmd_common: add all configuration items
the values will be shown in the FourCC opt listing (`help=FourCC`)

+ print value type with `help=FourCC`
2024-11-29 12:35:38 +01:00
Martin Pulec
54efe84fea deck/help=FourCC: make fourcc sample val 4-char long 2024-11-29 09:42:06 +01:00
Martin Pulec
abd758241a debug: move some stuff to utils/debug
The rationale is to separate the config.h-dependent stuff to a separate
file to eliminate the need to transitively include config.h.

+ fix the files that need config.h directly to include it
2024-11-28 11:46:09 +01:00
Martin Pulec
cac114d6e5 vdisp,vcap/decklink: do not fail if insuff drv ver
The motivation is to allow (although not recommend) running even with
old drivers - it will usually work and just the DeckLink IP features
won't be available (and warnings about that).

+ print it again at the beginning (== print also when :help requested)
+ change the message not_inst-or-outdated jus to outdated because in that
place it is obvious that the drivers are present
2024-11-28 10:34:08 +01:00
Martin Pulec
116096b744 vdisp/decklink: allow setting video connection
Usually not needed but needed when needing Composite output instead of
Component, because it is using the same wire as Y of component.
2024-11-27 14:29:26 +01:00
Martin Pulec
37bd9d5cce vdisp/decklink: list of available connections 2024-11-27 14:29:24 +01:00
Martin Pulec
20a3ed68ca BMDNotificationCallback: watch overheating
soft warning >= 77 °C, hard over 82
2024-11-20 11:39:54 +01:00
Martin Pulec
32322f2393 bmd status: print temperature in verbose
since the temperature changes quite often, rate limit it to one minute
2024-11-20 10:07:59 +01:00
Martin Pulec
9adf205d31 bmd_status: use module prefix
to be able to identify capture vs playback

This may or may not be important - if cap/disp is on single device,
the status is global so it doesn't matter there. But those can be 2
separate DeckLinks and then there will be hard to differntiate.

Also, both devices will get the same notifications so this makes at least
clear that the duplicate has some reason. (Maybe it will be useful to
figure out how to print just once?)

Note that BMD_CHECK still uses the blackmagic_common.cpp MOD_NMAE
("[DeckLink] ").
2024-11-19 16:54:12 +01:00
Martin Pulec
5f67a064b0 bmd_status: print some generally useful info
- refactorized
- added API check (hint to re-check changes)
- implement ST_BIT_FIELD (for busy status)
2024-11-19 16:54:11 +01:00
Martin Pulec
1bfae7bf66 bmd_common fourcc cmdline example improved
For the dst IP address-specifying opt, include also the port number.

The port number should have escaped colon, so that add it to the example.
2024-11-19 16:54:11 +01:00
Martin Pulec
2d71744c2c bmd_status improvements
- use BMD_CHECK to check HRESULT
- check Unsubscribe ret val
- if deckLink->QueryInterface(IID_IDeckLinkNotification, ..) fails,
release deckLinkStatus
- doxygen updates
2024-11-19 16:54:11 +01:00
Martin Pulec
d500197b63 bmd: keep notification interface in BMDNotificationCallback
I am not entierly sure if releasing IDeckLinkNotification in register
fuction actually doesn't cleanup the state. It seems it does not  but
just to be sure.
2024-11-19 16:54:11 +01:00
Martin Pulec
7395ad79cc decklink: use bmd notification API
The changes, eg. IP address do not take place immediately so it is
importatnt to print the changed value for the user to be sure that the
values is changed (the original is printed first by the bmd_print_status).
2024-11-19 16:54:11 +01:00
Martin Pulec
cdb90d8422 bmd_status: print the status for all devices
do not diffeentiate between IP and non-IP devices
2024-11-19 16:54:10 +01:00
Martin Pulec
d1c4888eca bmd_status: be more generic 2024-11-19 16:54:10 +01:00
Martin Pulec
54360d1590 bmd_common: non-Linux compat fixes
- the prop type must be BMDDeckLinkStatusID (Windows)
- `string_val = ""` also do not work if BMD_STR is different than in
Linux -> simplify (use the common code)
2024-11-19 16:54:10 +01:00
Martin Pulec
b9ca43e295 bmd: print Ethernet status (for IP devices) 2024-11-19 16:54:10 +01:00
Martin Pulec
1baedda2bc bmd: added Ethernet related types 2024-11-19 16:54:05 +01:00
Martin Pulec
8ab25ad234 bmd_option::parse: accept 0x prefix for number
When evaluating if a string is the number, expect that it may start with
0x prefix (for hexa values).
2024-11-19 16:54:04 +01:00
Martin Pulec
01cb8613e3 bmd_opt_help: print known options+examples 2024-11-19 16:54:04 +01:00
Martin Pulec
83847d58be blackmagic_common: fourcc->name mapping
- moved out of fcc_to_string to be used otherwhere
- split options and values (for futher use)
- converted from unordered_map to plain C-array (unordered map may throw
on file scope which cannot be catched)
2024-11-19 16:54:04 +01:00
Martin Pulec
bebc2c203b bmd: add FourCC option help 2024-11-19 16:54:04 +01:00
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