0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00
Commit Graph

200 Commits

Author SHA1 Message Date
PatTheMav
018f52bfab cmake: Switch file system used by CPack for disk image to APFS 2022-07-31 12:21:35 +02:00
PatTheMav
c9859e5afc cmake: Add informal output of Qt version selected for current build 2022-07-30 18:04:15 +02:00
pkv
e7d097cab8
obs-ffmpeg: Native SRT/RIST for mpegts output
Currently the ffmpeg_mpegts_muxer output is integrated with ffmpeg-mux.
Both use obs native encoders in contrast with obs-ffmpeg-output which
relies on avcodec library.
This allowed easy implementation of SRT, RIST & HLS protocols through
avformat library.
The main drawback is that obs-ffmpeg-mux exe doesn't allow for easy
debugging nor logging of the protocols.
It was written initially as a separate binary designed for recording so
that if obs fails for some reason, the recording can still terminate
gracefully.

In this commit the ffmpeg_mpegts_muxer is rewritten so that a pipe to
the ffmpeg-mux binary is not used any more.
The muxing to mpegts is still delegated to avformat.
But it can be traced more easily in all its steps.
Also the protocol part for SRT & RIST is implemented natively.
Custom avio_contexts for SRT & RIST are used to that end.
This allows to pass our own implementation of librist and libsrt
libraries instead of relying on avformat. This is very advantageous :
- this allows better logging.
- this allows better bug fixing and maintainance without having to rely
on hypothetical upstream fixes.

One immediate bonus of native implementation is that fixes bugs which
were not previously fixable.

Fixes: SRT & RIST auto-reconnect partly broken  #6749
Fixes: SRT: OBS unusable and uncloseable after starting stream to
invalid srt server #5791

Signed-off-by: pkv <pkv@obsproject.com>
2022-07-30 17:03:10 +02:00
tytan652
9c85ff8673 cmake,UI: Refactor find_qt macro
If QT_VERSION is not defined, it gets define with the AUTO value. And
its definition is moved to the helper file.

find_qt now:
- Check quietly for Qt5 and Qt6
- If QT_VERSION is set to AUTO. It checks firstly if Qt5 was found it
  will use it. If not it do the same for Qt6
- If QT_VERSION is set to 5 or 6, it checks if the choice was found and
  use it. And if not, it falls back to the other if found.
- If neither Qt5 or Qt6 are found, a fatal error is emitted.
- The macro saved the _QT_VERSION in the cache to replace QT_VERSION,
  so the process is not repeated each time that find_qt is used.
- When Qt::Gui is in the Linux component list, Qt::GuiPrivate is added.
  So using the versioned one is no longer required.
2022-07-26 17:34:26 +02:00
PatTheMav
4e206896b2
cmake: Fix public header files being installed to rundir
Fixes oversight from https://github.com/obsproject/obs-studio/pull/6768
2022-07-21 22:35:09 +02:00
PatTheMav
c4f12f9055 cmake: Fix RPATH on Linux for frontend-tools to find obs-scripting
This will fix frontend-tools not being able to find the obs-scripting
library when OBS is compiled as a portable application.
2022-07-21 12:16:36 -04:00
PatTheMav
4afc2c8e6f cmake: Change desired Python3 DLL name to stable ABI variant 2022-07-21 12:16:36 -04:00
tytan652
4dd1da8a1e cmake: Add EXCLUDE_FROM_ALL to Linux install_headers
Even without it, we still need to run the following command for other
files:
`cmake --install . --component obs_libraries`
2022-07-20 15:08:30 -04:00
tytan652
2ba32763e5 cmake: Add PUBLIC_HEADER DESTINATION for development rundir
Fix a warning thrown by CMake.
2022-07-20 15:08:30 -04:00
PatTheMav
4252c8a069 cmake: Fix pkgconfig generation
Existing code didn't check for possible "empty" linked libraries
(e.g. Threads::Threads when compiler has built-in pthreads support).
Also adds support for compile options defined on linked dependencies.
2022-07-19 09:28:51 -03:00
jpark37
3f86354863 cmake: Treat warnings as errors on MSVC 2022-07-18 03:52:04 -07:00
PatTheMav
48c52c9d74 cmake: Fix libraries and header files being installed for packages
The `EXCLUDE_FROM_ALL` token, which is responsible for excluding
components from a "unspecified" installation (which we use to create
the distributed package) needs to be specified for _every_ destination
specified in an `install` call.

