aboutsummaryrefslogtreecommitdiff
path: root/src/capture/nvfbc.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-31 03:17:18 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-31 03:17:18 +0200
commitb7c5df3c4bbd30bbca91f6e9bdb2bf4d606c46f5 (patch)
treed298e07263dc3c71e2be1873ce36acbbb37267de /src/capture/nvfbc.c
parentb99539af570cc725ca3881dfbb2ed9e6b202e2f6 (diff)
Faster startup (faster video codec query), fix some video codec callback logic
Diffstat (limited to 'src/capture/nvfbc.c')
-rw-r--r--src/capture/nvfbc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c
index 1944dcc..80fbaa8 100644
--- a/src/capture/nvfbc.c
+++ b/src/capture/nvfbc.c
@@ -1,6 +1,5 @@
#include "../../include/capture/nvfbc.h"
#include "../../external/NvFBC.h"
-#include "../../include/cuda.h"
#include "../../include/egl.h"
#include "../../include/utils.h"
#include "../../include/color_conversion.h"
@@ -24,7 +23,6 @@ typedef struct {
bool fbc_handle_created;
bool capture_session_created;
- gsr_cuda cuda;
NVFBC_TOGL_SETUP_PARAMS setup_params;
bool supports_direct_cursor;
@@ -290,7 +288,6 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *cap_nvfbc) {
static void gsr_capture_nvfbc_stop(gsr_capture_nvfbc *cap_nvfbc) {
gsr_capture_nvfbc_destroy_session_and_handle(cap_nvfbc);
- gsr_cuda_unload(&cap_nvfbc->cuda);
if(cap_nvfbc->library) {
dlclose(cap_nvfbc->library);
cap_nvfbc->library = NULL;
@@ -304,15 +301,8 @@ static void gsr_capture_nvfbc_stop(gsr_capture_nvfbc *cap_nvfbc) {
static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec_context, AVFrame *frame) {
gsr_capture_nvfbc *cap_nvfbc = cap->priv;
- if(!cap_nvfbc->params.use_software_video_encoder) {
- if(!gsr_cuda_load(&cap_nvfbc->cuda, cap_nvfbc->params.egl->x11.dpy, cap_nvfbc->params.overclock))
- return -1;
- }
-
- if(!gsr_capture_nvfbc_load_library(cap)) {
- gsr_cuda_unload(&cap_nvfbc->cuda);
+ if(!gsr_capture_nvfbc_load_library(cap))
return -1;
- }
cap_nvfbc->x = max_int(cap_nvfbc->params.pos.x, 0);
cap_nvfbc->y = max_int(cap_nvfbc->params.pos.y, 0);