hal/application-capture-tests.lisp
The stop owner has closed admission but cannot pass the active capture until its preparation and cleanup have both left.
Once the owner has left, quiescence is immediate even on this thread.
The rejected capture performed no preparation and allocated no GPU resource. Let the exact active owner finish and release its claim.
Finished one-shot work accepted by a GPU queue's SUBMIT operation.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
Multiplication and scalar scaling.
(queue work)Schedule some command buffers on the QUEUE. Submission is asynchronous: returning does not mean the GPU has finished the work, only that the implementation retains everything the work depends on until it completes. Use SUBMITTED-WORK-DONE to wait.
(buffer &key offset size)Wait for BUFFER's device queue and copy mapped bytes back to the host.
Logical disjunction of tests and raw truth values.
Subtraction or unary negation.
Addition over compatible quantities.
(resource)(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
A GPU presentation relationship configured for a canvas.
(context)Return the GPU device used by CONTEXT, or NIL before first configuration.
A MuPDF context: its allocator, its store, and its error stack.
(context)Return CONTEXT's configured drawable extent as (WIDTH HEIGHT), or NIL.
A native destination with a lifetime and frame clock.
(canvas)Return true when the caller is CANVAS's native event/frame thread.
(canvas function)Run FUNCTION with a timestamp on CANVAS's native frame/event thread. The initial native implementation is synchronous: the caller waits for the function's values. The protocol leaves room for a real frame scheduler.
(application event)(application)Return APPLICATION's open LUV canvas for a native GPU capture. The shared implementation derives the presentation context and device through CANVAS-CONTEXT and CONTEXT-DEVICE; applications do not repeat those hooks.
(application capture)Prepare APPLICATION for CAPTURE on the calling thread. This is the place to wait for application-specific readiness and to quiesce a normal frame loop. CAPTURE's canvas, context, device, extent, and format are already established, but its shared GPU resources do not exist yet. CLEANUP-CAPTURE is called even when…
One screenshot or film transaction around an application-owned frame. The object is control-plane state, allocated once per capture. TARGET and READBACK-BUFFER are dense GPU resources owned and destroyed by the shared capture implementation.
(application capture frame-index)Advance application-owned work before offscreen film frame FRAME-INDEX. This runs on the film caller after BEFORE-FRAME and before GPU encoding. A streaming application can publish completed products here without putting its world model or simulation policy into the shared capture loop.
(application capture encoder target extent)Encode APPLICATION's complete visible frame into offscreen TARGET. This method runs on the canvas's native frame thread. ENCODER is open and owned by the shared implementation; EXTENT is the fixed two-dimensional capture extent. The method must not finish or submit ENCODER and must not destroy TARGET. Its primary…
An explicitly owned AVFrame.
(capture indicator &optional default)(application capture)Undo application-owned CAPTURE preparation on the calling thread. When shared GPU resources were created they are still alive and visible through CAPTURE-TARGET and CAPTURE-READBACK-BUFFER during this method. Applications with target-keyed GPU caches should synchronously evict those entries on their canvas thread…
Logical conjunction of tests and raw truth values.
Logical negation of one test or raw truth value.
(&key fail-encode-p fail-cleanup-p native-thread)(&key native-thread)(application)Close APPLICATION's capture admission without waiting for active work. This is safe on a canvas thread. Return true when this call closed admission, or NIL when shutdown had already been requested.
(application)(function capture)(application function)Atomically call small publication FUNCTION only while admission is open. FUNCTION runs under APPLICATION's short capture gate lock and must not block or reenter the capture gate. Return true when it ran, NIL after shutdown began.
(application)Close APPLICATION's capture gate and wait for its active capture to leave. The caller must run beside the canvas thread while a capture is active. The active capture may still need that thread for its final frame and cache cleanup; waiting on the canvas thread would deadlock it and is rejected explicitly.
(application pathname &key options (label "application screenshot"))Render APPLICATION offscreen and write its native-resolution PNG. OPTIONS is an application-owned property list interpreted by the capture protocol methods. Return PATHNAME, packed pixels, width, height, color format, and the optional metadata value from ENCODE-CAPTURE-FRAME.
Test whether two compatible scalars are equal.
(capture)Named release failures reported without replacing an active transfer.
(writer capture frame-count frame-rate
&key before-frame progress-function
(clock-function #'capture-clock-seconds)
(sleep-function #'sleep))Test whether one compatible scalar is less than another.
The componentwise absolute value of a raw value.
A backend-free executable capture transaction. The probe keeps the GPU protocol real (descriptors, command encoding, submission, readback, and destruction) while replacing native resources with small Lisp objects.