libvideo-scale is a C library to handle the scaling of video frames on various platforms with a common API.
The library uses hardware-accelerated scaling when available.
The following implementations are available:
- LibYUV (software scaling)
The application can force using a specific implementation or let the library decide according to what is supported by the platform.
The library depends on the following Alchemy modules:
- libfutils
- libmedia-buffers
- libpomp
- libulog
- libvideo-defs
- libvideo-scale-core
- (optional) libmedia-buffers-memory (for LibYUV support)
- (optional) libmedia-buffers-memory-generic (for LibYUV support)
- (optional) libvideo-metadata (for LibYUV support)
- (optional) libyuv (for LibYUV support)
Building is activated by enabling libvideo-scale in the Alchemy build configuration.
Operations are asynchronous: the application pushes buffers to scale in the input queue and is notified of scaled frames through a callback function.
Some scalers need input buffers to come from their own buffer pools; when the input buffer pool returned by the library is not NULL it must be used and input buffers cannot be shared with other video pipeline elements.
The library is designed to run on a libpomp event loop (pomp_loop, see libpomp documentation). All API functions must be called from the pomp_loop thread. All callback functions (frame_output, flush or stop) are called from the pomp_loop thread.
The library can be tested using the provided vscale command-line tool which takes as input a raw YUV file and outputs a scaled YUV file.
To build the tool, enable vscale in the Alchemy build configuration.
For a list of available options, run
$ vscale -h