Commit Graph

7230 Commits

Author SHA1 Message Date
Martin Pulec
be1ec3fa30 vcap/testcard: exit if frames=<n>q
added optional exit if testcard run with frames= limit
2025-03-12 16:52:16 +01:00
Martin Pulec
2d72943438 vcap/testcard: limit frames - fix number (was -1) 2025-03-12 16:46:55 +01:00
Martin Pulec
2a59b6d00f vcomp/lavc: prefer libvpx-vp9 if AVX2 !present
For VP9, libsvt_vp9 is preferrd (if built-in, which is in Linux builds),
but it compiles with AVX2 by default, so prefer libvpx if CPU doesn't
support that.
2025-03-12 13:58:04 +01:00
Martin Pulec
7bcaf24ffa vcomp/lavc: preferred encoder updates
- typo (prefered->preferrred)
- if callback defined but returned nullptr, ignore that
2025-03-12 12:46:11 +01:00
Martin Piatka
f4504e1f52 vulkan_context: Fix debug callback deprecation warn 2025-03-11 13:29:48 +01:00
Martin Piatka
caf774efcf lavc: Don't crash on missing codec opts
codec->priv_class could be null, fixes GH-435
2025-03-11 10:15:56 +01:00
Martin Pulec
1abc9d97aa portaudio_common: help shotcut words
'output channels' and 'input channels' is needlessly verbose, use abbrevs
+ IN 1st, out second
2025-03-07 15:50:34 +01:00
Martin Pulec
e0dd01ccaf CoInitializeEx: use COINIT_APARTMENTTHREADED
PortAudio/ASIO drivers seem refuse initialization if
CoInitilizeEx initialized as COINIT_MULTITHREADED but they do for
COINIT_APARTMENTTHREADED.

Windows devices that could be affected by this change tested and seem
to work, namely:
- DeckLink
- DirectShow
- WASAPI

refer to GH-430
2025-03-07 13:26:17 +01:00
Martin Pulec
b2e70a619e poraudio: print supported APIs in fullhelp
useful mainly to check ASIO presence in Win
2025-03-07 11:11:01 +01:00
Martin Pulec
dc80f7cb48 portaudio_common: include-what-you-use 2025-03-07 10:36:30 +01:00
Martin Pulec
850138ab59 set ug_options.audio.codec_cfg=nullptr
The commit b785c3d8 from 2024-08-05 changed the default unconditionally
to PCM, but this has been true just for UltraGrid RTP, not RTSP or SDP
that used MP3, so this change reverts it back.
2025-03-06 10:59:26 +01:00
Martin Pulec
06bb519cb3 messaging: include-what-you-use 2025-03-05 16:15:51 +01:00
Martin Pulec
4a085c6c6c vrxtx/rtsp: allow compressed stream passthough
If the input is already compressed, try to pass it further. Initialize
the compression just if receiving uncompressed data.

This is implemented in the same way as it already is in vrxtx/sdp.

refers to GH-433
2025-03-05 16:09:05 +01:00
Martin Pulec
1cb57d341e video_display: fix use ptr after free
video_display putf implementation may free the frame so that the pointer
is no longer valid upon the exit from the callback (or anytime later).
This is the case for eg. vdisp/decklink.

Fixes `uv -t testcard -c lavc -d dummy:discard` (wrong color in output
line):
```
[dummy] 126 frames in 5.03501 seconds = 25.0248 FPS
```

even though FPS is +/- the nominal 25. Depending on circumstances it
could have also easily crashed (access after free).
2025-03-03 13:56:03 +01:00
Martin Pulec
0349beb384 vdisp/dummy: add discard parameter 2025-03-03 13:53:52 +01:00
Martin Pulec
0dad02e66a acap/wasapi: fix alignment of loopback acap device 2025-02-28 14:53:11 +01:00
Martin Pulec
00fb576307 wasapi: fix setting dev by UUID
The mutibyte to wide character conversion was (perhaps since the
beginning) wrong - mbtowc converts just one character - it should have
beem mbstowcs but using rather mbsrttowcs (thread-safe).
2025-02-28 14:53:11 +01:00
Martin Pulec
be2b3dcb59 aplay/sdl_mixer: rev changes committed by mistake
Reverted unintentionally committed changes in in the previous commit.
2025-02-26 09:03:30 +01:00
Martin Pulec
b26ca14cb1 lavc get supported prop fix
There are some calls using just the codec_ctx
parameter, which fail (with the compat with
legacy FFmpeg).

eg. `uv -A Opus -s testcard` (using the old FFmpeg)
2025-02-25 23:37:54 +01:00
Martin Pulec
0307b9ca7a vdisp get_splashscreen: fixed assert
1. static_assert could not have been strictly speaking used (splash_width
is not constexpr), although it worked most of the time (except macports
clang-mp-14)
2. the assertion was actually inverted (but the equality is included
and is the case for both cases so both work)
2025-02-20 10:35:12 +01: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
abc30c2be9 PAM: rename depth to ch_count
The depth (DEPTH field of PAM) is actually channel count, which may be
slightly misleading - use rather ch_count instead.
2025-02-18 16:58:08 +01:00
Martin Pulec
484a5a0b09 testcard:mode= add fullhelp + sd 2025-02-14 09:51:18 +01:00
Martin Pulec
924453e5b0 use get_stat_color also for FPS
select the color automatically (lime for +- 2-5%, brown for >5% diff)

