Fixed deleteStream message not being processed if the client doesn't
properly issue TEARDOWN on `Medium::close(instance->rtspServer);`.
(see also previous 2 commits)
Print RTP URLs for statically mapped packet types that do not require
SDP description.
It seems like just ffplay is capable to handle the stream(s), mpv and
vlc doesn't (vlc supports at least audio).
- removed config*.h (not needed)
- moved system headers prior user-defined
- fixed copyright year to 2024
- replaced numeric macros with enum (cppcoreguidelines-macro-to-enum)
/usr/local/lib is default location for Homebrew on Intel macs, which is,
however, searched by default. So it is actually not needed on Intels.
It is, however, also the path of the JACK library installed by the
official installer, which uses the universal binary (there is Intel-only
installer, too). With that universal library, the x86_64 build using
Rosetta2 will work with JACK also on ARM64 macs.
On ARM64 macs, the loader refuses to load the library installed with
Homebrew in /opt/homebrew/lib, even when added to DYLD_LIBRARY_PATH. Error
message is:
```
JACK library "libjack.dylib" opening failed: dlopen(libjack.dylib,
0x0002): tried: 'libjack.dylib' (relative path not allowed in hardened
program), '/System/Volumes/Preboot/Cryptexes/OSlibjack.dylib' (no such
file), '/Volumes/ULTRAGRID/uv-qt.app/Contents/libs/libjack.dylib' (no
such file), '/Volumes/ULTRAGRID/uv-qt.app/Contents/libs/libjack.dylib'
(no such file), '/usr/lib/libjack.dylib' (no such file, not in dyld
cache), 'libjack.dylib' (relative path not allowed in hardened program)
```
As a solution, the absolute path `/opt/homebrew/lib/libjack.dylib`
is loaded.
Other changes:
- try array of candidate JACK library paths
- increased STR_LEN to 2048 - for the error messages from the JACK, 1024
could be too little (errs stored and printed only if no library usable)
- MOD_NAME defined in the header, so that MOD_NAME cannot be defined in
the source prior include; undefined at the end of the header
This macro is actually the deployment target, eg with current XCode on
macOS 13, the compilation gives this warnings:
```
src/video_capture/avfoundation.mm:142:25: warning: 'AVCaptureDeviceTypeExternal' is only available on macOS 14.0 or newer [-Wunguarded-av
ailability-new]
AVCaptureDeviceTypeExternal DESK_VIEW_IF_DEFINED
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/AVFoundation.fra
mework/Headers/AVCaptureDevice.h:448:38: note: 'AVCaptureDeviceTypeExternal' has been marked as being introduced in macOS 14.0 here, but
the deployment target is macOS 13.0.0
AVF_EXPORT AVCaptureDeviceType const AVCaptureDeviceTypeExternal API_AVAILABLE(macos(14.0), ios(17.0), macCatalyst(17.0), tvos(17.0)) API
_UNAVAILABLE(watchos) API_UNAVAILABLE(visionos);
^
src/video_capture/avfoundation.mm:142:25: note: enclose 'AVCaptureDeviceTypeExternal' in an @available check to silence this warning
AVCaptureDeviceTypeExternal DESK_VIEW_IF_DEFINED
```
see also commit 7780fa8a
Download installers if not present. They usually are, because are cached
by the workflow. However, this change is mainly to allow the installation
not by CI but on some local computer for debugging purposes by C&P.
- use snprintf instead of strncat (better behavior - always appends \0 and
no need to subtract 1 from len /and expecting that there is \0 at the end)
- use actual string length with sizeof than STR_LEN (which may get
removed because it is misleading in respect to global STR_LENi value)
Send only one channel in RFC-compliant mode even if there are more,
just print an error.
The point is that even though the default audio capture channel count
is 1, some devices may not support mono (eg. DeckLink) and produce more
channels (usually 2) anyways.
Those doesn't need to be signalized in any way (PT is defined), so that
the receiver can play the streams directly without SDP - eg. `ffplay
rtp://[::1]:5004` (and similarly on port 5006).
MP3 (just added std TX) is set as default for RTSP as well - perhaps
not a big difference if MP3 or Opus so we do not need to handle two
cases. Also MP3 could be more compatible.
The condition was written incorrectly, because it disallows only
combination of video-attached and standalone audio drivers but allowed
2 audio standalone drivers, which is unsupported as well.
added a limit to number of frames/seconds that can be cached
The user may enter some huge value by mistake and since FHD UYVY frame
takes 4M, it can exhaust the memory quite quickly. So the limit is set
to 2000 frames or 60 sec, which is in the case of 30p video up to 8 GB
of memory.
\+ print the user selection to console
As there is no line decoder for I420, because it is a planar format,
added regular decompress to be able to display simple uncompressed I420
as in the this command: `uv -t testcard:c=I420 -d gl`
Fixes the commit b62566ca72 (2th Oct 2023), which caused that lavd was
always selected as the decoder, even though not designated. Eg.:
```
$ uv -t testcard:codec=I420 -d gl
Decompressor "libavcodec" initialized successfully.
[lavd] Unsupported codec!!!
```
The problem was that on probe ugc==VC_NONE and HW acceleration is not
set, thus hw_accel_to_ug_pixfmt(0) return also VC_NONE, in which case
the decoder is unconditionally selected for all formats.
Although there is cmd/PS in process tree, it may be used just like shell
(eg. when run over SSH) so that the terminal may be eg. some Linux
terminal emulator.
In W11, there is a cycle between processes services.exe and wininit.exe:
```
[utils/win] have_ancestor: services.exe PID: 788, PPID: 892
[utils/win] have_ancestor: wininit.exe PID: 892, PPID: 788
```
which caused infinite cycle between these 2 processes.
Those terminal emulators block stdout/stderr output when scrolled,
which effectively stops UltraGrid. The behavior doesn't occur in MS
Terminal app, which is encouraged instead.
Note that Windows Terminal still runs cmd.exe or powershell.exe as a shell
while the cmd/PS process can acts like both terminal emulator and
shell. We also do not trigger the warning if UG is run from within
MSYS2 terminal.
This fixes all occurences of `cmake --build` as it already was in one
case with commit HEAD~7.
If omitted, CMake leaves the number of processes used on underlying
implementation, which turns out to `make -j`, thus unlimited number of
cores, which is undesirable.
use same syntax for all HANDLE_ERR definitions
\+ pass the function name in the definition (might be __func__ directly
in HANDLE_ERR_ACTION in future)
\+ do not use 'do {} while(0)' pattern as it consumes `continue`, use
if-else instead