Commit Graph

8938 Commits

Author SHA1 Message Date
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
Martin Pulec
154128a373 vcap/dshow: unified err handling + be more verbose
- handle errors with macros

- be more verbose - print error value (description if available)
2024-01-25 17:07:42 +01:00
Martin Pulec
5a4c67376b vcap/dshow: print no devices found explicitly
Instead of writting `Cannot create Video Input Device enumerator:
Operation completed` (S_FALSE), print that no devices are found explictly.
2024-01-25 17:07:41 +01:00
Martin Pulec
037d08c547 vcap/dshow: print better errmsgs from common_init
Utilize the macro to print the error description.
2024-01-25 17:07:41 +01:00
Martin Pulec
fdd4fc1283 CI macos: limit number of threads for GLFW make
Using `cmake --build . --parallel` actually doesn't limit the number
of processes because it just passes the number (here none) to make,
resulting in `make -j`.

This is a possible explanations of macOS runner freezes, as eg. here:
<https://github.com/MartinPulec/UltraGrid/actions/runs/7641831068>
(last relevant message in log is `[100%] Built target joysticks`).
2024-01-25 17:07:41 +01:00
Martin Pulec
c074bdfd41 vcap/dshow: GetSubtypeName - handle non-printable characters
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
2024-01-25 17:07:41 +01:00
Martin Pulec
f2046a2556 vcap/dshow: use GetSubtypeName
It seems like the first DWORD of subtype GUID
(mediaType->subtype.Data1[0-3]) doesn't always contain FourCC, namely for RGB types, eg.
MEDIASUBTYPE_RG24 (the others seem to be be mostly OK).
2024-01-25 17:07:41 +01:00
Martin Pulec
010dae03ad vcap/dshow: print streaming/grab type
Instead of getting full format from vidcap_dshow_get_video_desc(), which
translates the source pixel format to UG one, use the FourCC directly. Do
write just the format, the same for grabber and then the complete output
format (after eventual UG conversion). Except of the format, every other
parameters should be currently the same.

The previous approuach didn't work when there was either no VFW->UG
mapping (I420 etc.) or there  was not 1:1 mapping, eg. NV12 was displayed
as UYVY because the conversion is such, which might be misleading.
2024-01-25 17:07:40 +01:00
Martin Pulec
055c165ac0 moved i420_to_uyvy conv from dshow to video_codec
the conversion is quite generic, so provide it externally

\+ instantly use it in testcard
2024-01-25 17:07:40 +01:00
Martin Pulec
f4dedb0ffc video_codec: planar<->packed YUV use unsigned char
This requires less conversions from/to (char *).

\+ vcap/testcard: handle unsuppoted subsampling
2024-01-25 17:07:40 +01:00
Martin Pulec
44c03391ed vcap/dshow: conversion I420->UYVY 2024-01-25 17:07:40 +01:00
Martin Pulec
ba610aab1f vcap/dshow: conv also for ABGR 2024-01-25 17:07:40 +01:00
Martin Pulec
6e49c3d900 vcap/dshow: use convert callback to flip BGR lines 2024-01-25 17:07:39 +01:00
Martin Pulec
2f56acbf7a vcap/dshow: optimized including 2024-01-25 17:07:39 +01:00
Martin Pulec
783fb8a5f9 vcap/dshow: print whole grabber out command + conv
Print the grabber format + set the conversion according to that format,
not the streaming format.
2024-01-25 17:07:39 +01:00