mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
wip sync
This commit is contained in:
3
TODO
3
TODO
@@ -376,3 +376,6 @@ Taking a screenshot of camera with mjpeg doesn't work correctly because it updat
|
||||
Make capture from multiple sources work on nvidia x11 when capturing monitor + window. It doesn't work right now because monitor requires glx (nvfbc) while window requires egl.
|
||||
|
||||
Support v4l2 mplane on devices where it's supported (where it's more efficient). My camera doesn't support mplane.
|
||||
|
||||
Implement v4l2 yuyv nvidia capture by capturing rg88 yuyv to rgb as is done now for screenshot, but also do that for video by creating an intermediate rgb texture for the camera. Then render that rgb texture to the video texture.
|
||||
This is needed to properly scale the yuyv texture without messing it up (the texture indexing).
|
||||
@@ -40,6 +40,7 @@ typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXDrawable;
|
||||
typedef void(*__GLXextFuncPtr)(void);
|
||||
typedef struct __GLsync *GLsync;
|
||||
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
@@ -151,6 +152,11 @@ typedef void(*__GLXextFuncPtr)(void);
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
|
||||
#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
|
||||
#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
|
||||
#define GL_CONDITION_SATISFIED 0x911C
|
||||
#define GL_ALREADY_SIGNALED 0x911A
|
||||
|
||||
typedef unsigned int (*FUNC_eglExportDMABUFImageQueryMESA)(EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, uint64_t *modifiers);
|
||||
typedef unsigned int (*FUNC_eglExportDMABUFImageMESA)(EGLDisplay dpy, EGLImageKHR image, int *fds, int32_t *strides, int32_t *offsets);
|
||||
typedef void (*FUNC_glEGLImageTargetTexture2DOES)(unsigned int target, GLeglImageOES image);
|
||||
@@ -309,6 +315,10 @@ struct gsr_egl {
|
||||
void* (*glMapBufferRange)(unsigned int target, intptr_t offset, ssize_t length, unsigned int access);
|
||||
unsigned char (*glUnmapBuffer)(unsigned int target);
|
||||
void (*glGetIntegerv)(unsigned int pname, int *params);
|
||||
|
||||
GLsync (*glFenceSync)(unsigned int condition, unsigned int flags);
|
||||
void (*glDeleteSync)(GLsync sync);
|
||||
unsigned int (*glClientWaitSync)(GLsync sync, unsigned int flags, uint64_t timeout);
|
||||
};
|
||||
|
||||
bool gsr_egl_load(gsr_egl *self, gsr_window *window, bool is_monitor_capture, bool enable_debug);
|
||||
|
||||
@@ -628,6 +628,18 @@ static int gsr_capture_kms_capture(gsr_capture *cap, gsr_capture_metadata *captu
|
||||
}
|
||||
}
|
||||
|
||||
// static GLsync sync = NULL;
|
||||
|
||||
// if(sync) {
|
||||
// const unsigned int r = self->params.egl->glClientWaitSync(sync, GL_SYNC_FLUSH_COMMANDS_BIT, 1000 * 1000 * 1000);
|
||||
// if(r != GL_CONDITION_SATISFIED && r != GL_ALREADY_SIGNALED) {
|
||||
// fprintf(stderr, "failed sync: %u\n", r);
|
||||
// }
|
||||
// self->params.egl->glDeleteSync(sync);
|
||||
// }
|
||||
|
||||
// sync = self->params.egl->glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
|
||||
//self->params.egl->glFlush();
|
||||
//self->params.egl->glFinish();
|
||||
|
||||
|
||||
@@ -333,6 +333,10 @@ static bool gsr_egl_load_gl(gsr_egl *self, void *library) {
|
||||
{ (void**)&self->glUnmapBuffer, "glUnmapBuffer" },
|
||||
{ (void**)&self->glGetIntegerv, "glGetIntegerv" },
|
||||
|
||||
{ (void**)&self->glFenceSync, "glFenceSync" },
|
||||
{ (void**)&self->glDeleteSync, "glDeleteSync" },
|
||||
{ (void**)&self->glClientWaitSync, "glClientWaitSync" },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user