Commit Graph

775 Commits

Author SHA1 Message Date
Martin Pulec
2f9730b66f configure.ac: fix EOL garbage
Added accidentaly by the commit 73572e77 (2024-03-05). Effective only
if --with-cuda option used but without any implications - just `/FOUN:
not found` printed, but processed normally.
2024-10-30 11:47:39 +01:00
Martin Pulec
c96a167d08 configure.ac: check the header in MSW as well 2024-10-11 14:36:39 +02:00
Martin Pulec
7db0b8dfc9 added matrix2 capf/vopp
Matrix (1) doesn't seem to be generic enough in case of UYVY.

THe aim is, among others, last resort fix of the BT.601 problem when
got from QSV compression and no YCbCr->RGB conversion took place.
2024-10-03 15:13:35 +02:00
Martin Pulec
69523f960e configure.ac: cmpto_j2k - add cudart if used
add -lcudart to the libs if CUDA is used for the conversions
2024-09-18 16:22:24 +02:00
Martin Pulec
7b70622b2a configure.ac: disable screen cap in macOS 15
macOS 15 drops support for the API we used for the screen capture in
favor of ScreenCaptureKit, the error is:
```
src/video_capture/screen_osx.c:109:28: error: 'CGDisplayCreateImage'
is unavailable: obsoleted in macOS 15.0 - Please use ScreenCaptureKit
instead.
  109 |         CGImageRef image = CGDisplayCreateImage(s->display);
      |                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h:383:33:
note: 'CGDisplayCreateImage' has been explicitly marked unavailable here
  383 | CG_EXTERN CGImageRef __nullable
  CGDisplayCreateImage(CGDirectDisplayID displayID)
```
2024-09-18 16:03:49 +02:00
Martin Pulec
58aad91adf configure.ac: pkgconf compat improved
pkg.m4 macro from pkgconf since 2.3.0 aborts by default if PKG_CONFIG
is not found, which check implicitly for pkg-config. Thus set
ACTION-IF-NOT-FOUND to allow fallback check for pkgconf.
2024-09-18 16:03:47 +02:00
Martin Pulec
34b6ffbaa7 configure.ac: lavc cuda conv check improvement
- assume the feature, not cuda, when ensuring
- improved the message what can be wrong
2024-09-12 16:35:57 +02:00
Martin Pulec
47c13e3968 configure: add kernels to vcomp/cmpto_j2k as well
refers to GH-406
2024-09-06 11:21:20 +02:00
Martin Pulec
4f3add780d vdec/cmpto_j2k: use kernel for ->R12L conversion
refers to GH-406
2024-08-28 13:29:36 +02:00
Martin Pulec
0bb082d020 configure.ac: no CUDA-accel FF convs with CUDA<9
Disable CUDA-accelerated FFmpeg conversions with CUDA 8 and earlier. At
least in Linux, it requires gcc-5, which is now hardly compatible. (The
actual compatibility was not tested thoroughly because CUDA 8 is
unsupported.)

see also the commit 4581c7f4
2024-08-22 11:42:23 +02:00
Martin Pulec
1502c100d9 Revert "configure.ac: remove cuda version check"
This reverts commit cdc8886bb3.
2024-08-22 11:42:23 +02:00
Martin Pulec
0092d0cc3a windows: print stacktrace in crash handler
added print_stacktrace_win

similarly to other platforms
2024-08-16 16:05:05 +02:00
Martin Pulec
f4bebb27b0 configure: ENSURE_FEATURE_PRESENT more generic
handle all values except of "no" and "auto" as required (eg. for
`--enable-ssl=wolfssl`)
2024-08-06 15:06:28 +02:00
Martin Pulec
b506f66d62 vcap/rtsp: support JPEG
- added RFC 2435 JPEG decoder
- added JPEG interchange format writer (JFIF in particular)

Decode RFC encoded JPEG (abbreviated) and create a JFIF, which can be then
passed to further processing (decode in the end).

The testing JPEG stream played with bluenviron/mediamtx as defined in the
beginning of video_capture/rtsp.c can be now sucessfully played.
2024-08-02 15:52:55 +02:00
Martin Pulec
9982928410 configure: do not add CUDA_LIB immediately to LIBS
see the commit 085b6e60 (today)

autoconf generally dislikes spaces inside paths, which is true for CUDA
in MSW (path to CUDA libs is something like `-L"/c/Program Files/NVIDIA
GPU Computing Toolkit/CUDA/v11.8/lib"`), so do not use it for tests but
add it just when linking.
2024-07-29 12:28:12 +02:00
Martin Pulec
a95f842a78 Windows build with CUDA: prepend compiler lib path
Prepend compiler default lib path (usually something like
`-LC:/tools/msys64/clang64/bin/../lib`) to avoid erors like:

    Linking bin/uv.exe...
    ld.lld: error: duplicate symbol: atexit
    >>> defined at C:/M/B/src/mingw-w64/mingw-w64-crt/crt/crtexe.c:336
    >>>            C:/msys64/clang64/lib/crt2.o
    >>> defined at msvcrt.lib(utility.obj)
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [Makefile:241: bin/uv.exe] Error 1

