6419 Commits

Author SHA1 Message Date
Martin Pulec
759e4a1666 workaround to a buggy GPUJPEG 2024-08-20 10:24:30 +02:00
Martin Pulec
7e9521728c vcap/rtsp: emit_pps_fps loop fix
If h264_offset_len was 0 (SPS/PPS not in RTSP but eg. in the stream,
as UltraGrid RTSP server currently does), _grab() returned NULL
infinitely.
2024-07-23 11:55:01 +02:00
Martin Pulec
d589fffe93 vcap/rtsp: advise use of devel branch 2024-07-23 10:32:24 +02:00
Martin Pulec
f0994afffe rtpdec_h264 decode_frame_h264: watch overflow 2024-07-23 10:27:55 +02:00
Martin Pulec
a172ec1c71 vcap/rtsp: fixed pointer passing
insteda to rtsp_state::rtsp_error_occurred, the error was printed to
some place of stack (the address of `s` variable on stack plus offset
of that attribute).

\+ added magic value to ensure
2024-07-22 14:44:37 +02:00
Martin Pulec
6498db9528 debug_dump: overflow fix
The printout includes pointer, which was at the time of writting supposed
to be 32, in which case the line length was:

2 /* 0x */ + 8 /* ptr */ + 1 /* : */ + 3 * 16 /* " XX" */ + 16 /* char repr */ + 5 /* additiona separators */ + 1 /* NL */ = 81

(separators - 2 betweeh group of hexa and char repre, 3 between hexa and char represenatation)

With 64 bit pinters, it can be at most 89 bytes. To keep the old length,
removed one space between every pair of hexadecimal byte representation -
it is still good legible, compatibile with xxd, still keeping the 80
long line..
2024-07-22 11:22:22 +02:00
Martin Piatka
4f3da43514 capture/dshow: Add workaround for OBS virtual camera 2024-07-22 11:22:22 +02:00
Martin Pulec
c1b8169966 vdisp/file: fixed correctly the lock problem
Fixed correctly the problem that was incorrectly attempted by the
previous commit revert. should_exit doesn't need to be checked with the
main while loop because it is done by the inner one.
2024-07-22 11:22:21 +02:00
Martin Pulec
dd801dd9d3 Revert "display/file: fixed CID 424197/1"
This reverts commit 517bef3dd1.

The fix was incorrect, causing also new CID 464471.
2024-07-22 11:22:21 +02:00
Martin Pulec
f5dad89997 vcomp/cineform: fixed a crash witn unint frame
It is actually a bug of cineform, which can be also reproduced with:
`-t testcard:c=RGB:pattern=noise -c cineform`, this is a workaround.
2024-07-22 11:22:21 +02:00
Martin Pulec
be70813aab vcomp/cineform: fixed crashing RGB
Together with the previous revert commit fixes CID 464437.

In addition to incorrect change to unsigned, also parenthesis around
(height - 1) were missing.
2024-07-22 11:22:21 +02:00
Martin Pulec
a7f7535e92 Revert "Cineform: Windows warning fix"
This reverts commit 45d0bfb615.
2024-07-22 11:22:21 +02:00
Martin Pulec
116d5533d7 video_rxtx: don't unregister callb. if not regist.
Do not unregister the should_exit callback if not registsterd. This
occurs eg. when invalid host was entered, like: `uv blah`.
2024-07-22 11:22:20 +02:00
Martin Pulec
82b7a21021 vcap/testcard2: try also Monaco.dfont as mac font
Some macs doesn't have Monaco.ttf, in which case Keyboard.ttf is usually
selected, which is not monospace and doesn't have a symbol for ':'.

The mac, where Monaco.ttf is missing usually have Monaco.dfont, that
can be directly used, so added it to font_candidates.
2024-07-22 11:22:20 +02:00
Martin Pulec
3cec5ad9b1 vcap/ndi: DNS-SD is required for NDI discovery (msg)
To be preciese, not mDNS but DNS-SD is required to NDI discovery,
i.e. avahi-daemon is required in Linux, although systemd-resolved is
mDNS capable.
2024-07-22 11:22:20 +02:00
Martin Pulec
a39bac849b ndi_common: increment USE_NDI_VERSION to 6
just a default value

Actually, not much is influenced by that change, since it has been 5 (by
default) and the version 6 keeps v5 API, so that the entrypoint remains
`const NDIlib_v5* NDIlib_v5_load(void);` (not 6).

