libav/frame.lisp
An explicitly owned AVFrame.
Allocate an empty AVFrame. It carries no picture until something fills it.
Return a new reference to frame and all buffers backing its picture.
Release frame and any buffers it holds. Repeated calls are harmless.
av_frame_free takes the address of the pointer and nulls it, so hand it a cell rather than the pointer itself.
Evaluate body with variable bound to a fresh frame, releasing it after.
Drop frame's buffers, leaving the struct ready to receive another picture.
frame's pixel format as a keyword, or its raw integer when unrecognised.
A hardware format -- :VIDEOTOOLBOX, :VAAPI, :VULKAN -- means the picture never
touched the CPU and frame's third plane holds a platform surface.
True when frame's picture lives in a hardware frames pool, not in memory.
Return the foreign pointer to frame's plane, counting from zero.
Return frame's borrowed CVPixelBuffer, or NIL for a non-VideoToolbox frame.
Return frame's borrowed AVVkFrame, or NIL for a non-Vulkan frame.
Return the byte stride of frame's plane, which exceeds its width when padded.
Allocate buffers for frame's current width, height, and pixel format.
An alignment of zero lets FFmpeg choose the alignment its own SIMD paths want,
which is what a decoder would do.
An explicitly owned AVFrame.
(frame)Logical negation of one test or raw truth value.
(frame)(&optional directory)Load libavutil, libavcodec, and libavformat, and check their versions. DIRECTORY is useful for builds which have not been installed. When it is NIL, LUV_FFMPEG_LIBDIR is consulted before the platform soname search. Signals LIBAV-VERSION-MISMATCH when a loaded library disagrees with the headers this system was…
(frame)(frame)((variable) &body body)(frame)((name symbol) (type (eql 'arithmetic-operator)))(frame)FRAME's pixel format as a keyword, or its raw integer when unrecognised. A hardware format -- :VIDEOTOOLBOX, :VAAPI, :VULKAN -- means the picture never touched the CPU and FRAME's third plane holds a platform surface.
Logical disjunction of tests and raw truth values.
(frame)(frame)(frame plane)(frame)(frame plane)(frame &key (alignment 0))Allocate buffers for FRAME's current width, height, and pixel format. An ALIGNMENT of zero lets FFmpeg choose the alignment its own SIMD paths want, which is what a decoder would do.
(code operation)
An explicitly owned AVFrame.
AVFrame has two lifetimes stacked on top of each other: the struct itself, allocated by av_frame_alloc and released by av_frame_free, and the reference-counted buffers it points at, which av_frame_unref drops without disturbing the struct. A decode loop reuses one frame across thousands of pictures by unreferencing between them, so the two are kept separate here rather than folded into one "close".
Nothing in this file copies pixels. A hardware frame does not have any to copy -- its `data[3]' is a CVPixelBuffer, a VASurfaceID, or an AVVkFrame -- and the software path wants its planes uploaded straight from the decoder's memory rather than through a Lisp array.