(reproducible with `./configure --disable-all --enable-cuda`; the
problem is superseded if libavcodec is present, which already does it)

The problem was caused by the fact that MSVC library path is added to
add libmsvcprt.a and libOLDNAMES.a needed by MS C++ STL library that is
needed for CUDA (see the commit b6a45bd5 from 2024-03-27) to support C++
code in CUDA sources (currently lavc cuda convs). As we compile with
Mingw-w64 toolkit, the MinGW lib wrappers need to be used. The error
w/o MS STL library is:

    Linking bin/uv.exe...
    ld.lld: error: could not open 'libmsvcprt.a': No such file or directory
    ld.lld: error: could not open 'libOLDNAMES.a': No such file or directory
    c++: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [Makefile:241: bin/uv.exe] Error 1
2024-07-29 11:47:39 +02:00
Martin Pulec
085b6e60a4 configure [Win]: add CUDA_LIB to LIBS
Add CUDA_LIB to LIBS unconditionally as it is already done for other
platforms except Win.

In Windows, the CUDA wrapper was built outside UltraGrid (as a DLL) but this
is no longer true since the commit a4c22c93f (2024-03-05) so if there is no
CUDA features but still CUDA enabled (as with `--disable-all --enable-cuda`),
the libs were not added for the cuda_wrapper.
2024-07-29 08:44:33 +02:00
Martin Pulec
7ab6fabce5 configure.ac: fixed empty var req_files
if `--disable-all` is used, the variable `req_files` remains empty (if none
enabled explicitly), resuting in error:
```
./configure: line 17483: test: =: unary operator expected
```

Non-fatal - the configure script is not run with `set -e`, so technically
this should not have caused problems except the error message.
2024-07-29 08:28:50 +02:00
Martin Pulec
a10374476c configure: lavc conv cuda Win: check for INCLUDE header
Check for $INCLUDE var non-zero - should contain headers for FFmpeg stuff.
2024-07-25 15:01:59 +02:00
Martin Pulec
3505190db9 configure: lavc_vid_conv_cuda: fixed buggy test
the buggy test probably caused the code never used
2024-07-25 09:53:54 +02:00
Martin Pulec
b2f89d63fc configure: accept CUDA_PATH
Although CUDA_PATH is advertised by help, it is actually immediately overriden
with the content of CUDA_DIRECTORY env var even if unset/empty.

From now, only override it only when CUDA_DIRECTORY is set and not empty (compat).
2024-07-25 09:35:25 +02:00
Martin Pulec
8adb8f2c50 current live555 compat 2024-07-19 12:01:52 +02:00
Martin Piatka
97c51cd415 configure.ac: Add audio remap filter 2024-07-15 16:13:25 +02:00
Martin Pulec
be8ef1c9d9 configure: summary - in-sort DRM, Pipewire 2024-06-26 10:52:45 +02:00
Martin Pulec
154cf15a04 configure: print presence of sdl[2]_ttf 2024-06-26 10:26:22 +02:00
Martin Pulec
924cb7d0fa configure: fixed drm help string 2024-06-06 11:06:39 +02:00
Martin Pulec
d651d2ccc5 drop support for gpujpeg < 0.14 2024-06-05 09:36:51 +02:00
Martin Pulec
234c4edc7d configure: remove old ntv2 compat
[ntv2] is no longer being updated and there is perhaps no point keeping
the support for it.

[ntv2]: https://github.com/aja-video/ntv2/
2024-05-31 16:04:45 +02:00
Martin Pulec
a439cce21d configure.ac: support for libajantv2 [mac] 2024-05-31 16:04:44 +02:00
Martin Pulec
436551d6ec configure: libajantv2 - try hard-coded hdrs path
Try hard-coded path /usr/include/libajantv2 (as in libajantv2 AUR package)
for the headers.

Also try /usr/local/include/libajantv2 before that (default installation
prefix).

Note that the actual headers' are not checked for now, just the directory
presence.
2024-05-31 16:04:43 +02:00
Martin Pulec
494ec080c8 support for libajantv2 [Linux]
- the lib must be in a system path
- AJA_DIRECTORY still needs to be set for the headers

[libajantv2] replaces the original [ntv2]

[libajantv2]: https://github.com/aja-video/libajantv2
[ntv2] https://github.com/aja-video/ntv2
2024-05-31 16:04:43 +02:00
Martin Pulec
f466b9987f configure.ac: removed AJA compat
it has been added a while ago - no longer needed
2024-05-31 16:04:42 +02:00
Martin Piatka
8a76432548 configure.ac: Add DRM display build configuration 2024-05-17 13:20:06 +02:00
Martin Piatka
f46a101cba configure.ac: Enable 64 bit off_t on 32 bit systems
Needed for the DRM display on 32 bit systems (when mmaping framebuffers)
2024-05-17 13:20:05 +02:00
Martin Pulec
83d5a90b5b configure.ac: added all to --enable-object
The options cannot be repeated for configure, like
`--enable-object=a --enable-object=b` to enable both a and b
(`--enable-object=a,b` is needed). This may be sometimes impractical,
when the command-line args are appended incrementally.

