Crate cros_codecs

Source
Expand description

This crate provides tools to help decode and encode various video codecs, leveraging the hardware acceleration available on the target.

The codec module contains tools to parse encoded video streams like H.264 or VP9 and extract the information useful in order to perform e.g. hardware-accelerated decoding.

The backend module contains common backend code. A backend is a provider of some way to decode or encode a particular codec, like VAAPI.

The decoder module contains decoders that can turn an encoded video stream into a sequence of decoded frames using the hardware acceleration available on the host.

The encoder module contains encoder that can turn a picture sequence into a compressed sequence of decodable encoded packets using the hardware acceleration available on the host.

The utils module contains some useful code that is shared between different parts of this crate and didn’t fit any of the modules above.

Re-exports§

pub use libva;

Modules§

backend
Shared code for codec backends.
codec
Parsers for various kinds of encoded streams.
decoder
Encoded stream decoding.
encoder
utils
Utility functions used by several parts of this crate.

Macros§

multiple_desc_type
Build a frame memory descriptor enum that supports multiple descriptor types.

Structs§

Fourcc
Wrapper around u32 when they are meant to be a fourcc.
FrameLayout
Unambiguously describes the layout of a frame.
PlaneLayout
Describes the layout of a plane within a frame.
Resolution
A frame resolution in pixels.

Enums§

BlockingMode
Instructs on whether it should block on the operation(s).
DecodedFormat
Formats that buffers can be mapped into for the CPU to read.
ResolutionRoundMode
Rounding modes for Resolution

Functions§

decoded_frame_size
Returns the size required to store a frame of format with size widthxheight, without any padding. This is the minimum size of the destination buffer passed to nv12_copy or i420_copy.
i4xx_copy
Copies src into dst as I4xx (YUV tri-planar).
nv12_copy
Copies src into dst as NV12, removing any extra padding.