Commit Graph

8952 Commits

Author SHA1 Message Date
Martin Pulec
1d3ca83c3e video_rxtx/h264_rtp.cpp: deleteStream msg not proc
Fixed deleteStream message not being processed if the client doesn't
properly issue TEARDOWN on `Medium::close(instance->rtspServer);`.

(see also previous 2 commits)
2024-02-08 14:50:01 +01:00
Martin Pulec
7d62e569c6 call c_stop_server in h264_rtp_video_rxtx::join()
This eliminates sending messages to alredy unregistered audio
receiver.

Also calling the stop in this method is more suitable.
2024-02-08 14:50:00 +01:00
Martin Pulec
ace6d570c9 Revert "vrxtx/rtsp subsessions: do not send msgs on exit"
This reverts commit c3bb31928e.

Will be handled differently in next commit (server stop in join).
2024-02-08 14:49:49 +01:00
Martin Pulec
7eed598ae7 module: unread message - print mod path in verbose 2024-02-08 14:49:45 +01:00
Martin Pulec
ecdad2a74b utils/sdp: print RTP url for static PT
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).
2024-02-07 16:38:57 +01:00
Martin Pulec
1cb9d0aea1 jack sources: fixed includes+year, enum
- 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)
2024-02-07 11:31:12 +01:00
Martin Pulec
408febd8f0 JACK loader [mac]: try also lib in /usr/local
/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.
2024-02-07 10:50:43 +01:00
Martin Pulec
0241177c0e JACK loader [macOS,arm64]: try using Homebrew lib
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
2024-02-07 10:21:16 +01:00
Martin Pulec
2a32a1e365 avfoundation: replaced also other compat macros
(see previous commit description)

\+ skip config*.h inclusion

\+ include system hdrs first
2024-02-06 17:02:01 +01:00
Martin Pulec
e7f4750ea4 AVF: use __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
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
2024-02-06 16:53:24 +01:00
Martin Pulec
5a0772b400 added .github/scripts/macOS/install_others.sh
separated from prepare.sh (in a similar way as it already is for Linux)

Useful for standalone installation, eg. on development machines.
2024-02-06 16:38:45 +01:00
Martin Pulec
c4b13ba642 sign.sh: added --sign-only (and --help)
to allow notariation skipping
2024-02-06 16:15:02 +01:00
Martin Pulec
6d17c7274d gh/.github/scripts/macOS/prepare.sh: dl installers
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.
2024-02-06 13:28:27 +01:00
Martin Pulec
bba976da66 utils/sdp: fixes includes
compile failed on arm64 macOS 12&13
2024-02-06 10:33:47 +01:00
Martin Pulec
772ef5de19 utils/sdp: improved string handling
- 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)
2024-02-05 16:42:31 +01:00
Martin Pulec
6b03287fa0 utils/sdp: use CRLF
CRLF should be used in SDP (the same as for HTTP for robots.txt+security)
2024-02-05 16:37:20 +01:00
Martin Pulec
e8af3008d7 rtsp: support for mp3 - use get_audio_rtp_pt_rtpmap 2024-02-05 15:08:34 +01:00
Martin Pulec
f28371c2e0 utils/sdp: separate and export PT+rtpmap fn
Separated packet type computation + eventual rtpmap generation to a
separate function, that may be used also by RTSP.
2024-02-05 15:00:06 +01:00
Martin Pulec
0d32e24b81 audio_tx_send_standard: MP3/Opus send 1 channel
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.
2024-02-05 11:36:48 +01:00
Martin Pulec
f716083050 validate_std_audio: check also channel count for mp3 2024-02-05 10:43:50 +01:00
Martin Pulec
c64cc2df9c audio_tx_send_standard: validation to separate fn 2024-02-05 10:43:49 +01:00
Martin Pulec
731a48e94f rxtx/sdp: default to mjpeg+mp3
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.
2024-02-05 09:40:49 +01:00
Martin Pulec
fcc7190bc6 transmit: support for RFC 2550 MP3 packetization
the packet header is very simple (just fragment offset)
2024-02-05 09:40:49 +01:00
Martin Pulec
b97ee630ef transmit audio: validate Opus having 1 ch earlier
\+ fixed the message a bit not to imply that the RFC-compilant mode
itself allows only one channel, it is UG constraint.
2024-02-05 09:40:49 +01:00
Martin Pulec
0d1631299a audio: do not abort on unsupp codec for SDP
do not crash/abort on `uv -s testcard -x sdp -A mp3`
2024-02-05 09:40:48 +01:00
Martin Pulec
e872453595 rxtx/sdp: print receiver for the stream
Print explicity that the SDP served over HTTP is valid only for the
specified receiver.
2024-02-05 09:40:43 +01:00
Martin Pulec
a984d04fd2 main: fixed multiple acap dev specification
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.
2024-02-02 14:25:04 +01:00
Martin Pulec
48edc92fef disp/pipe: do removed multi source process
As stated in the commit 2ff1b2ef44, this display doesn't support/implement
this.
2024-02-02 14:25:04 +01:00
Martin Pulec
a314ec79ea disp/multiplier: do not return with abort 2024-02-02 14:25:04 +01:00
Martin Pulec
458aa0bdaa disp/multiplier: simplify - cannot receive multiple sources 2024-02-02 14:24:55 +01:00
Martin Pulec
75fb28c314 vpp/delay: limit nr of frames
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
2024-02-01 16:13:44 +01:00
Martin Pulec
69906a22bd added vpp delay
added video postprocessor delay

