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.

Modules§

bitstream_utils
codec
Parsers for various kinds of encoded streams.

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.
Rect
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.
EncodedFormat
FrameMemoryType
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.