This commit remedies the issue of missing tokens in these calls.
2022-07-13 15:52:13 -04:00
PatTheMav
d940f21457 cmake: Fix build architectures and deployment target not set to defaults
CMake seems to set either `CMAKE_OSX_ARCHITECTURES` and
`CMAKE_OSX_DEPLOYMENT_TARGET` implicitly to empty cache variables when
not defined explicitly on the commandline or via a GUI.

Setting a default thus requires the `FORCE` flag to overwrite these
empty defaults with our desired results. The branches ensure that user-
provided non-empty values are not overwritten as well.
2022-07-06 19:19:43 +02:00
PatTheMav
04a06d10a6 cmake: Fix hardcoded SWIG_DIR path on macOS 2022-07-02 19:31:20 -04:00
PatTheMav
aec31a9e6d cmake: Fix handling of optional debug wrapper libraries for obs-browser 2022-06-20 14:24:52 -04:00
Ryan Foster
6a2e2aba03 cmake: Use correct capitalization for Qt in messages 2022-05-16 20:28:01 -04:00
Ryan Foster
872c6cd58c cmake: Normalize path to QtCore_DIR
Resolve the relative path to an absolute path once and then use that for
all other Qt file paths.
2022-05-16 20:28:01 -04:00
Ryan Foster
4d741833f8 cmake: Teach CopyMSVCBins to use Qt 5 or 6
Make CopyMSVCBins.cmake work with either Qt 5 or Qt 6 depending on what
version the user has chosen.
2022-05-16 20:28:01 -04:00
tytan652
ed486b00e1 cmake: Fix headers installation
- Headers are now installed per default on Linux.
- `obs-hevc.h` is not installed if HEVC is disabled.
- OS exclusive headers are no longer installed on the wrong OS.
2022-05-07 16:13:21 -07:00
PatTheMav
90286a537b cmake: Fix cURL library handling for updated dependencies
Soon to be updated obs-deps built on CI will retain CMake package files
created while building dependencies. When CMake uses packages, the usual
triplet of variables from finders are not set. `CopyMSVCBins` relies
on one such variable.

This PR sets the `CURL_INCLUDE_DIR` if the cURL target is present, but
apparently imported as a CMake package, to ensure prior functionality is
restored.
2022-05-03 13:57:02 -04:00
Arthus
b94e960d25 cmake: Rename variable in FindPipeWire for clarity
PIPEWIRE_DEFINITIONS contains ready-to-use compile flags. If used with
INTERFACE_COMPILE_DEFINITIONS, this can lead to a compile error.

Rename the variable to PIPEWIRE_COMPILE_FLAGS to be clear about that and
prevent accidental misuse.
2022-04-14 18:01:23 -04:00
Arthus
3dfb999c65 cmake: Fix compilation of targets using FindWayland
If WAYLAND_DEFINITIONS is set to "-I/usr/include/wayland", setting its
value as INTERFACE_COMPILE_DEFINITION leads to CMake emitting
"-D-I/usr/include/wayland" in the compiler flags. This breaks the
compilation of targets that call find_package(Wayland), such as libobs
and libobs-opengl, in gcc.

To avoid this, rename WAYLAND_DEFINITIONS to WAYLAND_COMPILE_FLAGS to
reflect that it contains ready-to-use compiler flags. Use
WAYLAND_COMPILE_FLAGS as INTERFACE_COMPILE_OPTIONS so it just gets
appended without adding the superfluous "-D".
2022-04-14 18:01:23 -04:00
PatTheMav
9c6897324a
cmake: Fixes plugins not being copied into application bundle on macOS
Makes the check for the number of plugins in the global list an explicit
length check (not relying on CMake implicit functionality), also moves
it in line with how the same was solved in `ObsHelpers.cmake` globally.
2022-04-05 11:11:14 +02:00
Zhao Zhili
255c4096a8 cmake: check empty OBS_MODULE_LIST for macOS 2022-04-02 21:46:52 +11:00
Zhao Zhili
df4315103f cmake: Fix configure error on macOS when -DENABLE_SCRIPTING=OFF 2022-04-02 21:46:52 +11:00
Patrick Heyer
3c1d7aeb86
Merge pull request #6245 from PatTheMav/cmake-resource-fix
win-capture: Fix added resources not properly copied to rundir
2022-03-31 11:52:50 +02:00
PatTheMav
d42c98fa22
win-capture: Fix added resources not properly copied to rundir
The `add_target_resource` function uses unnecessary path components
when copying files to the rundir, resulting in files added that way
not to end up where OBS expects them to.

