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 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

Modules

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

Macros

  • Build a surface memory descriptor enum that supports multiple descriptor types.

Structs

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

Enums

Functions

  • 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.
  • Copies src into dst as I4xx (YUV tri-planar).
  • Copies src into dst as NV12, removing any extra padding.