mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-22 15:11:31 +00:00
[client] video: switch transport sources
Track primary and fallback video with source-specific generations, and publish a source only after its first frame or software surface is ready. Route SPICE surfaces and cursors through the generic render queue. Keep the current image across handoffs, and switch input only after the new source has been presented. Move fallback activation to its worker so display callbacks cannot block or deadlock the render path.
This commit is contained in:
@@ -57,6 +57,30 @@ enum AudioResampler {
|
||||
AUDIO_RESAMPLER_BACKEND
|
||||
};
|
||||
|
||||
struct VideoSourceState
|
||||
{
|
||||
atomic_uint_least64_t generation;
|
||||
atomic_uint_least64_t transitionSerial;
|
||||
atomic_bool transitionPending;
|
||||
atomic_uint_least32_t width;
|
||||
atomic_uint_least32_t height;
|
||||
atomic_int rotate;
|
||||
atomic_uint_least32_t appliedWidth;
|
||||
atomic_uint_least32_t appliedHeight;
|
||||
atomic_int appliedRotate;
|
||||
atomic_bool ready;
|
||||
bool swSurface;
|
||||
bool configurePending;
|
||||
|
||||
bool cursorStateValid;
|
||||
bool cursorVisible;
|
||||
int cursorX;
|
||||
int cursorY;
|
||||
int cursorHX;
|
||||
int cursorHY;
|
||||
uint32_t cursorWhiteLevel;
|
||||
};
|
||||
|
||||
struct AppState
|
||||
{
|
||||
ImGuiIO * io;
|
||||
@@ -79,11 +103,15 @@ struct AppState
|
||||
bool dsInitialized;
|
||||
bool jitRender;
|
||||
|
||||
atomic_bool fallbackDisplayRequested;
|
||||
atomic_bool fallbackDisplayActive;
|
||||
atomic_bool fallbackDisplayTransition;
|
||||
struct VideoSourceState videoSource[LG_VIDEO_SOURCE_COUNT];
|
||||
atomic_int videoSourceRequested;
|
||||
atomic_int videoSourceApplied;
|
||||
atomic_uint_least64_t videoSourceAppliedGeneration;
|
||||
LG_Lock videoSourceLock;
|
||||
LG_Lock videoSplashLock;
|
||||
bool videoGeometryDirty;
|
||||
|
||||
atomic_bool fallbackUUIDMismatch;
|
||||
bool fallbackSurfaceValid;
|
||||
|
||||
uint8_t guestUUID[16];
|
||||
bool guestUUIDValid;
|
||||
@@ -296,7 +324,7 @@ struct CursorState
|
||||
bool realigning;
|
||||
|
||||
/* true if the cursor needs re-drawing/updating */
|
||||
bool redraw;
|
||||
atomic_bool redraw;
|
||||
|
||||
/* true if the cursor movements should be scaled */
|
||||
bool useScale;
|
||||
|
||||
Reference in New Issue
Block a user