moved compat functions from config_*h, namely:
- localtime_s/gmtime_s
- strerror_s
- mkdir Windows compat
- removed str[n]cmp from compat/misc (already in compat/strings,h,
which is the better location)
Do not use config*.h in export.c (motivation for the above changes).
The guard value should be used only for one pair of
com_initialize/uniniialize call, so ensure it by checking if the value
is initialized to false.
It should be possible to use an int instead but there is currently
no need.
Set the occurences to false explicitly (in the case of vcap/deck change
from true to false).
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
````
ULTRAGRID_COLOR_OUT env variable didn't set the internal flag, just
caused color_output_init to return true. Rather moved the check to
separate funcction to avoid this.
Removed array template arguments deduction. Is not supported eg. by
clang 10 on macOS (Xcode 10.1) - perhaps not a big deal but the fix is
quite undemanding.
- use custom IPv6 black hole address 100::556C:7472:4772:6453 instead
of 100::1, which a user may use explicitly to signalize server mode
- check just the one address, not the black hole prefix in general
(again, the user may select the discard address intentinally without
knowing our semantics)
- removed the black hole handling functions (no longer needed)
- compute the actual in6_addr from the string with inet_pton instead of
hard coding the value
Send RTCP correctly in the server mode to a client if we have the RTCP
connection (== receiving RTCP from the client).
It is done in the same way as it is currently implemented when UG is in
receiver-only mode without explicit remote address.
- if skipped, the mediaType was not deallocated
- use own mode variable instead of 'i', because otherwise there would be holes
+ print the id, not the ordinal numeber of the mode (now it doesn't match)
- last mode must be zero (the show_help expects zero-termination) even
if there are not enough space
Actually the value MAX_PATH doesn't contain terminating NULL byte
according to the MSDN documentation for GetTempPathA. Perhaps not
a big deal but since the MAX_PATH_SIZE is generic, it is nicer to
have it correct.
Do not issue the warning over PowerShell or cmd legacy terminal emulators
in Windows 11. In Window the check doesn't work, because the process
tree is different - the Windows Terminal doesn't have its own process
and it is uv.exe->powershell.exe->exporer.exe.
This improves commit bb2a72f67f.
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).
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
- 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)
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.
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.
added resolve_fourcc to utils/string
- fixed wrong signal.h include guard (it should be definitely included
in mac, it was perhaps meant to be MSW, but it is needed there too)
- removed config*h
- do not assume in reader indices 0 for Y a 1 for Cb/Cr
- check the RTP egligibility later
- handle lavc-compressed JPEG (using only table 0) properly, not as a
hack until today