MediaCodecs.H264.NALU (MediCodecs v0.7.0)

View Source

Struct describing an h264 nalu.

Summary

Functions

Checks if the NALU is a keyframe (IDR).

Parses a NALU bitstring and returns a NALU struct.

Parses the NALU header.

Gets the NALU type.

Checks if the NALU is a Video Coding Layer (VCL) NALU.

Types

nalu_type()

@type nalu_type() ::
  :non_idr
  | :part_a
  | :part_b
  | :part_c
  | :idr
  | :sei
  | :sps
  | :pps
  | :aud
  | :end_of_seq
  | :end_of_stream
  | :filler_data
  | :sps_extension
  | :prefix_nal_unit
  | :subset_sps
  | :auxiliary_non_part
  | :extension
  | :reserved
  | :unspecified

t()

@type t() :: %MediaCodecs.H264.NALU{
  content: struct() | nil,
  nal_ref_idc: non_neg_integer(),
  type: nalu_type()
}

Functions

keyframe?(nalu)

@spec keyframe?(nalu :: binary() | t()) :: boolean()

Checks if the NALU is a keyframe (IDR).

parse(nalu, opts \\ [])

@spec parse(nalu :: binary(), Keyword.t()) :: t()

Parses a NALU bitstring and returns a NALU struct.

An optional keyword can be provided to completely parse the NAL unit:

  • :sps - provide the parsed sps NAL unit. Needed for slice parsing.
  • :pps - provide the parsed pps NAL unit. Needed for slice parsing.

parse_header(nalu)

@spec parse_header(nalu :: binary()) :: t()

Parses the NALU header.

type(nalu)

@spec type(nalu :: binary()) :: nalu_type()

Gets the NALU type.

vcl?(nalu)

@spec vcl?(nalu :: binary() | t()) :: boolean()

Checks if the NALU is a Video Coding Layer (VCL) NALU.