diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-26 16:41:55 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-26 16:41:55 +0200 |
commit | 97998f1bab12380b28dd5d97eef4532930ecdd93 (patch) | |
tree | 0e9533e9b65551ffc1427e95e889bc253950e8d9 /src | |
parent | 1aaa26d87e539c1f3cef2052f6f47960f7d2c303 (diff) |
temp debug output
Diffstat (limited to 'src')
-rw-r--r-- | src/capture/nvfbc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c index ee77a20..f48a110 100644 --- a/src/capture/nvfbc.c +++ b/src/capture/nvfbc.c @@ -189,6 +189,8 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) { create_params.glxCtx = self->params.egl->glx_context; create_params.glxFBConfig = self->params.egl->glx_fb_config; + fprintf(stderr, "glx ctx: %p, glxfb config: %p\n", create_params.glxCtx, create_params.glxFBConfig); + status = self->nv_fbc_function_list.nvFBCCreateHandle(&self->nv_fbc_handle, &create_params); if(status != NVFBC_SUCCESS) { // Reverse engineering for interoperability @@ -204,6 +206,8 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) { } self->fbc_handle_created = true; + fprintf(stderr, "nvfbc 2\n"); + NVFBC_GET_STATUS_PARAMS status_params; memset(&status_params, 0, sizeof(status_params)); status_params.dwVersion = NVFBC_GET_STATUS_PARAMS_VER; @@ -214,6 +218,8 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) { goto error_cleanup; } + fprintf(stderr, "nvfbc 3\n"); + if(status_params.bCanCreateNow == NVFBC_FALSE) { fprintf(stderr, "gsr error: gsr_capture_nvfbc_start failed: it's not possible to create a capture session on this system\n"); goto error_cleanup; @@ -265,6 +271,8 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) { if(self->tracking_type == NVFBC_TRACKING_OUTPUT) create_capture_params.dwOutputId = self->output_id; + fprintf(stderr, "nvfbc 4\n"); + NVFBCSTATUS status = self->nv_fbc_function_list.nvFBCCreateCaptureSession(self->nv_fbc_handle, &create_capture_params); if(status != NVFBC_SUCCESS) { fprintf(stderr, "gsr error: gsr_capture_nvfbc_start failed: %s\n", self->nv_fbc_function_list.nvFBCGetLastErrorStr(self->nv_fbc_handle)); @@ -272,6 +280,8 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) { } self->capture_session_created = true; + fprintf(stderr, "nvfbc 5\n"); + memset(&self->setup_params, 0, sizeof(self->setup_params)); self->setup_params.dwVersion = NVFBC_TOGL_SETUP_PARAMS_VER; self->setup_params.eBufferFormat = NVFBC_BUFFER_FORMAT_BGRA; @@ -283,6 +293,8 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) { return -1; } + fprintf(stderr, "nvfbc 6\n"); + return 0; } @@ -354,9 +366,13 @@ static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec frame->width = video_codec_context->width; frame->height = video_codec_context->height; + fprintf(stderr, "nvfbc 7\n"); + /* Disable vsync */ set_vertical_sync_enabled(self->params.egl, 0); + fprintf(stderr, "nvfbc 8\n"); + return 0; error_cleanup: @@ -400,6 +416,8 @@ static int gsr_capture_nvfbc_capture(gsr_capture *cap, AVFrame *frame, gsr_color grab_params.pFrameGrabInfo = &frame_info; grab_params.dwTimeoutMs = 0; + fprintf(stderr, "nvfbc capture 1\n"); + NVFBCSTATUS status = self->nv_fbc_function_list.nvFBCToGLGrabFrame(self->nv_fbc_handle, &grab_params); if(status != NVFBC_SUCCESS) { fprintf(stderr, "gsr error: gsr_capture_nvfbc_capture failed: %s (%d), recreating session after %f second(s)\n", self->nv_fbc_function_list.nvFBCGetLastErrorStr(self->nv_fbc_handle), status, nvfbc_recreate_retry_time_seconds); @@ -408,6 +426,8 @@ static int gsr_capture_nvfbc_capture(gsr_capture *cap, AVFrame *frame, gsr_color return 0; } + fprintf(stderr, "nvfbc capture 2\n"); + self->params.egl->glFlush(); self->params.egl->glFinish(); |