Only functional change is updated fallback path in MSW.
2024-07-22 11:22:20 +02:00
Martin Pulec
8758d9a393 ndi_common: do not call dlerror() second time
Do not call dlerror() second time - the function actually clears the
error status, so that the second call returns NULL (printing with '%s'
is actually UB).
2024-07-22 11:22:19 +02:00
Martin Pulec
abcc6c8ddf updated NDI copyright
Updated copyright as per current version at:
<https://docs.ndi.video/docs/sdk/licensing>
2024-07-22 11:22:19 +02:00
Martin Pulec
cf7e5d9a84 vcap/rtsp: clear cURL only if init 2024-07-15 15:54:02 +02:00
Martin Pulec
87f5c52a32 Revert "fixed CID 424197" + fix correctly
Fix the commit ab794ce70 (2023-11-23) that fixed (incorrectly) the
CID 424197.

If  should_exit was set before waiting in pthread_cond_timedwait, the
infinite loop is never left. Moreover, it seems that the loop was left
only on should_exit timeout, not when notified by condition variable.

This is mostly to make Coverity happy - the spurious wakeup here does
not matter in any way. So reverting the original "fix" would be enough.
2024-07-15 15:46:06 +02:00
Martin Pulec
44eb1a5dad vcomp/lavc: hint for libsvtav1
pred-struct=1 + bitrate will likely fail (with new libsvtav1) - add hint
to use CRF or CQP.

More sofiscated solution is in master branch.
2024-07-10 16:29:49 +02:00
Martin Pulec
a0fbc4e517 vcomp/cmpto_j2k: mct opt parse fix
Fixed the commit 27bfe2fc (2020-05-29) which added option nomct, but
switched the meaning of nomct and mct by mistake.
2024-06-26 16:35:53 +02:00
Martin Pulec
498fd765ee vcap/decklink: profile setting fix
Fixed the wrong condition since the commit 215ee42481 (2023-05-04) -
profile was actually not set.
2024-06-26 16:35:53 +02:00
Martin Pulec
9f52fabe76 fixed new (>0.25) gpujpeg compat
\+ use RESTART_AUTO if we have >= 0.25.3
2024-06-26 16:35:53 +02:00
Martin Pulec
67467807a3 fix repeated get_sockaddr_str calls
When get_sockaddr_str was called second time, the buffer was not cleared.

Also use snprintf to write the result in get_scoaddr_addr_str.
2024-06-26 16:35:53 +02:00
Martin Pulec
7dc235843b net: get_local_addresses - ifaddrs.ifa_addr can be NULL
The pointer ifa_addr in struct ifaddrs can be NULL and indeed it occurs
(perhaps with interfaces without assigned addrs?). Steps to reproduce:
```
uv -x sdp -t testcard -c lavc:subs=420
````
2024-06-26 16:35:53 +02:00
Martin Pulec
91fe3ac71e vdec/lavd: check_duration wrong cond
It was perhaps meant to advise frame threads if not enabled, not if
slice thread is not enabled.
2024-06-26 16:08:14 +02:00
Martin Pulec
2d5b20734b broadcast_should_exit: fixed signalling
Since the function can be called from the signal handler, there must
not be any call to signal unsafe function (see signal-safety(7)).

Actually, this is not just a fix of a possible problem but it caused
activelly problems within the reflector when 2 signals were raised one
shortly after anotner. Was stuck at following (snippet):
```
std::unique_lock<std::mutex>::unique_lock(std::mutex&) at /usr/include/c++/14.1.1/bits/unique_lock.h:74
 (inlined by) state_root::broadcast_should_exit() at /home/martin/Projects/ultragrid/src/host.cpp:533
