mirror of
https://gitlab.com/GloriousEggroll/obs-studio-nobara.git
synced 2025-12-10 00:00:02 -05:00
update to latest build
This commit is contained in:
@@ -1,44 +0,0 @@
|
|||||||
From 7ab23d599d91fb8ce747fda7a6392b49a04c061c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thomas Crider <gloriouseggroll@gmail.com>
|
|
||||||
Date: Mon, 1 Aug 2022 15:13:28 -0600
|
|
||||||
Subject: [PATCH] Revert "UI: Enforce Fusion Qt style on Linux"
|
|
||||||
|
|
||||||
This breaks title bar light/dark theme following, and OBS applies a custom theme anyway
|
|
||||||
|
|
||||||
This reverts commit 6d06052c51ba453b4c75a655597c97f9f55ad134.
|
|
||||||
---
|
|
||||||
UI/obs-app.cpp | 11 ++---------
|
|
||||||
1 file changed, 2 insertions(+), 9 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/UI/obs-app.cpp b/UI/obs-app.cpp
|
|
||||||
index 91a7196f8..558fc3fb1 100644
|
|
||||||
--- a/UI/obs-app.cpp
|
|
||||||
+++ b/UI/obs-app.cpp
|
|
||||||
@@ -2172,14 +2172,8 @@ static int run_program(fstream &logFile, int argc, char *argv[])
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#if !defined(_WIN32) && !defined(__APPLE__)
|
|
||||||
- /* NOTE: The Breeze Qt style plugin adds frame arround QDockWidget with
|
|
||||||
- * QPainter which can not be modifed. To avoid this the base style is
|
|
||||||
- * enforce to the Qt default style on Linux: Fusion. */
|
|
||||||
-
|
|
||||||
- setenv("QT_STYLE_OVERRIDE", "Fusion", false);
|
|
||||||
-
|
|
||||||
-#if defined(ENABLE_WAYLAND) && defined(USE_XDG)
|
|
||||||
+#if !defined(_WIN32) && !defined(__APPLE__) && defined(USE_XDG) && \
|
|
||||||
+ defined(ENABLE_WAYLAND)
|
|
||||||
/* NOTE: Qt doesn't use the Wayland platform on GNOME, so we have to
|
|
||||||
* force it using the QT_QPA_PLATFORM env var. It's still possible to
|
|
||||||
* use other QPA platforms using this env var, or the -platform command
|
|
||||||
@@ -2188,7 +2182,6 @@ static int run_program(fstream &logFile, int argc, char *argv[])
|
|
||||||
const char *session_type = getenv("XDG_SESSION_TYPE");
|
|
||||||
if (session_type && strcmp(session_type, "wayland") == 0)
|
|
||||||
setenv("QT_QPA_PLATFORM", "wayland", false);
|
|
||||||
-#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
OBSApp program(argc, argv, profilerNameStore.get());
|
|
||||||
--
|
|
||||||
2.37.1
|
|
||||||
|
|
||||||
104
0001-fix-deprecated-ftl-build-failure.patch
Normal file
104
0001-fix-deprecated-ftl-build-failure.patch
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
From adfec49922fe060d6f96bb9d8ffedc83bde58379 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Thomas Crider <gloriouseggroll@gmail.com>
|
||||||
|
Date: Fri, 19 Aug 2022 14:35:42 -0600
|
||||||
|
Subject: [PATCH] fix deprecated ftl build failure
|
||||||
|
|
||||||
|
---
|
||||||
|
plugins/obs-outputs/CMakeLists.txt | 73 ---------------------
|
||||||
|
plugins/obs-outputs/obs-outputs-config.h.in | 1 -
|
||||||
|
2 files changed, 74 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/plugins/obs-outputs/CMakeLists.txt b/plugins/obs-outputs/CMakeLists.txt
|
||||||
|
index 60bad1e93..4ce02f170 100644
|
||||||
|
--- a/plugins/obs-outputs/CMakeLists.txt
|
||||||
|
+++ b/plugins/obs-outputs/CMakeLists.txt
|
||||||
|
@@ -109,77 +109,4 @@ else()
|
||||||
|
target_compile_definitions(obs-outputs PRIVATE NO_CRYPTO)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
-find_package(PkgConfig QUIET)
|
||||||
|
-if(PKG_CONFIG_FOUND)
|
||||||
|
- pkg_check_modules(FTL QUIET libftl)
|
||||||
|
-endif()
|
||||||
|
-
|
||||||
|
-if(FTL_FOUND)
|
||||||
|
- find_package(CURL REQUIRED)
|
||||||
|
- obs_status(ENABLED "ftl outputs (system ftl-sdk)")
|
||||||
|
-
|
||||||
|
- target_sources(obs-outputs PRIVATE ftl-stream.c)
|
||||||
|
-
|
||||||
|
- target_include_directories(obs-outputs PRIVATE ${FTL_INCLUDE_DIRS})
|
||||||
|
-
|
||||||
|
- target_link_libraries(obs-outputs PRIVATE ${FTL_LIBRARIES} CURL::libcurl)
|
||||||
|
-
|
||||||
|
- target_compile_features(obs-outputs PRIVATE c_std_11)
|
||||||
|
-
|
||||||
|
- target_compile_definitions(obs-outputs PRIVATE FTL_FOUND)
|
||||||
|
-
|
||||||
|
-elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/CMakeLists.txt")
|
||||||
|
- find_package(CURL REQUIRED)
|
||||||
|
- obs_status(ENABLED "ftl ouputs (bundled ftl-sdk)")
|
||||||
|
-
|
||||||
|
- target_compile_definitions(obs-outputs PRIVATE FTL_STATIC_COMPILE)
|
||||||
|
-
|
||||||
|
- target_compile_features(obs-outputs PRIVATE c_std_11)
|
||||||
|
-
|
||||||
|
- target_link_libraries(obs-outputs PRIVATE Jansson::Jansson CURL::libcurl)
|
||||||
|
-
|
||||||
|
- target_sources(
|
||||||
|
- obs-outputs
|
||||||
|
- PRIVATE ftl-stream.c
|
||||||
|
- ftl-sdk/libftl/ftl.h
|
||||||
|
- ftl-sdk/libftl/ftl_private.h
|
||||||
|
- ftl-sdk/libftl/hmac/hmac.c
|
||||||
|
- ftl-sdk/libftl/hmac/hmac.h
|
||||||
|
- ftl-sdk/libftl/hmac/sha2.c
|
||||||
|
- ftl-sdk/libftl/hmac/sha2.h
|
||||||
|
- ftl-sdk/libftl/ftl-sdk.c
|
||||||
|
- ftl-sdk/libftl/handshake.c
|
||||||
|
- ftl-sdk/libftl/ingest.c
|
||||||
|
- ftl-sdk/libftl/ftl_helpers.c
|
||||||
|
- ftl-sdk/libftl/media.c
|
||||||
|
- ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||||
|
- ftl-sdk/libftl/logging.c)
|
||||||
|
-
|
||||||
|
- target_include_directories(obs-outputs
|
||||||
|
- PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl)
|
||||||
|
-
|
||||||
|
- if(OS_WINDOWS)
|
||||||
|
- target_sources(
|
||||||
|
- obs-outputs
|
||||||
|
- PRIVATE ftl-sdk/libftl/gettimeofday/gettimeofday.c
|
||||||
|
- ftl-sdk/libftl/gettimeofday/gettimeofday.h
|
||||||
|
- ftl-sdk/libftl/win32/socket.c
|
||||||
|
- ftl-sdk/libftl/win32/threads.c
|
||||||
|
- ftl-sdk/libftl/win32/threads.h)
|
||||||
|
-
|
||||||
|
- target_include_directories(
|
||||||
|
- obs-outputs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl/win32)
|
||||||
|
- elseif(OS_POSIX)
|
||||||
|
- target_sources(
|
||||||
|
- obs-outputs
|
||||||
|
- PRIVATE ftl-sdk/libftl/posix/socket.c ftl-sdk/libftl/posix/threads.c
|
||||||
|
- ftl-sdk/libftl/posix/threads.h)
|
||||||
|
-
|
||||||
|
- target_include_directories(
|
||||||
|
- obs-outputs PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/ftl-sdk/libftl/posix)
|
||||||
|
- endif()
|
||||||
|
-
|
||||||
|
- target_compile_definitions(obs-outputs PRIVATE FTL_FOUND)
|
||||||
|
-endif()
|
||||||
|
-
|
||||||
|
setup_plugin_target(obs-outputs)
|
||||||
|
diff --git a/plugins/obs-outputs/obs-outputs-config.h.in b/plugins/obs-outputs/obs-outputs-config.h.in
|
||||||
|
index 5677dbc3c..f322c8f1b 100644
|
||||||
|
--- a/plugins/obs-outputs/obs-outputs-config.h.in
|
||||||
|
+++ b/plugins/obs-outputs/obs-outputs-config.h.in
|
||||||
|
@@ -12,4 +12,3 @@
|
||||||
|
#define FALSE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#cmakedefine FTL_FOUND
|
||||||
|
--
|
||||||
|
2.37.2
|
||||||
|
|
||||||
40
7129.patch
Normal file
40
7129.patch
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
From ec24712c6da006eb166cb9df85df0b6c1e7ac806 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Richard Stanway <r1ch@r1ch.net>
|
||||||
|
Date: Thu, 18 Aug 2022 23:17:48 +0200
|
||||||
|
Subject: [PATCH] libobs: Initialize main_view video mix before video thread
|
||||||
|
|
||||||
|
Fixes a race condition where the video thread would exit because it sees
|
||||||
|
no active mixes, causing OBS to freeze on startup.
|
||||||
|
|
||||||
|
Fixes #7095
|
||||||
|
---
|
||||||
|
libobs/obs.c | 9 +++++----
|
||||||
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libobs/obs.c b/libobs/obs.c
|
||||||
|
index 83ef5058a663..cef1ae98e60f 100644
|
||||||
|
--- a/libobs/obs.c
|
||||||
|
+++ b/libobs/obs.c
|
||||||
|
@@ -646,6 +646,11 @@ static int obs_init_video(struct obs_video_info *ovi)
|
||||||
|
if (pthread_mutex_init(&video->mixes_mutex, NULL) < 0)
|
||||||
|
return OBS_VIDEO_FAIL;
|
||||||
|
|
||||||
|
+ video->ovi = *ovi;
|
||||||
|
+
|
||||||
|
+ if (!obs_view_add(&obs->data.main_view))
|
||||||
|
+ return OBS_VIDEO_FAIL;
|
||||||
|
+
|
||||||
|
int errorcode;
|
||||||
|
#ifdef __APPLE__
|
||||||
|
errorcode = pthread_create(&video->video_thread, NULL,
|
||||||
|
@@ -658,10 +663,6 @@ static int obs_init_video(struct obs_video_info *ovi)
|
||||||
|
return OBS_VIDEO_FAIL;
|
||||||
|
|
||||||
|
video->thread_initialized = true;
|
||||||
|
- video->ovi = *ovi;
|
||||||
|
-
|
||||||
|
- if (!obs_view_add(&obs->data.main_view))
|
||||||
|
- return OBS_VIDEO_FAIL;
|
||||||
|
|
||||||
|
return OBS_VIDEO_SUCCESS;
|
||||||
|
}
|
||||||
@@ -46,10 +46,10 @@ $ sudo dnf install mock pykickstart
|
|||||||
$ sudo usermod -a -G mock <user>
|
$ sudo usermod -a -G mock <user>
|
||||||
$ mock -r /etc/mock --init
|
$ mock -r /etc/mock --init
|
||||||
$ sudo setenforce 0
|
$ sudo setenforce 0
|
||||||
$ mock -r nobara-35-x86_64.cfg --rebuild obs-studio*.fc35.src.rpm
|
$ mock -r nobara-36-x86_64.cfg --rebuild --enable-network *.src.rpm
|
||||||
$ mv /var/lib/mock/nobara-35-x86_64/result/*.rpm /path/to/some/folder/
|
$ mv /var/lib/mock/nobara-36-x86_64/result/*.rpm /path/to/some/folder/
|
||||||
$ exit
|
$ exit
|
||||||
$ mock -r ./nobara-35-x86_64.cfg --scrub=all
|
$ mock -r ./nobara-36-x86_64.cfg --scrub=all
|
||||||
$ sudo setenforce 1
|
$ sudo setenforce 1
|
||||||
```
|
```
|
||||||
Finished! Packages will be in whatever folder you chose for /path/to/some/folder/
|
Finished! Packages will be in whatever folder you chose for /path/to/some/folder/
|
||||||
@@ -57,7 +57,7 @@ Finished! Packages will be in whatever folder you chose for /path/to/some/folder
|
|||||||
Install instructions:
|
Install instructions:
|
||||||
```
|
```
|
||||||
$ cd /path/to/some/folder/
|
$ cd /path/to/some/folder/
|
||||||
$ yum install obs-studio-27*.rpm
|
$ yum install obs-studio-2*.rpm
|
||||||
```
|
```
|
||||||
|
|
||||||
Upgrade instructions:
|
Upgrade instructions:
|
||||||
|
|||||||
Binary file not shown.
@@ -431,110 +431,6 @@ gpgcheck=0
|
|||||||
repo_gpgcheck=0
|
repo_gpgcheck=0
|
||||||
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever
|
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-$releasever
|
||||||
|
|
||||||
[nobara-base]
|
|
||||||
name=nobara-base
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/nobara/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/nobara/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-base-i386]
|
|
||||||
name=nobara-base-i386
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/nobara/fedora-$releasever-i386/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/nobara/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
|
|
||||||
[nobara-mesa-git]
|
|
||||||
name=nobara-mesa-git
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/mesa-aco/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/mesa-aco/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-mesa-git-i386]
|
|
||||||
name=nobara-mesa-git-i386
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/mesa-aco/fedora-$releasever-i386/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/mesa-aco/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
cost=1100
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-kernel-fsync]
|
|
||||||
name=nobara-kernel-fsync
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/sentry/kernel-fsync/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/sentry/kernel-fsync/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-glibc]
|
|
||||||
name=nobara-glibc
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/glibc/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/glibc/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-glibc-i386]
|
|
||||||
name=nobara-glibc-i386
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/glibc/fedora-$releasever-i386/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/glibc/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
cost=1100
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-gameutils]
|
|
||||||
name=nobara-gameutils
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/game-utils/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/game-utils/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-gameutils-i386]
|
|
||||||
name=nobara-gameutils-i386
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/game-utils/fedora-$releasever-i386/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/game-utils/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
cost=1100
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-vulkan-switcher]
|
|
||||||
name=nobara-gameutils
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/amdgpu-vulkan-switcher/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/amdgpu-vulkan-switcher/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-obs-studio]
|
[nobara-obs-studio]
|
||||||
name=nobara-obs-studio
|
name=nobara-obs-studio
|
||||||
#baseurl=https://www.nobaraproject.org/repo/fedora/$releasever/$basearch/obs-studio-nobara
|
#baseurl=https://www.nobaraproject.org/repo/fedora/$releasever/$basearch/obs-studio-nobara
|
||||||
@@ -545,45 +441,4 @@ gpgkey=https://www.nobaraproject.org/repo/nobara/pubkey.gpg
|
|||||||
repo_gpgcheck=0
|
repo_gpgcheck=0
|
||||||
enabled=1
|
enabled=1
|
||||||
enabled_metadata=1
|
enabled_metadata=1
|
||||||
|
|
||||||
[nobara-obs-studio-gamecapture]
|
|
||||||
name=nobara-obs-studio-gamecapture
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/obs-studio-gamecapture/fedora-$releasever-$basearch/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/obs-studio-gamecapture/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-obs-studio-gamecapture-i386]
|
|
||||||
name=nobara-obs-studio-gamecapture-i386
|
|
||||||
baseurl=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/obs-studio-gamecapture/fedora-$releasever-i386/
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://download.copr.fedorainfracloud.org/results/gloriouseggroll/obs-studio-gamecapture/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
cost=1100
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[nobara-custom]
|
|
||||||
name=nobara-custom
|
|
||||||
baseurl=https://www.nobaraproject.org/repo/nobara/$releasever/$basearch
|
|
||||||
#mirrorlist=https://www.nobaraproject.org/mirrorlist-nobara-custom
|
|
||||||
type=rpm-md
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://www.nobaraproject.org/repo/nobara/pubkey.gpg
|
|
||||||
repo_gpgcheck=0
|
|
||||||
enabled=1
|
|
||||||
enabled_metadata=1
|
|
||||||
|
|
||||||
[WineHQ]
|
|
||||||
name=WineHQ packages
|
|
||||||
type=rpm-md
|
|
||||||
baseurl=https://dl.winehq.org/wine-builds/fedora/36
|
|
||||||
gpgcheck=1
|
|
||||||
gpgkey=https://dl.winehq.org/wine-builds/winehq.key
|
|
||||||
enabled=1
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -7,22 +7,22 @@
|
|||||||
%global rel_build %{build_timestamp}.%{shortcommit}%{?dist}
|
%global rel_build %{build_timestamp}.%{shortcommit}%{?dist}
|
||||||
|
|
||||||
# obs version and commit
|
# obs version and commit
|
||||||
%define commit fd7c23b2003b27676e9687646ba2fd293fd44603
|
%define commit f5be6f5fdd2fe34b18518ecd38030f0768845688
|
||||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||||
|
|
||||||
Name: obs-studio
|
Name: obs-studio
|
||||||
Version: %{version_string}
|
Version: %{version_string}
|
||||||
Release: 3.%{rel_build}
|
Release: 10.%{rel_build}
|
||||||
Summary: Open Broadcaster Software Studio
|
Summary: Open Broadcaster Software Studio
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: https://obsproject.com/
|
URL: https://obsproject.com/
|
||||||
Source0: https://github.com/obsproject/obs-studio/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
Source0: https://github.com/obsproject/obs-studio/archive/%{commit}/%{name}-%{shortcommit}.tar.gz
|
||||||
Source1: https://cdn-fastly.obsproject.com/downloads/cef_binary_4638_linux64.tar.bz2
|
Source1: https://cdn-fastly.obsproject.com/downloads/cef_binary_5060_linux64.tar.bz2
|
||||||
Patch0: hevc-vaapi.patch
|
Patch0: remove-ffmpeg-vaapi.patch
|
||||||
Patch1: add-plugins.patch
|
Patch1: add-plugins.patch
|
||||||
Patch2: 6207.patch
|
Patch2: 6207.patch
|
||||||
Patch3: 0001-Revert-UI-Enforce-Fusion-Qt-style-on-Linux.patch
|
Patch3: 7129.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
BuildRequires: git
|
BuildRequires: git
|
||||||
@@ -41,7 +41,6 @@ BuildRequires: jansson-devel
|
|||||||
BuildRequires: libcurl-devel
|
BuildRequires: libcurl-devel
|
||||||
BuildRequires: libdrm-devel
|
BuildRequires: libdrm-devel
|
||||||
BuildRequires: libaom-devel
|
BuildRequires: libaom-devel
|
||||||
BuildRequires: libftl-devel
|
|
||||||
BuildRequires: libGL-devel
|
BuildRequires: libGL-devel
|
||||||
BuildRequires: libv4l-devel
|
BuildRequires: libv4l-devel
|
||||||
BuildRequires: librist-devel
|
BuildRequires: librist-devel
|
||||||
@@ -96,7 +95,7 @@ software for video recording and live streaming.
|
|||||||
|
|
||||||
%package libs
|
%package libs
|
||||||
Summary: Open Broadcaster Software Studio libraries
|
Summary: Open Broadcaster Software Studio libraries
|
||||||
%{?_qt5:Requires: %{_qt5}%{?_isa} = %{_qt5_version}}
|
%{?_qt6:Requires: %{_qt6}%{?_isa} = %{_qt6_version}}
|
||||||
|
|
||||||
%description libs
|
%description libs
|
||||||
Library files for Open Broadcaster Software
|
Library files for Open Broadcaster Software
|
||||||
@@ -122,18 +121,27 @@ sed -i 's|OBS_MULTIARCH_SUFFIX|LIB_SUFFIX|g' cmake/Modules/ObsHelpers.cmake
|
|||||||
|
|
||||||
# Prepare plugins/obs-vkcapture
|
# Prepare plugins/obs-vkcapture
|
||||||
git clone --recurse-submodules https://github.com/nowrep/obs-vkcapture plugins/obs-vkcapture
|
git clone --recurse-submodules https://github.com/nowrep/obs-vkcapture plugins/obs-vkcapture
|
||||||
|
cd plugins/obs-vkcapture
|
||||||
|
sed -i 's/install_obs_plugin_with_data/setup_plugin_target/g' CMakeLists.txt
|
||||||
|
cd ../../
|
||||||
|
|
||||||
# Prepare plugins/obs-websocket
|
# Prepare plugins/obs-websocket
|
||||||
git clone --recurse-submodules https://github.com/obsproject/obs-websocket plugins/obs-websocket
|
git clone --recurse-submodules https://github.com/obsproject/obs-websocket plugins/obs-websocket
|
||||||
|
|
||||||
# Prepare plugins/streamfx
|
# Prepare plugins/streamfx
|
||||||
git clone --recurse-submodules --depth 1 --branch 0.12.0a45 https://github.com/Xaymar/obs-StreamFX plugins/streamfx
|
git clone --recurse-submodules https://github.com/Xaymar/obs-StreamFX plugins/streamfx
|
||||||
|
cd plugins/streamfx
|
||||||
|
git checkout 1d1e646a2319d45ff84e31b1ab0da4a5395d845b
|
||||||
|
cd ../../
|
||||||
|
|
||||||
# Prepare plugins/obs-browser
|
# Prepare plugins/obs-browser
|
||||||
git clone --recurse-submodules https://github.com/obsproject/obs-browser plugins/obs-browser
|
git clone --recurse-submodules https://github.com/obsproject/obs-browser plugins/obs-browser
|
||||||
|
|
||||||
# Prepare plugins/obs-source-record
|
# Prepare plugins/obs-source-record
|
||||||
git clone --recurse-submodules https://github.com/exeldro/obs-source-record plugins/obs-source-record
|
git clone --recurse-submodules https://github.com/exeldro/obs-source-record plugins/obs-source-record
|
||||||
|
cd plugins/obs-source-record
|
||||||
|
sed -i 's/install_obs_plugin_with_data/setup_plugin_target/g' CMakeLists.txt
|
||||||
|
cd ../../
|
||||||
|
|
||||||
# Prepare CEF source for obs-browser
|
# Prepare CEF source for obs-browser
|
||||||
tar -xf %{SOURCE1} -C ../
|
tar -xf %{SOURCE1} -C ../
|
||||||
@@ -142,7 +150,7 @@ tar -xf %{SOURCE1} -C ../
|
|||||||
%build
|
%build
|
||||||
%cmake -DOBS_VERSION_OVERRIDE=%{version} \
|
%cmake -DOBS_VERSION_OVERRIDE=%{version} \
|
||||||
-DUNIX_STRUCTURE=1 -GNinja \
|
-DUNIX_STRUCTURE=1 -GNinja \
|
||||||
-DCEF_ROOT_DIR=../cef_binary_4638_linux64 \
|
-DCEF_ROOT_DIR=../cef_binary_5060_linux64 \
|
||||||
-DStreamFX_ENABLE_CLANG=OFF \
|
-DStreamFX_ENABLE_CLANG=OFF \
|
||||||
%if ! %{with lua_scripting}
|
%if ! %{with lua_scripting}
|
||||||
-DDISABLE_LUA=ON \
|
-DDISABLE_LUA=ON \
|
||||||
@@ -155,13 +163,14 @@ tar -xf %{SOURCE1} -C ../
|
|||||||
%cmake_install
|
%cmake_install
|
||||||
|
|
||||||
# Add missing files to enable the build of obs-ndi
|
# Add missing files to enable the build of obs-ndi
|
||||||
mkdir -p %{buildroot}%{_libdir}/cmake/LibObs/
|
mkdir -p %{buildroot}%{_libdir}/cmake/libobs/
|
||||||
install -Dm644 UI/obs-frontend-api/obs-frontend-api.h %{buildroot}%{_includedir}/obs/
|
install -Dm644 UI/obs-frontend-api/obs-frontend-api.h %{buildroot}%{_includedir}/obs/
|
||||||
install -Dm644 cmake/external/ObsPluginHelpers.cmake %{buildroot}%{_libdir}/cmake/LibObs/
|
install -Dm644 cmake/external/ObsPluginHelpers.cmake %{buildroot}%{_libdir}/cmake/libobs/
|
||||||
|
|
||||||
# cleanup gamecapture plugin files, we ship these in a separate package obs-studio-gamecapture to allow 32 and 64 bit versions
|
# cleanup gamecapture plugin files, we ship these in a separate package obs-studio-gamecapture to allow 32 and 64 bit versions
|
||||||
rm %{buildroot}/%{_bindir}/obs-vkcapture
|
rm %{buildroot}/%{_bindir}/obs-vkcapture
|
||||||
rm %{buildroot}/%{_bindir}/obs-glcapture
|
rm %{buildroot}/%{_bindir}/obs-glcapture
|
||||||
|
rm %{buildroot}/%{_bindir}/obs-gamecapture
|
||||||
rm %{buildroot}/%{_datadir}/vulkan/implicit_layer.d/*.json
|
rm %{buildroot}/%{_datadir}/vulkan/implicit_layer.d/*.json
|
||||||
rm %{buildroot}/%{_libdir}/libobs_glcapture.so
|
rm %{buildroot}/%{_libdir}/libobs_glcapture.so
|
||||||
rm %{buildroot}/%{_libdir}/libVkLayer_obs_vkcapture.so
|
rm %{buildroot}/%{_libdir}/libVkLayer_obs_vkcapture.so
|
||||||
@@ -188,7 +197,8 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata
|
|||||||
%{_libdir}/*.so.*
|
%{_libdir}/*.so.*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/cmake/LibObs/
|
%{_libdir}/cmake/libobs/
|
||||||
|
%{_libdir}/cmake/obs-frontend-api/
|
||||||
%{_libdir}/pkgconfig/libobs.pc
|
%{_libdir}/pkgconfig/libobs.pc
|
||||||
%{_includedir}/obs/
|
%{_includedir}/obs/
|
||||||
|
|
||||||
|
|||||||
810
remove-ffmpeg-vaapi.patch
Normal file
810
remove-ffmpeg-vaapi.patch
Normal file
@@ -0,0 +1,810 @@
|
|||||||
|
From dd40eb73326bbcf70cac226d217a91fb8dc3884d Mon Sep 17 00:00:00 2001
|
||||||
|
From: GloriousEggroll <gloriouseggroll@gmail.com>
|
||||||
|
Date: Mon, 22 Aug 2022 03:34:53 -0600
|
||||||
|
Subject: [PATCH] remove deprecated ffmpeg vaapi
|
||||||
|
|
||||||
|
---
|
||||||
|
plugins/obs-ffmpeg/CMakeLists.txt | 5 -
|
||||||
|
plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c | 730 --------------------------
|
||||||
|
plugins/obs-ffmpeg/obs-ffmpeg.c | 18 -
|
||||||
|
3 files changed, 753 deletions(-)
|
||||||
|
delete mode 100644 plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c
|
||||||
|
|
||||||
|
diff --git a/plugins/obs-ffmpeg/CMakeLists.txt b/plugins/obs-ffmpeg/CMakeLists.txt
|
||||||
|
index 98b88876d..6a3f6c14c 100644
|
||||||
|
--- a/plugins/obs-ffmpeg/CMakeLists.txt
|
||||||
|
+++ b/plugins/obs-ffmpeg/CMakeLists.txt
|
||||||
|
@@ -110,11 +110,6 @@ if(OS_WINDOWS)
|
||||||
|
target_sources(
|
||||||
|
obs-ffmpeg PRIVATE texture-amf.cpp texture-amf-opts.hpp jim-nvenc.c
|
||||||
|
jim-nvenc.h jim-nvenc-helpers.c obs-ffmpeg.rc)
|
||||||
|
-
|
||||||
|
-elseif(OS_POSIX AND NOT OS_MACOS)
|
||||||
|
- find_package(Libpci REQUIRED)
|
||||||
|
- target_sources(obs-ffmpeg PRIVATE obs-ffmpeg-vaapi.c)
|
||||||
|
- target_link_libraries(obs-ffmpeg PRIVATE LIBPCI::LIBPCI)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
setup_plugin_target(obs-ffmpeg)
|
||||||
|
diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c b/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c
|
||||||
|
deleted file mode 100644
|
||||||
|
index 53beb0f96..000000000
|
||||||
|
--- a/plugins/obs-ffmpeg/obs-ffmpeg-vaapi.c
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,730 +0,0 @@
|
||||||
|
-/******************************************************************************
|
||||||
|
- Copyright (C) 2016 by Hugh Bailey <obs.jim@gmail.com>
|
||||||
|
-
|
||||||
|
- This program is free software: you can redistribute it and/or modify
|
||||||
|
- it under the terms of the GNU General Public License as published by
|
||||||
|
- the Free Software Foundation, either version 2 of the License, or
|
||||||
|
- (at your option) any later version.
|
||||||
|
-
|
||||||
|
- This program is distributed in the hope that it will be useful,
|
||||||
|
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
- GNU General Public License for more details.
|
||||||
|
-
|
||||||
|
- You should have received a copy of the GNU General Public License
|
||||||
|
- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
-******************************************************************************/
|
||||||
|
-
|
||||||
|
-#include <libavutil/avutil.h>
|
||||||
|
-
|
||||||
|
-#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(55, 27, 100)
|
||||||
|
-
|
||||||
|
-#include <util/darray.h>
|
||||||
|
-#include <util/dstr.h>
|
||||||
|
-#include <util/base.h>
|
||||||
|
-#include <util/platform.h>
|
||||||
|
-#include <media-io/video-io.h>
|
||||||
|
-#include <obs-module.h>
|
||||||
|
-#include <obs-avc.h>
|
||||||
|
-
|
||||||
|
-#include <unistd.h>
|
||||||
|
-
|
||||||
|
-#include <libavutil/opt.h>
|
||||||
|
-#include <libavutil/pixdesc.h>
|
||||||
|
-#include <libavutil/hwcontext.h>
|
||||||
|
-#include <libavcodec/avcodec.h>
|
||||||
|
-#include <libavformat/avformat.h>
|
||||||
|
-#include <libavfilter/avfilter.h>
|
||||||
|
-
|
||||||
|
-#include <pci/pci.h>
|
||||||
|
-
|
||||||
|
-#include "obs-ffmpeg-formats.h"
|
||||||
|
-
|
||||||
|
-#define do_log(level, format, ...) \
|
||||||
|
- blog(level, "[FFMPEG VAAPI encoder: '%s'] " format, \
|
||||||
|
- obs_encoder_get_name(enc->encoder), ##__VA_ARGS__)
|
||||||
|
-
|
||||||
|
-#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||||
|
-#define info(format, ...) do_log(LOG_INFO, format, ##__VA_ARGS__)
|
||||||
|
-#define debug(format, ...) do_log(LOG_DEBUG, format, ##__VA_ARGS__)
|
||||||
|
-
|
||||||
|
-struct vaapi_encoder {
|
||||||
|
- obs_encoder_t *encoder;
|
||||||
|
-
|
||||||
|
- AVBufferRef *vadevice_ref;
|
||||||
|
- AVBufferRef *vaframes_ref;
|
||||||
|
-
|
||||||
|
- const AVCodec *vaapi;
|
||||||
|
- AVCodecContext *context;
|
||||||
|
-
|
||||||
|
- AVPacket *packet;
|
||||||
|
-
|
||||||
|
- AVFrame *vframe;
|
||||||
|
-
|
||||||
|
- DARRAY(uint8_t) buffer;
|
||||||
|
-
|
||||||
|
- uint8_t *header;
|
||||||
|
- size_t header_size;
|
||||||
|
-
|
||||||
|
- uint8_t *sei;
|
||||||
|
- size_t sei_size;
|
||||||
|
-
|
||||||
|
- int height;
|
||||||
|
- bool first_packet;
|
||||||
|
- bool initialized;
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-static const char *vaapi_getname(void *unused)
|
||||||
|
-{
|
||||||
|
- UNUSED_PARAMETER(unused);
|
||||||
|
- return "FFMPEG VAAPI H.264";
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static inline bool valid_format(enum video_format format)
|
||||||
|
-{
|
||||||
|
- return format == VIDEO_FORMAT_NV12;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void vaapi_video_info(void *data, struct video_scale_info *info)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
- enum video_format pref_format;
|
||||||
|
-
|
||||||
|
- pref_format = obs_encoder_get_preferred_video_format(enc->encoder);
|
||||||
|
-
|
||||||
|
- if (!valid_format(pref_format)) {
|
||||||
|
- pref_format = valid_format(info->format) ? info->format
|
||||||
|
- : VIDEO_FORMAT_NV12;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- info->format = pref_format;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool vaapi_init_codec(struct vaapi_encoder *enc, const char *path)
|
||||||
|
-{
|
||||||
|
- int ret;
|
||||||
|
-
|
||||||
|
- ret = av_hwdevice_ctx_create(&enc->vadevice_ref, AV_HWDEVICE_TYPE_VAAPI,
|
||||||
|
- path, NULL, 0);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("Failed to create VAAPI device context: %s",
|
||||||
|
- av_err2str(ret));
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- enc->vaframes_ref = av_hwframe_ctx_alloc(enc->vadevice_ref);
|
||||||
|
- if (!enc->vaframes_ref) {
|
||||||
|
- warn("Failed to alloc HW frames context");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- AVHWFramesContext *frames_ctx =
|
||||||
|
- (AVHWFramesContext *)enc->vaframes_ref->data;
|
||||||
|
- frames_ctx->format = AV_PIX_FMT_VAAPI;
|
||||||
|
- frames_ctx->sw_format = AV_PIX_FMT_NV12;
|
||||||
|
- frames_ctx->width = enc->context->width;
|
||||||
|
- frames_ctx->height = enc->context->height;
|
||||||
|
- frames_ctx->initial_pool_size = 20;
|
||||||
|
-
|
||||||
|
- ret = av_hwframe_ctx_init(enc->vaframes_ref);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("Failed to init HW frames context: %s", av_err2str(ret));
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* 2. Create software frame and picture */
|
||||||
|
- enc->vframe = av_frame_alloc();
|
||||||
|
- if (!enc->vframe) {
|
||||||
|
- warn("Failed to allocate video frame");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- enc->vframe->format = enc->context->pix_fmt;
|
||||||
|
- enc->vframe->width = enc->context->width;
|
||||||
|
- enc->vframe->height = enc->context->height;
|
||||||
|
- enc->vframe->colorspace = enc->context->colorspace;
|
||||||
|
- enc->vframe->color_range = enc->context->color_range;
|
||||||
|
-
|
||||||
|
- ret = av_frame_get_buffer(enc->vframe, base_get_alignment());
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("Failed to allocate vframe: %s", av_err2str(ret));
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- /* 3. set up codec */
|
||||||
|
- enc->context->pix_fmt = AV_PIX_FMT_VAAPI;
|
||||||
|
- enc->context->hw_frames_ctx = av_buffer_ref(enc->vaframes_ref);
|
||||||
|
-
|
||||||
|
- ret = avcodec_open2(enc->context, enc->vaapi, NULL);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("Failed to open VAAPI codec: %s", av_err2str(ret));
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- enc->packet = av_packet_alloc();
|
||||||
|
-
|
||||||
|
- enc->initialized = true;
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-/* "Allowed" options per Rate Control
|
||||||
|
- * See FFMPEG libavcodec/vaapi_encode.c (vaapi_encode_rc_modes)
|
||||||
|
- */
|
||||||
|
-typedef struct {
|
||||||
|
- const char *name;
|
||||||
|
- bool qp;
|
||||||
|
- bool bitrate;
|
||||||
|
- bool maxrate;
|
||||||
|
-} rc_mode_t;
|
||||||
|
-
|
||||||
|
-static const rc_mode_t *get_rc_mode(const char *name)
|
||||||
|
-{
|
||||||
|
- /* Set "allowed" options per Rate Control */
|
||||||
|
- static const rc_mode_t RC_MODES[] = {
|
||||||
|
- {.name = "CBR", .qp = false, .bitrate = true, .maxrate = false},
|
||||||
|
- {.name = "CQP", .qp = true, .bitrate = false, .maxrate = false},
|
||||||
|
- {.name = "VBR", .qp = false, .bitrate = true, .maxrate = true},
|
||||||
|
- NULL};
|
||||||
|
-
|
||||||
|
- const rc_mode_t *rc_mode = RC_MODES;
|
||||||
|
-
|
||||||
|
- while (!!rc_mode && strcmp(rc_mode->name, name) != 0)
|
||||||
|
- rc_mode++;
|
||||||
|
-
|
||||||
|
- return rc_mode ? rc_mode : RC_MODES;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool vaapi_update(void *data, obs_data_t *settings)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
-
|
||||||
|
- const char *device = obs_data_get_string(settings, "vaapi_device");
|
||||||
|
-
|
||||||
|
- const char *rate_control =
|
||||||
|
- obs_data_get_string(settings, "rate_control");
|
||||||
|
- const rc_mode_t *rc_mode = get_rc_mode(rate_control);
|
||||||
|
- bool cbr = strcmp(rc_mode->name, "CBR") == 0;
|
||||||
|
-
|
||||||
|
- int profile = (int)obs_data_get_int(settings, "profile");
|
||||||
|
- int bf = (int)obs_data_get_int(settings, "bf");
|
||||||
|
- int qp = rc_mode->qp ? (int)obs_data_get_int(settings, "qp") : 0;
|
||||||
|
-
|
||||||
|
- av_opt_set_int(enc->context->priv_data, "qp", qp, 0);
|
||||||
|
-
|
||||||
|
- int level = (int)obs_data_get_int(settings, "level");
|
||||||
|
- int bitrate = rc_mode->bitrate
|
||||||
|
- ? (int)obs_data_get_int(settings, "bitrate")
|
||||||
|
- : 0;
|
||||||
|
- int maxrate = rc_mode->maxrate
|
||||||
|
- ? (int)obs_data_get_int(settings, "maxrate")
|
||||||
|
- : 0;
|
||||||
|
- int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec");
|
||||||
|
-
|
||||||
|
- /* For Rate Control which allows maxrate, FFMPEG will give
|
||||||
|
- * an error if maxrate > bitrate. To prevent that set maxrate
|
||||||
|
- * to 0.
|
||||||
|
- * For CBR, maxrate = bitrate
|
||||||
|
- */
|
||||||
|
- if (cbr)
|
||||||
|
- maxrate = bitrate;
|
||||||
|
- else if (rc_mode->maxrate && maxrate && maxrate < bitrate)
|
||||||
|
- maxrate = 0;
|
||||||
|
-
|
||||||
|
- video_t *video = obs_encoder_video(enc->encoder);
|
||||||
|
- const struct video_output_info *voi = video_output_get_info(video);
|
||||||
|
- struct video_scale_info info;
|
||||||
|
-
|
||||||
|
- info.format = voi->format;
|
||||||
|
- info.colorspace = voi->colorspace;
|
||||||
|
- info.range = voi->range;
|
||||||
|
-
|
||||||
|
- vaapi_video_info(enc, &info);
|
||||||
|
-
|
||||||
|
- enc->context->profile = profile;
|
||||||
|
- enc->context->max_b_frames = bf;
|
||||||
|
- enc->context->level = level;
|
||||||
|
- enc->context->bit_rate = bitrate * 1000;
|
||||||
|
- enc->context->rc_max_rate = maxrate * 1000;
|
||||||
|
-
|
||||||
|
- enc->context->width = obs_encoder_get_width(enc->encoder);
|
||||||
|
- enc->context->height = obs_encoder_get_height(enc->encoder);
|
||||||
|
-
|
||||||
|
- enc->context->time_base = (AVRational){voi->fps_den, voi->fps_num};
|
||||||
|
- enc->context->pix_fmt = obs_to_ffmpeg_video_format(info.format);
|
||||||
|
- enc->context->color_range = info.range == VIDEO_RANGE_FULL
|
||||||
|
- ? AVCOL_RANGE_JPEG
|
||||||
|
- : AVCOL_RANGE_MPEG;
|
||||||
|
-
|
||||||
|
- switch (info.colorspace) {
|
||||||
|
- case VIDEO_CS_601:
|
||||||
|
- enc->context->color_trc = AVCOL_TRC_SMPTE170M;
|
||||||
|
- enc->context->color_primaries = AVCOL_PRI_SMPTE170M;
|
||||||
|
- enc->context->colorspace = AVCOL_SPC_SMPTE170M;
|
||||||
|
- break;
|
||||||
|
- case VIDEO_CS_DEFAULT:
|
||||||
|
- case VIDEO_CS_709:
|
||||||
|
- enc->context->color_trc = AVCOL_TRC_BT709;
|
||||||
|
- enc->context->color_primaries = AVCOL_PRI_BT709;
|
||||||
|
- enc->context->colorspace = AVCOL_SPC_BT709;
|
||||||
|
- break;
|
||||||
|
- case VIDEO_CS_SRGB:
|
||||||
|
- enc->context->color_trc = AVCOL_TRC_IEC61966_2_1;
|
||||||
|
- enc->context->color_primaries = AVCOL_PRI_BT709;
|
||||||
|
- enc->context->colorspace = AVCOL_SPC_BT709;
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (keyint_sec > 0) {
|
||||||
|
- enc->context->gop_size =
|
||||||
|
- keyint_sec * voi->fps_num / voi->fps_den;
|
||||||
|
- } else {
|
||||||
|
- enc->context->gop_size = 120;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- enc->height = enc->context->height;
|
||||||
|
-
|
||||||
|
- info("settings:\n"
|
||||||
|
- "\tdevice: %s\n"
|
||||||
|
- "\trate_control: %s\n"
|
||||||
|
- "\tprofile: %d\n"
|
||||||
|
- "\tlevel: %d\n"
|
||||||
|
- "\tqp: %d\n"
|
||||||
|
- "\tbitrate: %d\n"
|
||||||
|
- "\tmaxrate: %d\n"
|
||||||
|
- "\tkeyint: %d\n"
|
||||||
|
- "\twidth: %d\n"
|
||||||
|
- "\theight: %d\n"
|
||||||
|
- "\tb-frames: %d\n",
|
||||||
|
- device, rate_control, profile, level, qp, bitrate, maxrate,
|
||||||
|
- enc->context->gop_size, enc->context->width, enc->context->height,
|
||||||
|
- enc->context->max_b_frames);
|
||||||
|
-
|
||||||
|
- return vaapi_init_codec(enc, device);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static inline void flush_remaining_packets(struct vaapi_encoder *enc)
|
||||||
|
-{
|
||||||
|
- int r_pkt = 1;
|
||||||
|
-
|
||||||
|
- while (r_pkt) {
|
||||||
|
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 40, 101)
|
||||||
|
- if (avcodec_receive_packet(enc->context, enc->packet) < 0)
|
||||||
|
- break;
|
||||||
|
-#else
|
||||||
|
- if (avcodec_encode_video2(enc->context, enc->packet, NULL,
|
||||||
|
- &r_pkt) < 0)
|
||||||
|
- break;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
- if (r_pkt)
|
||||||
|
- av_packet_unref(enc->packet);
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void vaapi_destroy(void *data)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
-
|
||||||
|
- if (enc->initialized)
|
||||||
|
- flush_remaining_packets(enc);
|
||||||
|
-
|
||||||
|
- av_packet_free(&enc->packet);
|
||||||
|
- avcodec_free_context(&enc->context);
|
||||||
|
- av_frame_unref(enc->vframe);
|
||||||
|
- av_frame_free(&enc->vframe);
|
||||||
|
- av_buffer_unref(&enc->vaframes_ref);
|
||||||
|
- av_buffer_unref(&enc->vadevice_ref);
|
||||||
|
- da_free(enc->buffer);
|
||||||
|
- bfree(enc->header);
|
||||||
|
- bfree(enc->sei);
|
||||||
|
-
|
||||||
|
- bfree(enc);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void *vaapi_create(obs_data_t *settings, obs_encoder_t *encoder)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc;
|
||||||
|
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
|
||||||
|
- avcodec_register_all();
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
- enc = bzalloc(sizeof(*enc));
|
||||||
|
- enc->encoder = encoder;
|
||||||
|
-
|
||||||
|
- enc->vaapi = avcodec_find_encoder_by_name("h264_vaapi");
|
||||||
|
-
|
||||||
|
- enc->first_packet = true;
|
||||||
|
-
|
||||||
|
- blog(LOG_INFO, "---------------------------------");
|
||||||
|
-
|
||||||
|
- if (!enc->vaapi) {
|
||||||
|
- warn("Couldn't find encoder");
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- enc->context = avcodec_alloc_context3(enc->vaapi);
|
||||||
|
- if (!enc->context) {
|
||||||
|
- warn("Failed to create codec context");
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (!vaapi_update(enc, settings))
|
||||||
|
- goto fail;
|
||||||
|
-
|
||||||
|
- return enc;
|
||||||
|
-
|
||||||
|
-fail:
|
||||||
|
- vaapi_destroy(enc);
|
||||||
|
- return NULL;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static inline void copy_data(AVFrame *pic, const struct encoder_frame *frame,
|
||||||
|
- int height, enum AVPixelFormat format)
|
||||||
|
-{
|
||||||
|
- int h_chroma_shift, v_chroma_shift;
|
||||||
|
- av_pix_fmt_get_chroma_sub_sample(format, &h_chroma_shift,
|
||||||
|
- &v_chroma_shift);
|
||||||
|
- for (int plane = 0; plane < MAX_AV_PLANES; plane++) {
|
||||||
|
- if (!frame->data[plane])
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- int frame_rowsize = (int)frame->linesize[plane];
|
||||||
|
- int pic_rowsize = pic->linesize[plane];
|
||||||
|
- int bytes = frame_rowsize < pic_rowsize ? frame_rowsize
|
||||||
|
- : pic_rowsize;
|
||||||
|
- int plane_height = height >> (plane ? v_chroma_shift : 0);
|
||||||
|
-
|
||||||
|
- for (int y = 0; y < plane_height; y++) {
|
||||||
|
- int pos_frame = y * frame_rowsize;
|
||||||
|
- int pos_pic = y * pic_rowsize;
|
||||||
|
-
|
||||||
|
- memcpy(pic->data[plane] + pos_pic,
|
||||||
|
- frame->data[plane] + pos_frame, bytes);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool vaapi_encode(void *data, struct encoder_frame *frame,
|
||||||
|
- struct encoder_packet *packet, bool *received_packet)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
- AVFrame *hwframe = NULL;
|
||||||
|
- int got_packet;
|
||||||
|
- int ret;
|
||||||
|
-
|
||||||
|
- hwframe = av_frame_alloc();
|
||||||
|
- if (!hwframe) {
|
||||||
|
- warn("vaapi_encode: failed to allocate hw frame");
|
||||||
|
- return false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- ret = av_hwframe_get_buffer(enc->vaframes_ref, hwframe, 0);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("vaapi_encode: failed to get buffer for hw frame: %s",
|
||||||
|
- av_err2str(ret));
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- copy_data(enc->vframe, frame, enc->height, enc->context->pix_fmt);
|
||||||
|
-
|
||||||
|
- enc->vframe->pts = frame->pts;
|
||||||
|
- hwframe->pts = frame->pts;
|
||||||
|
- hwframe->width = enc->vframe->width;
|
||||||
|
- hwframe->height = enc->vframe->height;
|
||||||
|
-
|
||||||
|
- ret = av_hwframe_transfer_data(hwframe, enc->vframe, 0);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("vaapi_encode: failed to upload hw frame: %s",
|
||||||
|
- av_err2str(ret));
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- ret = av_frame_copy_props(hwframe, enc->vframe);
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("vaapi_encode: failed to copy props to hw frame: %s",
|
||||||
|
- av_err2str(ret));
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 40, 101)
|
||||||
|
- ret = avcodec_send_frame(enc->context, hwframe);
|
||||||
|
- if (ret == 0)
|
||||||
|
- ret = avcodec_receive_packet(enc->context, enc->packet);
|
||||||
|
-
|
||||||
|
- got_packet = (ret == 0);
|
||||||
|
-
|
||||||
|
- if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
|
||||||
|
- ret = 0;
|
||||||
|
-#else
|
||||||
|
- ret = avcodec_encode_video2(enc->context, enc->packet, hwframe,
|
||||||
|
- &got_packet);
|
||||||
|
-#endif
|
||||||
|
- if (ret < 0) {
|
||||||
|
- warn("vaapi_encode: Error encoding: %s", av_err2str(ret));
|
||||||
|
- goto fail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (got_packet && enc->packet->size) {
|
||||||
|
- if (enc->first_packet) {
|
||||||
|
- uint8_t *new_packet;
|
||||||
|
- size_t size;
|
||||||
|
-
|
||||||
|
- enc->first_packet = false;
|
||||||
|
- obs_extract_avc_headers(enc->packet->data,
|
||||||
|
- enc->packet->size, &new_packet,
|
||||||
|
- &size, &enc->header,
|
||||||
|
- &enc->header_size, &enc->sei,
|
||||||
|
- &enc->sei_size);
|
||||||
|
-
|
||||||
|
- da_copy_array(enc->buffer, new_packet, size);
|
||||||
|
- bfree(new_packet);
|
||||||
|
- } else {
|
||||||
|
- da_copy_array(enc->buffer, enc->packet->data,
|
||||||
|
- enc->packet->size);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- packet->pts = enc->packet->pts;
|
||||||
|
- packet->dts = enc->packet->dts;
|
||||||
|
- packet->data = enc->buffer.array;
|
||||||
|
- packet->size = enc->buffer.num;
|
||||||
|
- packet->type = OBS_ENCODER_VIDEO;
|
||||||
|
- packet->keyframe = obs_avc_keyframe(packet->data, packet->size);
|
||||||
|
- *received_packet = true;
|
||||||
|
- } else {
|
||||||
|
- *received_packet = false;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- av_packet_unref(enc->packet);
|
||||||
|
- av_frame_free(&hwframe);
|
||||||
|
- return true;
|
||||||
|
-
|
||||||
|
-fail:
|
||||||
|
- av_frame_free(&hwframe);
|
||||||
|
- return false;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void set_visible(obs_properties_t *ppts, const char *name, bool visible)
|
||||||
|
-{
|
||||||
|
- obs_property_t *p = obs_properties_get(ppts, name);
|
||||||
|
- obs_property_set_visible(p, visible);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static void vaapi_defaults(obs_data_t *settings)
|
||||||
|
-{
|
||||||
|
- obs_data_set_default_string(settings, "vaapi_device",
|
||||||
|
- "/dev/dri/renderD128");
|
||||||
|
- obs_data_set_default_int(settings, "profile",
|
||||||
|
- FF_PROFILE_H264_CONSTRAINED_BASELINE);
|
||||||
|
- obs_data_set_default_int(settings, "level", 40);
|
||||||
|
- obs_data_set_default_int(settings, "bitrate", 2500);
|
||||||
|
- obs_data_set_default_int(settings, "keyint_sec", 0);
|
||||||
|
- obs_data_set_default_int(settings, "bf", 0);
|
||||||
|
- obs_data_set_default_int(settings, "rendermode", 0);
|
||||||
|
- obs_data_set_default_string(settings, "rate_control", "CBR");
|
||||||
|
- obs_data_set_default_int(settings, "qp", 20);
|
||||||
|
- obs_data_set_default_int(settings, "maxrate", 0);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool rate_control_modified(obs_properties_t *ppts, obs_property_t *p,
|
||||||
|
- obs_data_t *settings)
|
||||||
|
-{
|
||||||
|
- UNUSED_PARAMETER(p);
|
||||||
|
-
|
||||||
|
- const char *rate_control =
|
||||||
|
- obs_data_get_string(settings, "rate_control");
|
||||||
|
-
|
||||||
|
- const rc_mode_t *rc_mode = get_rc_mode(rate_control);
|
||||||
|
-
|
||||||
|
- /* Set options visibility per Rate Control */
|
||||||
|
- set_visible(ppts, "qp", rc_mode->qp);
|
||||||
|
- set_visible(ppts, "bitrate", rc_mode->bitrate);
|
||||||
|
- set_visible(ppts, "maxrate", rc_mode->maxrate);
|
||||||
|
-
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool get_device_name_from_pci(struct pci_access *pacc, char *pci_slot,
|
||||||
|
- char *buf, int size)
|
||||||
|
-{
|
||||||
|
- struct pci_filter filter;
|
||||||
|
- struct pci_dev *dev;
|
||||||
|
- char *name;
|
||||||
|
-
|
||||||
|
- pci_filter_init(pacc, &filter);
|
||||||
|
- if (pci_filter_parse_slot(&filter, pci_slot))
|
||||||
|
- return false;
|
||||||
|
-
|
||||||
|
- pci_scan_bus(pacc);
|
||||||
|
- for (dev = pacc->devices; dev; dev = dev->next) {
|
||||||
|
- if (pci_filter_match(&filter, dev)) {
|
||||||
|
- pci_fill_info(dev, PCI_FILL_IDENT);
|
||||||
|
- name = pci_lookup_name(pacc, buf, size,
|
||||||
|
- PCI_LOOKUP_DEVICE,
|
||||||
|
- dev->vendor_id, dev->device_id);
|
||||||
|
- strcpy(buf, name);
|
||||||
|
- return true;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- return false;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static obs_properties_t *vaapi_properties(void *unused)
|
||||||
|
-{
|
||||||
|
- UNUSED_PARAMETER(unused);
|
||||||
|
-
|
||||||
|
- obs_properties_t *props = obs_properties_create();
|
||||||
|
- obs_property_t *list;
|
||||||
|
-
|
||||||
|
- list = obs_properties_add_list(props, "vaapi_device",
|
||||||
|
- obs_module_text("VAAPI.Device"),
|
||||||
|
- OBS_COMBO_TYPE_LIST,
|
||||||
|
- OBS_COMBO_FORMAT_STRING);
|
||||||
|
- if (os_file_exists("/dev/dri/by-path")) {
|
||||||
|
- os_dir_t *by_path_dir = os_opendir("/dev/dri/by-path");
|
||||||
|
- struct pci_access *pacc = pci_alloc();
|
||||||
|
- struct os_dirent *file;
|
||||||
|
- char namebuf[1024];
|
||||||
|
- char pci_slot[13];
|
||||||
|
- char *type;
|
||||||
|
-
|
||||||
|
- pci_init(pacc);
|
||||||
|
- while ((file = os_readdir(by_path_dir)) != NULL) {
|
||||||
|
- // file_name pattern: pci-<pci_slot::12>-<type::{"card","render"}>
|
||||||
|
- char *file_name = file->d_name;
|
||||||
|
- if (strcmp(file_name, ".") == 0 ||
|
||||||
|
- strcmp(file_name, "..") == 0)
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- char path[64] = {0};
|
||||||
|
-
|
||||||
|
- // Use the return value of snprintf to prevent truncation warning.
|
||||||
|
- int written = snprintf(path, 64, "/dev/dri/by-path/%s",
|
||||||
|
- file_name);
|
||||||
|
- if (written >= 64)
|
||||||
|
- blog(LOG_DEBUG,
|
||||||
|
- "obs-ffmpeg-vaapi: A format truncation may have occurred."
|
||||||
|
- " This can be ignored since it is quite improbable.");
|
||||||
|
-
|
||||||
|
- type = strrchr(file_name, '-');
|
||||||
|
- if (type == NULL)
|
||||||
|
- continue;
|
||||||
|
- else
|
||||||
|
- type++;
|
||||||
|
-
|
||||||
|
- if (strcmp(type, "render") == 0) {
|
||||||
|
- strncpy(pci_slot, file_name + 4, 12);
|
||||||
|
- pci_slot[12] = 0;
|
||||||
|
- bool name_found = get_device_name_from_pci(
|
||||||
|
- pacc, pci_slot, namebuf,
|
||||||
|
- sizeof(namebuf));
|
||||||
|
- if (!name_found)
|
||||||
|
- obs_property_list_add_string(list, path,
|
||||||
|
- path);
|
||||||
|
- else
|
||||||
|
- obs_property_list_add_string(
|
||||||
|
- list, namebuf, path);
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- pci_cleanup(pacc);
|
||||||
|
- os_closedir(by_path_dir);
|
||||||
|
- }
|
||||||
|
- if (obs_property_list_item_count(list) == 0) {
|
||||||
|
- char path[32] = "/dev/dri/renderD1";
|
||||||
|
- for (int i = 28;; i++) {
|
||||||
|
- sprintf(path, "/dev/dri/renderD1%d", i);
|
||||||
|
- if (access(path, F_OK) == 0) {
|
||||||
|
- char card[128] = "Card: ";
|
||||||
|
- sprintf(card, "Card%d: %s", i - 28, path);
|
||||||
|
- obs_property_list_add_string(list, card, path);
|
||||||
|
- } else {
|
||||||
|
- break;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- list = obs_properties_add_list(props, "profile",
|
||||||
|
- obs_module_text("Profile"),
|
||||||
|
- OBS_COMBO_TYPE_LIST,
|
||||||
|
- OBS_COMBO_FORMAT_INT);
|
||||||
|
- obs_property_list_add_int(list, "Constrained Baseline (default)",
|
||||||
|
- FF_PROFILE_H264_CONSTRAINED_BASELINE);
|
||||||
|
- obs_property_list_add_int(list, "Main", FF_PROFILE_H264_MAIN);
|
||||||
|
- obs_property_list_add_int(list, "High", FF_PROFILE_H264_HIGH);
|
||||||
|
-
|
||||||
|
- list = obs_properties_add_list(props, "level", obs_module_text("Level"),
|
||||||
|
- OBS_COMBO_TYPE_LIST,
|
||||||
|
- OBS_COMBO_FORMAT_INT);
|
||||||
|
- obs_property_list_add_int(list, "Auto", FF_LEVEL_UNKNOWN);
|
||||||
|
- obs_property_list_add_int(list, "3.0", 30);
|
||||||
|
- obs_property_list_add_int(list, "3.1", 31);
|
||||||
|
- obs_property_list_add_int(list, "4.0 (default) (Compatibility mode)",
|
||||||
|
- 40);
|
||||||
|
- obs_property_list_add_int(list, "4.1", 41);
|
||||||
|
- obs_property_list_add_int(list, "4.2", 42);
|
||||||
|
- obs_property_list_add_int(list, "5.0", 50);
|
||||||
|
- obs_property_list_add_int(list, "5.1", 51);
|
||||||
|
- obs_property_list_add_int(list, "5.2", 52);
|
||||||
|
-
|
||||||
|
- list = obs_properties_add_list(props, "rate_control",
|
||||||
|
- obs_module_text("RateControl"),
|
||||||
|
- OBS_COMBO_TYPE_LIST,
|
||||||
|
- OBS_COMBO_FORMAT_STRING);
|
||||||
|
- obs_property_list_add_string(list, "CBR (default)", "CBR");
|
||||||
|
- obs_property_list_add_string(list, "CQP", "CQP");
|
||||||
|
- obs_property_list_add_string(list, "VBR", "VBR");
|
||||||
|
-
|
||||||
|
- obs_property_set_modified_callback(list, rate_control_modified);
|
||||||
|
-
|
||||||
|
- obs_property_t *p;
|
||||||
|
- p = obs_properties_add_int(props, "bitrate", obs_module_text("Bitrate"),
|
||||||
|
- 0, 300000, 50);
|
||||||
|
- obs_property_int_set_suffix(p, " Kbps");
|
||||||
|
-
|
||||||
|
- p = obs_properties_add_int(
|
||||||
|
- props, "maxrate", obs_module_text("MaxBitrate"), 0, 300000, 50);
|
||||||
|
- obs_property_int_set_suffix(p, " Kbps");
|
||||||
|
-
|
||||||
|
- obs_properties_add_int(props, "qp", "QP", 0, 51, 1);
|
||||||
|
-
|
||||||
|
- p = obs_properties_add_int(props, "keyint_sec",
|
||||||
|
- obs_module_text("KeyframeIntervalSec"), 0,
|
||||||
|
- 20, 1);
|
||||||
|
- obs_property_int_set_suffix(p, " s");
|
||||||
|
-
|
||||||
|
- return props;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool vaapi_extra_data(void *data, uint8_t **extra_data, size_t *size)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
-
|
||||||
|
- *extra_data = enc->header;
|
||||||
|
- *size = enc->header_size;
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-static bool vaapi_sei_data(void *data, uint8_t **extra_data, size_t *size)
|
||||||
|
-{
|
||||||
|
- struct vaapi_encoder *enc = data;
|
||||||
|
-
|
||||||
|
- *extra_data = enc->sei;
|
||||||
|
- *size = enc->sei_size;
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-struct obs_encoder_info vaapi_encoder_info = {
|
||||||
|
- .id = "ffmpeg_vaapi",
|
||||||
|
- .type = OBS_ENCODER_VIDEO,
|
||||||
|
- .codec = "h264",
|
||||||
|
- .get_name = vaapi_getname,
|
||||||
|
- .create = vaapi_create,
|
||||||
|
- .destroy = vaapi_destroy,
|
||||||
|
- .encode = vaapi_encode,
|
||||||
|
- .get_defaults = vaapi_defaults,
|
||||||
|
- .get_properties = vaapi_properties,
|
||||||
|
- .get_extra_data = vaapi_extra_data,
|
||||||
|
- .get_sei_data = vaapi_sei_data,
|
||||||
|
- .get_video_info = vaapi_video_info,
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-#endif
|
||||||
|
diff --git a/plugins/obs-ffmpeg/obs-ffmpeg.c b/plugins/obs-ffmpeg/obs-ffmpeg.c
|
||||||
|
index 1d1131d13..189e62b0a 100644
|
||||||
|
--- a/plugins/obs-ffmpeg/obs-ffmpeg.c
|
||||||
|
+++ b/plugins/obs-ffmpeg/obs-ffmpeg.c
|
||||||
|
@@ -38,10 +38,6 @@ extern struct obs_encoder_info aom_av1_encoder_info;
|
||||||
|
#define LIBAVUTIL_VAAPI_AVAILABLE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifdef LIBAVUTIL_VAAPI_AVAILABLE
|
||||||
|
-extern struct obs_encoder_info vaapi_encoder_info;
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
#ifndef __APPLE__
|
||||||
|
|
||||||
|
static const char *nvenc_check_name = "nvenc_check";
|
||||||
|
@@ -283,14 +279,6 @@ static bool nvenc_supported(bool *out_h264, bool *out_hevc)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#ifdef LIBAVUTIL_VAAPI_AVAILABLE
|
||||||
|
-static bool vaapi_supported(void)
|
||||||
|
-{
|
||||||
|
- const AVCodec *vaenc = avcodec_find_encoder_by_name("h264_vaapi");
|
||||||
|
- return !!vaenc;
|
||||||
|
-}
|
||||||
|
-#endif
|
||||||
|
-
|
||||||
|
#ifdef _WIN32
|
||||||
|
extern void jim_nvenc_load(bool h264, bool hevc);
|
||||||
|
extern void jim_nvenc_unload(void);
|
||||||
|
@@ -360,12 +348,6 @@ bool obs_module_load(void)
|
||||||
|
amf_load();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-#if !defined(_WIN32) && defined(LIBAVUTIL_VAAPI_AVAILABLE)
|
||||||
|
- if (vaapi_supported()) {
|
||||||
|
- blog(LOG_INFO, "FFMPEG VAAPI supported");
|
||||||
|
- obs_register_encoder(&vaapi_encoder_info);
|
||||||
|
- }
|
||||||
|
-#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if ENABLE_FFMPEG_LOGGING
|
||||||
|
--
|
||||||
|
2.37.2
|
||||||
|
|
||||||
Reference in New Issue
Block a user