The generated binaries created by sub-targets also need to be copied
as part of `win-capture`'s data files, which was easy to fix as the
target exists before CMake switches into the subdirectories.
2022-03-30 11:10:54 +02:00
PatTheMav
2d70650a1e
cmake: Fix usage of relative paths for CEF finder
To enable relative paths for `CEF_ROOT_DIR`, the variable needs to be
explicitly set as `PATH` type to work.
2022-03-29 10:05:17 +02:00
PatTheMav
a6532fc176 cmake: Fix obs-ffmpeg-mux missing rpath entries for libobs in build tree
When using `install`, CMake will fix up a binary's rpath entries
automatically. As `install` is also used to copy all build artifacts
into a common runtime directory, this will lead to independent binaries
such as "obs-ffmpeg-mux" to be fixed up to run within a fully portable
app bundle.

Yet during development, the app bundle is not fully portable, so rpath
entries to e.g. libobs need to be retained. Using CMake's
`install PROGRAMS` variant will achieve just that.
2022-03-28 14:54:58 -07:00
tytan652
c7bf564015 cmake: Fix dylibbundler path for case-sensitive partition 2022-03-28 13:44:10 -04:00
PatTheMav
aae3a6a466 cmake: Fix diverging prefix padding for OBS status outputs
Status output related to OBS configuration is prefixed with the string
"OBS" and added padding for enabled and disabled features. This padding
was not aligned between platforms.

By moving the padding and prefix decoration into its own function,
both elements are controlled in a single place. CMake scripts were
changed to use this new function `obs_status` instead of using CMake's
`message` function directly.
2022-03-26 09:44:23 -04:00
derrod
fd27ead2a7 cmake: Move obspython.py to Resources on macOS 2022-03-23 14:56:55 +01:00
Patrick Heyer
13f2d7925f
Merge pull request #6190 from PatTheMav/cmake-pdb-branch
CMake: Fix PDB install directory for library installation
2022-03-22 17:10:27 +01:00
PatTheMav
15b6128d09
CMake: Fix PDB install directory for library installation
obs-plugintemplate uses the `obs_libraries` component to install
obs components required for plugin development. The need of the separate
`pdbs` directory was removed a while ago (as PDB target installation
can be flagged as `OPTIONAL` and enabled for specific configurations
only). This part was overlooked in that change.
2022-03-22 15:24:49 +01:00
PatTheMav
1a7f5fb48e cmake: Fix targets not being copied into rundir on Windows and Linux
Windows and Linux do not require a contained application bundle to run
and debug OBS - as such targets can and should be copied independently
from the main OBS application target.

Also silences the output of the `install` step that sets up those files.
2022-03-21 13:18:57 -04:00
PatTheMav
8fba906be4
CI: Add necessary build system changes for universal and M1 builds 2022-03-16 23:23:40 +01:00
PatTheMav
c993b6059a
CI: Update build scripts and Github actions workflow
Also updates main CMakeLists.txt and CMakeLists.txt for unit tests,
also adds additional build directories to .gitignore file
2022-03-16 23:13:26 +01:00
PatTheMav
df94b02075
cmake: Update CMake finders and helper modules 2022-03-16 23:11:06 +01:00
Matt Gajownik
b154006c9b cmake: Add libRIST to copied Windows libs
Required for #5467 and https://github.com/obsproject/obs-deps/pull/86
2021-12-23 18:14:16 +11:00
Kurt Kartaltepe
0729007f19 libobs: Add Wayland hotkey infrastructure
Users on Wayland are displeased that they cannot see their hotkey
bindings. This enables key reporting like X11, and has the infrastructure
in place in case Wayland ever decides to allow for capturing input.
2021-12-16 10:54:29 -03:00
Carlo Castoldi
4623a6b4bc obs-ffmpeg: Set DRI devices and their name persistently
retrieving the DRI devices from /dev/dri/by-path/ instead of
/dev/dri/renderDXXX. This enable us to use lspci to get the device
name as well.
2021-12-12 11:12:36 +11:00
Paul Hindt
ce3ae8e423
aja: Capture and Output plugin for AJA Video Systems IO devices
* aja: Initial commit of AJA capture/output plugin

