mirror of
https://github.com/VallierDev/uu-remote-linux.git
synced 2026-11-16 16:50:41 +01:00
With --features inproc-av on X11 and UU_VIDEO_ENCODER=vaapi, VAAPI runs in process: a DRI3 DMA-BUF of the root (XShm upload without DRI3) goes through VPP to NV12 and the hardware encoder. SPS/PPS(/VPS) and slice headers are packed by the host because radeonsi (Mesa 26) does not write them. libva/libva-drm are dlopen'ed; release builds do not enable inproc-av. The NVENC path is unchanged. Accepted by the contributor on AMD HawkPoint1 (Mesa 26.2.3), 1920x1200@60, with the official Mac viewer (HEVC, presets, fps, scaling). Intel iHD and 4K are not verified. Thanks @ferstar.
34 lines
849 B
C
34 lines
849 B
C
#ifndef UU_DRI3_CAPTURE_H
|
|
#define UU_DRI3_CAPTURE_H
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct Dri3Capture Dri3Capture;
|
|
|
|
Dri3Capture* dri3_capture_create(const char* display_name, uint32_t width, uint32_t height);
|
|
|
|
// Trigger GPU blit from Root Window to the DRI3 DMA-BUF Pixmap.
|
|
// Returns 0 on success, negative on error.
|
|
int dri3_capture_blit(Dri3Capture* cap);
|
|
|
|
// Wait for next XDamage event or timeout (ms).
|
|
// Returns 1 if damaged, 0 if timeout, negative on error.
|
|
int dri3_capture_wait_damage(Dri3Capture* cap, int timeout_ms);
|
|
|
|
// Get the exported DMA-BUF file descriptor and stride
|
|
int dri3_capture_get_dma_fd(Dri3Capture* cap);
|
|
uint32_t dri3_capture_get_stride(Dri3Capture* cap);
|
|
|
|
void dri3_capture_destroy(Dri3Capture* cap);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // UU_DRI3_CAPTURE_H
|