MPEG.TS.PMT (MPEG.TS v2.2.0)

View Source

Program Map Table.

Summary

Functions

Categorizes a stream type as :video, :audio, or :other.

Categorizes a stream based on its stream_id (as an integer value) as :video, :audio, or :other.

Determines if a given stream type is an audio stream.

Determines if a given stream type is a video stream.

Types

stream_id_t()

@type stream_id_t() :: 0..8191

stream_t()

@type stream_t() :: %{stream_type: atom(), stream_type_id: stream_type_id_t()}

stream_type_id_t()

@type stream_type_id_t() :: 0..255

streams_t()

@type streams_t() :: %{required(stream_id_t()) => stream_t()}

t()

@type t() :: %MPEG.TS.PMT{
  pcr_pid: 0..8191,
  program_info: list(),
  streams: streams_t()
}

Functions

encode_stream_type(val)

@spec encode_stream_type(atom()) :: stream_id_t()

get_stream_category(stream_type)

Categorizes a stream type as :video, :audio, or :other.

Examples

iex> get_stream_category(:H264)
:video

iex> get_stream_category(:AAC)
:audio

iex> get_stream_category(:DVB_SUBTITLE)
:other

get_stream_category_by_id(stream_id)

Categorizes a stream based on its stream_id (as an integer value) as :video, :audio, or :other.

Examples

iex> get_stream_category_by_id(0x1B)
:video

iex> get_stream_category_by_id(0x0F)
:audio

iex> get_stream_category_by_id(0x42)
:other

is_audio_stream?(stream_type)

Determines if a given stream type is an audio stream.

Examples

iex> is_audio_stream?(:AAC)
true

iex> is_audio_stream?(:H264)
false

is_video_stream?(stream_type)

Determines if a given stream type is a video stream.

Examples

iex> is_video_stream?(:H264)
true

iex> is_video_stream?(:AAC)
false

parse_stream_type(val)

unmarshal_table(arg)

@spec unmarshal_table(binary()) :: {:ok, t()} | {:error, :invalid_data}