Commit Graph

8924 Commits

Author SHA1 Message Date
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
Martin Pulec
0978ea0a38 vcap/dshow: accept any codec for pos. arg
we can accept all codecs, not only BGR or YUYV/YUY2

Note that the codec is used as both streaming and grabber codecs,
the converting logic doesn't seem to have been working in the past,
although Pavel Troubil's original code had RGB fixed as the codec.

Commented out the block setting the mediaformat - now the matching format
is already set, unsure about semantic of this block.
2024-01-25 17:07:39 +01:00
Martin Pulec
b035988a64 vcap/dshow: print also captured codec 2024-01-25 17:07:39 +01:00
Martin Pulec
9faaf0ebbb vcap/dshow: respect RGB-enforcement for key=val
Respect RGB for key/value syntax as indicated in help.

This can be particularly useful when capturing eg. MJPEG, which we want
to recompress or process later.
2024-01-25 17:07:38 +01:00
Martin Pulec
e95ce6c7ab vcap/dshow: capture RGB if specified together with mode= 2024-01-25 17:07:38 +01:00
Martin Pulec
b8d52a929a vcap/dshow: set selected media type to sample grab
not ideal but at least it works (if BGR or YUYV is given)
2024-01-25 17:07:38 +01:00
Martin Pulec
c5d99199e3 dshow: print streaming format 2024-01-25 17:07:38 +01:00
Martin Pulec
8905c08278 vcap/dshow: capture BGR for unmapped codecs 2024-01-25 17:07:38 +01:00
Martin Pulec
c1c099c64a CI ARM Linux: disable INTER_LINEAR_EXACT
OpenCV in Buster (Linux armhf build) doesn't have
INTER_LINEAR_EXACT. Similarly to INTER_NEAREST_EXACT, this doesn't seem
to be necessary so enable it for now (althoug compat macros should be
possible as well).
2024-01-23 09:52:07 +01:00
Martin Pulec
560bf40488 dshow: fixed nv12->uyvy chroma convert
refers to GH-369

chroma from first row was used for every column

\+ use ptrdiff_t vars to fix a warning for narrow type multiplication
2024-01-22 16:53:33 +01:00
Martin Pulec
49ddf94410 vcap/v4l2: fixed conversion of fmt unknown to UG
The V4L2 FourCC was an invalid codec_t element and lead to crash in
get_codec_name() on that value few lines below.
2024-01-22 16:52:36 +01:00
Martin Pulec
483d21d7c1 vcap/v4l2: fail on malformed size opt
When `size=1` or `size=b` was entered, the option was silently ignored.
2024-01-22 16:52:36 +01:00
Martin Pulec
21db4b7552 v4l2: moved parsing to separate fn 2024-01-22 16:52:36 +01:00
Martin Pulec
94dff54853 V4L2: print used device path
Removed by mistake with a4d37a221b (2022-06-27) when unified 2 simillar
messages.

Use more terse message.
2024-01-22 16:52:36 +01:00
Martin Pulec
f07dc52e77 v4l2: optimize includes
do not rely on config_unix.h
2024-01-22 16:52:35 +01:00