* aja: Fix clang-format on aja-output-ui code

* aja: Remove script used during dev/testing

* aja: Address pull request feedback from @RytoEX

* aja: Remove the SDK sources and update CMakeLists to point to new headers-only/static libs dependency distribution.

* aja: Only build AJA plugin on x64 on macOS for now

* aja: Remove the non-English placeholder locale files. The english strings/files will be produced via crowdin, according to @ddrboxman.

* aja: Add FindLibAJANTV2.cmake script to locate the ajantv2 headers and static libs in the OBS external deps package(s). Tested on Windows x64. macOS and Linux x64 TBD.

* aja: Add ajantv2/includes to FindLibAJANTV2 include search paths

* aja: Remove commented code from aja CMakeLists

* aja: Remove debug code and comments that are no longer needed.

* aja: Fix indentation

* aja: Remove disablement of clang-format in routing table and SDIWireFormat map

* aja: Use spaces for all indentation in widget crosspoint arrays where we disable clang-format

* aja: Address code style comments made by @RytoEX

* aja: Fix uneven indentation

* aja: More fixes to if/else placement and remove superfluous comments.

* aja: Rename 'dwns' to 'deactivateWhileNotShowing' for clarity. The DeckLink plugin still uses the variable name 'dwns' and should be changed, if desired, in a separate PR.

* aja: Remove X11Extras dependency from AJA Output frontend plugin

* aja: Add patch from Jim to find AJA release/debug libs

* aja: Improve AV sync of queued video/audio sent to the AJA card in the AJA Output plugin.
2021-11-23 20:31:11 -06:00
Matt Gajownik
a2c3896e1a UI: Match Windows taskbar state to tray icon
This adds a status icon for active/paused outputs.

Stripped down version of #2442
2021-11-03 09:28:41 -07:00
jp9000
442886c0aa obs-ffmpeg: Add AOM AV1 and SVT-AV1 encoders
Adds the ability to encode with software AV1 encoders within FFmpeg,
specifically AOM AV1 and SVT-AV1.
2021-10-25 12:24:16 -07:00
Kurt Kartaltepe
7384f6f061
linux-capture: Add libdrm dependency check (#5326)
We require libdrm for its header so add the cmake module and header path
to the build. We don't need to link libdrm though so we dont add it to
libraries.
2021-09-23 13:05:53 -05:00
derrod
c44e225143 cmake: Add Qt JPEG/GIF plugins to Windows libraries 2021-09-15 07:49:43 +02:00
Ryan Foster
a7eb44b337 cmake: Copy correct file for Qt imageformat plugin
During CMake configuration for 64-bit builds, CopyMSVCBins.cmake would
copy plugins/imageformats/qsvg.dll from the Qt directory to
additional_install_files/exec64r/imageformats/qsvg.dll (exec32r for
32-bit builds). However, it would copy plugins/iconengines/qsvgicond.dll
to the corresponding debug imageformats files location,
additional_install_files/exec64d/imageformats/qsvgicond.dll (or exec32d
for 32-bit). This appears to have been a simple copy-paste mistake.
Let's copy plugins/imageformats/qsvgd.dll instead.
2021-08-23 01:34:19 -04:00
Ryan Foster
ea9c75bacb cmake: Remove local files for checking threading support
These local copies of CheckForPthreads.c and FindThreads.cmake override
the ones included with CMake. These versions create CMake::Threads, but
Qt6 expects Threads::Threads created by CMake 3.1+. These local versions
seem to be based on old copies from CMake from late 2014 with some
customizations. Let's just use the built-in ones that CMake ships.

This commit also changes CMakeLists.txt files in UI and libobs to
require and link to Threads::Threads.

Co-authored-by: Kurt Kartaltepe <kkartaltepe@gmail.com>
2021-08-17 02:46:09 -07:00
Ryan Foster
ac59d51724 cmake: Fix Detours package name CMake warning
Since CMake 3.17, find_package_handle_standard_args (FPHSA) will emit a
warning if the package name in the caller and in FPHSA do not match.
This normalizes the name "Detours" in CMake calls to prevent this
warning.
2021-05-20 16:54:01 -07:00
jpark37
0c25581cd3 cmake: Add module for Detours 2021-05-17 02:28:11 -07:00