luvcraft/video-interop-tests.lisp
Model the live backend contract: transfer before logical invalidation, then make one immediate maintenance attempt. Recursive entry from a plane callback leaves this newly enqueued owner for the next outer pass.
The failed candidate owns no retryable wrapper. Logical invalidation succeeded, and the backend ledger is now the durable native owner.
View retirement succeeds; plane 0's native teardown does not. The texture entry and its importer retainer both survive the attempt.
Maintenance retries the durable texture entry. Its owner succeeds and drops the final retainer, but importer retirement is deliberately a new FIFO entry rather than part of this texture callback's success.
The next pass owns only the importer and closes it independently.
The plane and its owner retire first. The last callback enqueues a separate importer entry with a consumed (zero) retainer; it does not run importer-native closure recursively inside texture retirement.
The importer entry now runs by itself and fails without returning ownership to the already successful plane callback.
Retrying the importer entry cannot revisit plane teardown or its owner.
Model failure before the first plane is adopted. The constructor's unwind requests release and then drops its only lexical importer owner.
Recover IMPORTER only through the durable ledger entry. Its immediate native close failed after transfer, so no vanished constructor local is needed to retry it.
(handle)Logically invalidate HANDLE immediately. Native teardown may be deferred until submitted work which captured HANDLE has completed.
(device descriptor)Asks the DEVICE for a handle to newly created instance of some object fulfilling the DESCRIPTOR.
Backend-owned state for adopting decoded hardware frames into DEVICE. Every native plane owner retains this object until the HAL has completed its physical retirement. Asking to release the importer closes admission at once, but its backend state remains live until the last such owner callback runs.
(importer frame width height)Build and return one complete DECODED-VIDEO-PICTURE. FRAME remains borrowed from the decoder. An implementation must retain every native plane for the lifetime of the returned picture and must release every part of an incomplete candidate before propagating an error.
An explicitly owned AVFrame.
(device plane-count make-plane-texture)Build a picture transactionally from PLANE-COUNT native plane textures. MAKE-PLANE-TEXTURE is called with each zero-based plane index and returns an owned HAL texture. This function creates the corresponding views. If either step fails, all views built so far are destroyed before every owned texture.
(resource stage)(ledger resource ready-after teardown invalidate &optional custodian)Durably enqueue native ownership, then logically invalidate RESOURCE. INVALIDATE is called only after LEDGER owns the complete teardown. Queue implementations call this while holding the lock which also guards LEDGER.
(importer)Release IMPORTER's backend-native state after its last owner retires.
(importer release-native-owner)Retain IMPORTER and return an idempotent native-owner release callback. The callback first runs RELEASE-NATIVE-OWNER. Only its successful completion drops the importer retainer. If importer closure was already requested, the same callback then performs (or retries) that closure. This ordering lets a HAL retirement…
(ledger completed-frontier &key (operation :maintain-queue))Attempt the eligible FIFO prefix in LEDGER at COMPLETED-FRONTIER. Only a successful eligible prefix leaves the ledger. The first ineligible or failed entry is a FIFO barrier: it and the entire unattempted suffix remain ahead of ownership transferred recursively by teardown callbacks.
(device owner teardown invalidate)Transfer OWNER's native teardown to DEVICE, then invalidate OWNER. Backend methods may transfer ownership to a durable device queue before INVALIDATE and attempt it immediately. The default has no such queue: native TEARDOWN must return successfully before INVALIDATE is called.
(events owner plane-count &key (view-failures 0))One atomically publishable and explicitly owned decoded picture.
(importer picture)A video file playing on one world rectangle.
(screen &optional frame)Adopt and atomically publish SCREEN's current decoded hardware frame. The complete candidate is built before SCREEN changes. If adoption signals, the preceding picture remains published; after publication its replacement is retired with warnings so teardown trouble cannot roll the screen backward.
Incomplete construction candidates whose logical release needs a retry.
Test whether two compatible scalars are equal.
Logical negation of one test or raw truth value.
(&body body)(picture)Release PICTURE's views before any of its textures. Idempotent. Failed handles remain attached for a later release attempt. Textures are not retired at all until every view is gone, preserving the dependency order even when one view's destruction reports a failure.
(display session)All named failures from a completed release sequence.
(screen)Exceptional startup-owned screens whose logical release needs a retry.
(&body body)(importer)Request release of IMPORTER's backend-owned persistent state. The request is idempotent. Native state is released only after every adopted plane owner has completed physical retirement in the HAL.
A backend-free model of the HAL's logical/native retirement split. These resources disappear from a picture as soon as
destroytransfers their teardown into the device ledger; native failure cannot return ownership to that now-invalid wrapper.