As a workaround, at least `--enable-output=all` is added. As it is not
a solution, it still (with `--disable-all`) removes most unneeded code
(with dependencies), while compiling all the non-essential objs without
deps.
2024-05-16 10:55:25 +02:00
Martin Pulec
226c17f02d replace all other AC-defined platform macro
Replaced all other autoconf-defined platform macros (HAVE_LINUX and
HAVE_MACOSX, WIN32 already done) with those ones defined by compiler.

Not yet remove the definitions from autoconf, in case someone will use
the old macros anyways. Remove in future.
2024-05-13 12:56:53 +02:00
Martin Pulec
4581c7f4f7 configure.ac: disable CUDA-accelerated FFmpeg convs on macOS
Support for CUDA on macOS is just legacy and the stuff won't compile
(C++ interferes with lavc headers with the old compiler - tested with
CUDA 10.2 on macOS 10.13, which should be the last compatible).
2024-05-02 11:25:54 +02:00
Martin Pulec
1a349167d3 configure.ac: do not pass -d2FH4- to cl if unsupp
compat with older MSVS
2024-04-09 15:06:34 +02:00
Martin Pulec
e417d0963f configure.ac: older MSVS compat [CUDA] 2024-04-09 14:56:09 +02:00
Martin Pulec
8408f64a69 Windows CUDA: link libraries rather dynamically
there are still errors like:
```
ld.lld: error: undefined symbol: __std_terminate
>>> referenced by libcpmt.lib(cout.obj):($stateUnwindMap$?_Init@ios_base@std@@IEAAXXZ)
>>> referenced by libcpmt.lib(cout.obj):($stateUnwindMap$??_Gios_base@std@@UEAAPEAXI@Z)
>>> referenced by libcpmt.lib(cout.obj):($stateUnwindMap$??1?$basic_ios@DU?$char_traits@D@std@@@std@@UEAA@XZ)
>>> referenced 12 more times

ld.lld: error: undefined symbol: __CxxFrameHandler4
>>> referenced by libcpmt.lib(cout.obj):($unwind$??0_Locinfo@std@@QEAA@PEBD@Z)
>>> referenced by libcpmt.lib(cout.obj):($unwind$??1_Locinfo@std@@QEAA@XZ)
>>> referenced by libcpmt.lib(cout.obj):($unwind$??0locale@std@@QEAA@XZ)
>>> referenced 140 more times
```

with some code
2024-03-27 16:13:43 +01:00
Martin Pulec
40a4e51e41 Windows CUDA: avoid unresolved external symbol __CxxFrameHandler4 2024-03-27 15:23:24 +01:00
Martin Pulec
b6a45bd509 CI Windows CUDA: do not use /nodefaultlib
If C++ STL is used in CUDA host code, we need the Windows C++ STL library
CPMT [1], which is linked automatically if located by the linker.

[1]: <https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170#c-standard-library-stl-lib-files>
2024-03-27 15:23:17 +01:00
Martin Pulec
a66ee61564 Windows CUDA compilation fixes 2024-03-22 09:17:53 +01:00
Martin Pulec
ff2b2c83c0 Makefile: added lavc cflags to CUDA_FLAGS
- needed when not in standard paths for cuda lavc conversions
- do not include in Windows, since it just contains -I/clang64/include,
which interfers with MSVC headers and prevent compilation
2024-03-20 14:16:09 +01:00
Martin Pulec
673b497d34 configure: added option to disable lavc CUDA convs 2024-03-20 14:15:38 +01:00
Martin Pulec
cc578de28a configure.ac: add -FS to CUDA_FLAGS in MSW
Parallel CUDA compilation triggers error C1041 in Windows (CUDA 12.3i,
MSVS 2022).
2024-03-08 16:11:48 +01:00
Martin Pulec
a4c22c93fa build: link Window CUDA code directly
The workaround with linked DLLs is no longer required!
2024-03-08 16:11:47 +01:00
Martin Pulec
73572e774e configure.ac: removed DEFINE_CUDA, CUDA_MESSAGE
Not necessary, if CUDA is enabled, call the code unconditionally.

More importantly, it doesn't cause discrepancies when DEFINE_CUDA is forgotten.
2024-03-08 16:11:46 +01:00
Martin Pulec
cdc8886bb3 configure.ac: remove cuda version check
not needed for anything now
2024-03-08 16:11:46 +01:00
Martin Pulec
1825e6a0da added API for from_lavc_vid_conv_cuda
not yet used
2024-03-08 16:11:46 +01:00