mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-05 22:40:42 +09:00
@@ -189,8 +189,6 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) {
|
|||||||
create_params.glxCtx = self->params.egl->glx_context;
|
create_params.glxCtx = self->params.egl->glx_context;
|
||||||
create_params.glxFBConfig = self->params.egl->glx_fb_config;
|
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);
|
status = self->nv_fbc_function_list.nvFBCCreateHandle(&self->nv_fbc_handle, &create_params);
|
||||||
if(status != NVFBC_SUCCESS) {
|
if(status != NVFBC_SUCCESS) {
|
||||||
// Reverse engineering for interoperability
|
// Reverse engineering for interoperability
|
||||||
@@ -206,8 +204,6 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) {
|
|||||||
}
|
}
|
||||||
self->fbc_handle_created = true;
|
self->fbc_handle_created = true;
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 2\n");
|
|
||||||
|
|
||||||
NVFBC_GET_STATUS_PARAMS status_params;
|
NVFBC_GET_STATUS_PARAMS status_params;
|
||||||
memset(&status_params, 0, sizeof(status_params));
|
memset(&status_params, 0, sizeof(status_params));
|
||||||
status_params.dwVersion = NVFBC_GET_STATUS_PARAMS_VER;
|
status_params.dwVersion = NVFBC_GET_STATUS_PARAMS_VER;
|
||||||
@@ -218,8 +214,6 @@ static int gsr_capture_nvfbc_setup_handle(gsr_capture_nvfbc *self) {
|
|||||||
goto error_cleanup;
|
goto error_cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 3\n");
|
|
||||||
|
|
||||||
if(status_params.bCanCreateNow == NVFBC_FALSE) {
|
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");
|
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;
|
goto error_cleanup;
|
||||||
@@ -271,8 +265,6 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) {
|
|||||||
if(self->tracking_type == NVFBC_TRACKING_OUTPUT)
|
if(self->tracking_type == NVFBC_TRACKING_OUTPUT)
|
||||||
create_capture_params.dwOutputId = self->output_id;
|
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);
|
NVFBCSTATUS status = self->nv_fbc_function_list.nvFBCCreateCaptureSession(self->nv_fbc_handle, &create_capture_params);
|
||||||
if(status != NVFBC_SUCCESS) {
|
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));
|
fprintf(stderr, "gsr error: gsr_capture_nvfbc_start failed: %s\n", self->nv_fbc_function_list.nvFBCGetLastErrorStr(self->nv_fbc_handle));
|
||||||
@@ -280,8 +272,6 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) {
|
|||||||
}
|
}
|
||||||
self->capture_session_created = true;
|
self->capture_session_created = true;
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 5\n");
|
|
||||||
|
|
||||||
memset(&self->setup_params, 0, sizeof(self->setup_params));
|
memset(&self->setup_params, 0, sizeof(self->setup_params));
|
||||||
self->setup_params.dwVersion = NVFBC_TOGL_SETUP_PARAMS_VER;
|
self->setup_params.dwVersion = NVFBC_TOGL_SETUP_PARAMS_VER;
|
||||||
self->setup_params.eBufferFormat = NVFBC_BUFFER_FORMAT_BGRA;
|
self->setup_params.eBufferFormat = NVFBC_BUFFER_FORMAT_BGRA;
|
||||||
@@ -293,8 +283,6 @@ static int gsr_capture_nvfbc_setup_session(gsr_capture_nvfbc *self) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 6\n");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,13 +354,9 @@ static int gsr_capture_nvfbc_start(gsr_capture *cap, AVCodecContext *video_codec
|
|||||||
frame->width = video_codec_context->width;
|
frame->width = video_codec_context->width;
|
||||||
frame->height = video_codec_context->height;
|
frame->height = video_codec_context->height;
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 7\n");
|
|
||||||
|
|
||||||
/* Disable vsync */
|
/* Disable vsync */
|
||||||
set_vertical_sync_enabled(self->params.egl, 0);
|
set_vertical_sync_enabled(self->params.egl, 0);
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc 8\n");
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_cleanup:
|
error_cleanup:
|
||||||
@@ -416,8 +400,6 @@ static int gsr_capture_nvfbc_capture(gsr_capture *cap, AVFrame *frame, gsr_color
|
|||||||
grab_params.pFrameGrabInfo = &frame_info;
|
grab_params.pFrameGrabInfo = &frame_info;
|
||||||
grab_params.dwTimeoutMs = 0;
|
grab_params.dwTimeoutMs = 0;
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc capture 1\n");
|
|
||||||
|
|
||||||
NVFBCSTATUS status = self->nv_fbc_function_list.nvFBCToGLGrabFrame(self->nv_fbc_handle, &grab_params);
|
NVFBCSTATUS status = self->nv_fbc_function_list.nvFBCToGLGrabFrame(self->nv_fbc_handle, &grab_params);
|
||||||
if(status != NVFBC_SUCCESS) {
|
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);
|
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);
|
||||||
@@ -426,8 +408,6 @@ static int gsr_capture_nvfbc_capture(gsr_capture *cap, AVFrame *frame, gsr_color
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "nvfbc capture 2\n");
|
|
||||||
|
|
||||||
self->params.egl->glFlush();
|
self->params.egl->glFlush();
|
||||||
self->params.egl->glFinish();
|
self->params.egl->glFinish();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user