exit_uv at /home/martin/Projects/ultragrid/src/host.cpp:587
signal_handler(int) at /home/martin/Projects/ultragrid/src/hd-rum-translator/hd-rum-translator.cpp:219
```
2024-06-26 16:08:14 +02:00
Martin Piatka
065ca274c8 hd-rum-translator: Force recompression for conference
Previously the --conference-compression parameter would only work for
automatic output ports (sending back to participants who are sending to
us), while the hosts explicitely specified on cmdline would default to
packet reflecting mode (and not receive the mixed video).
2024-06-25 13:56:12 +02:00
Martin Piatka
298b1bb819 display/conference: Fix behaviour when fps is unspecified 2024-05-31 14:43:38 +02:00
Martin Pulec
42bbc2a31f vdisp/pipe: do not announce VC_NONE support
If using transcoding reflector, eg.:
`hd-rum-transcode 8M 5004 -c libavcodec -P 6004 100:1`

pipe is used, which advertised VC_NONE, for which assertion at the
beginning of get_pixfmt_desc() failed.
2024-05-22 10:50:44 +02:00
Martin Pulec
d7e64a07af hd-rum-transcode: exit if serv sock init fails 2024-05-22 10:24:28 +02:00
Martin Pulec
ee9fe26e01 hd-rum-transcode: catch stoi invalid_argument
Make something like `hd-rum-transcode 8M 5004 -P x 100::1` fail with
humaan readable message.
2024-05-22 10:23:47 +02:00
Martin Pulec
afda0381ae deinterlace: fixed noopt config
Introduced by the commit c4aa64c8 (2024-01-13).

refers to GH-384
2024-05-22 10:10:28 +02:00
Martin Pulec
00f95eb8ef audio: unregister callback
This caused occasional crashes on M1 Mac Pro with `uv --capabilities`
(also in macos-14 arm64 GH runner). This was most likely caused by the
callback being run just after the audio state has been destroyed.
2024-05-22 09:59:18 +02:00
Martin Pulec
051047d16e added unregister_should_exit_callback
\+ unregister the callback for video_rxtx
2024-05-22 09:59:12 +02:00
Martin Pulec
fcd222f5b2 register_should_exit_callback: register directly
no noeed to pass with a message
2024-05-22 09:59:00 +02:00
Martin Pulec
e613d4bd8c vcompress/lavc: do metadata housekeeping in store
Moved metadata housekeeping to store_metadata() and removed the
assert. The idea is to prevent crashes on assert when some encode fails.

In some malicous case (eg. when the latency is higg), the metadata can be
now released prior to restoring, so print at least a warning about that.
2024-05-22 09:57:41 +02:00
Martin Pulec
5da326b10f RTP: err sending RTCP - missing NL 2024-05-22 09:56:50 +02:00
Martin Pulec
4e6625bd33 vcap/avfoundation: fixed cmdline dev spec parsing
fixed commits from 2023-01-03 (a9c001b9 and 4a915454):

1. unspecified device index is -1, not 0; this fixes run without device
spec (`-t avfoundation`)

2. device_name was not include in the condition for explicit device
selection. It coincidentally worked because of the bug nr. 1, because
the device_index was set to -1 and checked to not equal 0, which fulfills
the if condition
2024-04-29 10:43:36 +02:00
Martin Pulec
5bc00776b8 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-29 10:43:27 +02:00
Martin Pulec
4807355d1d fixed video RX port explicit setting
Fixed the commit cb0f7fea (2023-05-09) which caused that -P <vrx>:<vtx>
didn't set the video bind port.
2024-04-29 10:41:00 +02:00
Martin Pulec
1bf4146a5c disp/caca: suppress logging if output is console 2024-04-29 10:40:22 +02:00
Martin Pulec
2fb5dc80fd vcap/dshow: added mapping for H.264 2024-04-29 10:37:57 +02:00
Martin Pulec
131e858677 vdec/gpujpeg: fixed compat gpujpeg case
P012Z should not be returned in this context, anyways
2024-04-29 10:26:35 +02:00
Martin Pulec
9ad453cf78 vdec/gpujpeg: set the default GJ params (probe)
At least the struct gpujpeg_image_parameters is input/output - the
pixel_format is read from there (to evaluate if alpha formats should
be presented). So better initialize it correctly - now it perhaps doesn't
matter but to be future-proof.
2024-04-29 10:26:03 +02:00
Martin Pulec
4e0c46eb9a GPUJPEG 0.25 API compat 2024-04-29 10:23:35 +02:00
Martin Pulec
f611e9a58c disp/caca: done correctly on no poisoined pill
If no poison pill is passed (eg. some other module,init like vidcap
fails), poisoned pill is currently not passed before the done callback
is called. In case of this module it causes indefinite freeze. Moreover,
the processs cannot be killed from the command-line (neither Ctrl-C nor
Ctrl-\), because the console is "consumed" by CACA.

example of fixed command: `uv -t fail -d caca`
2024-04-29 10:22:21 +02:00
Martin Pulec
8ec4c897f6 vcap/file: fixed compat 2024-03-20 15:23:37 +01:00
Martin Pulec
0f47917883 testcard: fixed mode/size=4k
Since 61544172 (2024-10-10), _4k_ (and similar) modes were not accepted
because lacking FPS specification, which was unintended change in
that commit.
2024-03-06 10:59:23 +01:00