Files
vatrog-vm-signaling/src/si/vgpu-stream/include/capture.h
T

29 lines
1.2 KiB
C
Raw Normal View History

#ifndef VGPU_CAPTURE_H
#define VGPU_CAPTURE_H
/* capture.h — extension seam for capture backends.
* A backend produces desktop frames and submits them to the presenter. This
* header is OS-agnostic: it names backends through an opaque vgpu_ctx* and a
* uniform start contract. A platform layer defines vgpu_ctx and any private
* backend plumbing (see src/stream/win32/capture-win32.h). A future Linux layer
* implements the same seam against its own vgpu_ctx + region/sync/clock. */
/* Opaque runtime context, defined by the platform layer (win32: ctx.h). */
typedef struct vgpu_ctx vgpu_ctx;
/* Start a capture backend. Returns 1 on success; on success the backend has
* spawned its capture thread(s) (which received ctx) and set ctx->backend /
* ctx->draw_cursor_cap. The submit contract: each captured desktop frame is
* handed to the presenter via vgpu_present_submit(). */
typedef int (*capture_start_fn)(vgpu_ctx* ctx, int fps);
typedef struct {
const char* name;
capture_start_fn start;
} capture_backend;
/* Data-driven backend table; the entry point selects by env or availability. */
const capture_backend* capture_backends(int* count);
#endif /* VGPU_CAPTURE_H */