This simplifies the code by sharing the logic in common; also exceeding
FPS is now colored (until this just lower than nominal was colored).
2025-02-11 14:19:11 +01:00
Martin Pulec
56d6435050 get_splashscreen: set alpha to 1
set the full opacity (it is RGBA and it has been 0 so far)
2025-02-11 13:04:09 +01:00
Martin Pulec
6b09b5e9fe get_splashscreeen: add assertions 2025-02-11 13:03:59 +01:00
Martin Pulec
a657bc75df audio dec: color if received samples don't match
If the actual number of decoded samples doesn't match the expected number
(from nominal sampling rate), use colors to catch user attention. This is
similar how it is already done for video capture/display.
2025-02-11 12:59:03 +01:00
Martin Pulec
b44af19782 audio sender: use colors for sample cnt summary 2025-02-11 12:59:03 +01:00
Martin Pulec
bc47cd392c gl: print GL version in help 2025-02-11 12:59:03 +01:00
Martin Pulec
7573bf24b1 video_display FPS indicator color FPS as a warning
In the display generic FPS indicator, use colors (arctic lime/saddle
brown) if the actual FPS is lagging behind the nominal FPS. Similarly
(and copied from) how it is already done for video capture.
2025-02-07 12:16:52 +01:00
Martin Pulec
948d559c41 video_display.c: IWYU 2025-02-07 12:16:42 +01:00
Martin Pulec
630797beab sdl2: print texture types in debug 2025-02-03 16:57:11 +01:00
Martin Pulec
1c56e6564e vdisp/sdl2: fixed I420 (IYUV)
The pitch for planar pixel formats is the pitch of the first plane,
most likely =width. This yield wrong data_len for I420 if just multiplied
by the height.

this fixes the change made by 107e3e30 (2024-09-02)
2025-02-03 10:52:02 +01:00
Martin Pulec
a15c14f2a4 sdl2: include + SDL_CHECK add action
include inttypes.h

SDL_CHECK can now have an optional action (using ellipsis) + handle
return value of SDL_LockTesxture using that (currently fails on Arch
Linux with sdl2-compat 2.30.50-1 and sdl3 3.2.0-1 and YCbCr textures).
2025-01-29 15:58:46 +01:00
Martin Pulec
5812cf1608 remove unneeded HAVE_SDL2 macro
include <SDL_header> instead of <SDL2/SDL_heaaer>
2025-01-24 14:37:36 +01:00
Martin Pulec
573fe22665 GPUJPEG: adjust verbosity
v0.26 is slightly more chatty even in GPUJPEG_LL_STATUS mode (new between
INFO and VERBOSE) while the status/verbose mode maps more to debug than
UG verbose so adjust the modes as such.
2025-01-20 16:25:18 +01:00
Martin Pulec
c55fdd8fad hwaccel_vdpau.h: add config.h include guard
allows build outside of UG/when config.h not generated

Also helps when building tools/convert even when config.h is generated,
VDPAU enabled but FFmpeg headers in non-standard path (that is obtained
by pkgconf for UG but not for the tool).
2025-01-08 14:27:06 +01:00
Martin Pulec
8bf32c3883 CID 470571 fix
fixed a Coverity bug
2025-01-07 16:24:16 +01:00
Martin Pulec
16d41e8a5d aplay/mixer: restricting senders - check err
also workarounds for CIDs 47049{6,7}
2024-12-04 16:17:03 +01:00
Martin Pulec
e62773d71d get_iface_local_addr4: handle err from get_ifindex
- return on wrong iface spec (similarly as IPv6 does)
- return on "help"
2024-12-04 16:05:49 +01:00
Martin Pulec
e88ad545bc net_udp: enforce v4 sock only for mac+mcast+iface
No longer enforce v4 socket for dot-decimal IPv4 mcast addresses unless
macOS used with mcast4 addr and interface set.

The default behavior now is to use dual-home v6 socket (with v4-mapped
addresses). macOS treates the v4 mcast addresses transparently as
v6 addresses (using v6 sockopts). But interface specification doesn't
currently seem to work in macOS, neither for native v6 mcast addresses
so enforce v4 sockets here.
2024-12-04 15:21:00 +01:00
Martin Pulec
d1023bdccb net_udp: multicast: multiple improvements
- support for v4-mapped IPv6 sockets (handled with v4 sockopts in
Linux+Win and v6 sockopts in macOS)
- for mcast4, except of Windows, the interface must be identified by
local address, not device number
- support also setting the bind address directly for v4
- leave mcast4 group with correct ID (not INADDR_ANY)

The local address interface specification was actually the original one
but was removed by the commit 92e24dd02 (in 2012).
2024-12-04 15:20:56 +01:00
Martin Pulec
65e8bf318f net_udp: set IPV6_MULTICAST_IF only of not default
macOS fails on it otherwise (at least 15.0), although it shouldn't
according to man ip6(4) (that is, however, presumably inherited from BSD,
because FreeBSD has the same).
2024-12-04 14:07:20 +01:00
Martin Pulec
b99c8c1300 utils/net: suppress alignment warning 2024-12-04 14:06:52 +01:00
Martin Pulec
4462a15fca net_udp: fix mcast TTL not set also for IPv6
This fixes the commit 43d15680 (2021-03-29) that added this for both
IPv4 and IPv6 but for IPv6 the condition was incorrectly aligned to
setsockopt fail, not ttl==-1.

Dropped IPv4/IPv6 specification - since we may/will use v4-mapped IPv6
sockets, the word "IPv6" might be confusing if use is using IPv4 mcast
addr.
2024-12-04 14:06:48 +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
a41b2c5a51 Revert "vdisp,vcap/decklink: do not fail if insuff drv ver"
Since the following error, the hard fail is again desirable. It, however
doesn't fail if the driver is usable (not so old, using same ABI).

This reverts commit cac114d6e5.
2024-11-29 12:36:27 +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