refers to GH-370
2024-02-01 16:13:41 +01:00
Martin Piatka
d53eb95a5b configure.ac: Check for GLM in standard include path
Looks like Arch Linux stopped providing pkg-config file for glm. Since
this is mostly a header-only library we can just check if the headers
exist.
2024-02-01 12:25:52 +01:00
Martin Pulec
b1d8555216 added dummy I420->UYVY decompress
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`
2024-01-30 14:16:17 +01:00
Martin Pulec
756d9ee42a resize_utils.cpp: return config.h
It is required in CentOS 7 the macro HAVE_OPENCV2_OPENCV_HPP to be
defined.
2024-01-30 11:31:26 +01:00
Martin Pulec
ba1f2038a5 CI: actions/cache: use main branch
see previous commit
2024-01-30 10:56:24 +01:00
Martin Pulec
9c1420ac6f CI: actions/upload-artifact skip version
fixing complains:
```
Node.js 16 actions are deprecated. Please update the
following actions to use Node.js 20: actions/cache@v3,
actions/upload-artifact@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
```

Use the main branch instead of hard-coded the version to eliminate
the needs to such small/technical fixes in future. Taken from:
<https://stackoverflow.com/questions/73256369/using-the-latest-version-of-a-github-action#73259281>
2024-01-30 10:33:51 +01:00
Martin Pulec
106bbc7e8f fixed lavd always selected
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.
2024-01-30 10:05:23 +01:00
Martin Pulec
fb919ec216 libavcodec_decompress_get_priority: symbolic names 2024-01-30 09:47:05 +01:00
Martin Pulec
bd6a20af33 lavc video: small fixes 2024-01-30 09:43:02 +01:00
Martin Pulec
e00b80133a Windows: do not issue warning if TERM is defined
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.
2024-01-29 12:01:31 +01:00
Martin Pulec
eb0f52e686 fix cycle in win_has_ancestor_process
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.
2024-01-29 12:01:29 +01:00
Martin Pulec
bb2a72f67f issue a warning in legacy W10 terminals (PS/cmd)
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.
2024-01-29 12:00:44 +01:00
Martin Pulec
7393a244f8 CI: fixed checkout@v3 deprecation
"Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/checkout@v3. For more information see:
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/."
2024-01-25 17:07:43 +01:00
Martin Pulec
111a3a6911 CI Linux FFmpeg: updated libde265 patch
ceased to apply with FFmpeg master
2024-01-25 17:07:43 +01:00
Martin Pulec
89c01b0c7e Revert "CI: SVT-HEVC patch temporary workaround"
This reverts commit 354d169e29.

no longer needed, the patch has been updated in upstream
2024-01-25 17:07:43 +01:00
Martin Pulec
9ec041255a gh/scripts/install-common-deps.sh: improve sudo compat
simplified when sudo is not used (MSW or with root) by creating empty
alias and call it as usual.
2024-01-25 17:07:42 +01:00
Martin Pulec
be84cf8ab0 CI: limit CMake build with logical cores
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.
2024-01-25 17:07:42 +01:00
Martin Pulec
f7e042bceb updated NEWS: DShow 2024-01-25 17:07:42 +01:00
Martin Pulec
aa520475db vcap/dshow: make HANDLE_ERR compatible
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
2024-01-25 17:07:42 +01:00