GstCodecParsers.AV1Parser

Fields

Name

Type

Access

Description

annex_b

bool

r

frame_unit_consumed

int

r

frame_unit_size

int

r

seq_header

GstCodecParsers.AV1SequenceHeaderOBU

r

state

GstCodecParsers.AV1ParserState

r

temporal_unit_consumed

int

r

temporal_unit_size

int

r

Methods

free ()

identify_one_obu (data, size, obu)

parse_frame_header_obu (obu, frame_header)

parse_frame_obu (obu, frame)

parse_metadata_obu (obu, metadata)

parse_sequence_header_obu (obu, seq_header)

parse_temporal_delimiter_obu (obu)

parse_tile_group_obu (obu, tile_group)

parse_tile_list_obu (obu, tile_list)

reference_frame_update (frame_header)

reset (annex_b)

reset_annex_b ()

set_operating_point (operating_point)

Details

class GstCodecParsers.AV1Parser

For more details about the structures, you can refer to the AV1 Bitstream & Decoding Process Specification V1.0.0 specification

It offers you bitstream parsing of low overhead bistream format (Section 5) or Annex B according to the setting of the parser. By calling the function of GstCodecParsers.AV1Parser.reset(), user can switch between bistream mode and Annex B mode.

To retrieve OBUs and parse its headers, you should firstly call the function of GstCodecParsers.AV1Parser.identify_one_obu() to get the OBU type if succeeds or just discard the data if fails.

Then, depending on the GstCodecParsers.AV1OBUType of the newly parsed GstCodecParsers.AV1OBU, you should call the differents functions to parse the structure details:

Note: Some parser functions are dependent on information provided in the sequence header and reference frame’s information. It maintains a state inside itself, which contains all global vars and reference information during the whole parsing process. Calling GstCodecParsers.AV1Parser.reset() or a new sequence’s arriving can clear and reset this inside state.

After successfully handled a frame(for example, decode a frame successfully), you should call GstCodecParsers.AV1Parser.reference_frame_update() to update the parser’s inside state(such as reference information, global segmentation information, etc).

New in version 1.18.

free()

If parser is not None, frees its allocated memory.

It cannot be used afterwards.

New in version 1.18.

identify_one_obu(data, size, obu)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

consumed:

the consumed data size

Return type:

(GstCodecParsers.AV1ParserResult, consumed: int)

Identify one obu's type from the incoming data stream. This function should be called first to know the type of obu before other parse APIs.

New in version 1.18.

parse_frame_header_obu(obu, frame_header)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one frame header obu based on the self context, store the result in the frame.

New in version 1.18.

parse_frame_obu(obu, frame)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one frame obu based on the self context, store the result in the frame.

New in version 1.18.

parse_metadata_obu(obu, metadata)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one meta data obu based on the self context.

New in version 1.18.

parse_sequence_header_obu(obu, seq_header)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one sequence header obu based on the self context, store the result in the seq_header.

New in version 1.18.

parse_temporal_delimiter_obu(obu)
Parameters:

obu (GstCodecParsers.AV1OBU) – a GstCodecParsers.AV1OBU to be parsed

Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one temporal delimiter obu based on the self context. The temporal delimiter is just delimiter and contains no content.

New in version 1.18.

parse_tile_group_obu(obu, tile_group)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one tile group obu based on the self context, store the result in the tile_group.

New in version 1.18.

parse_tile_list_obu(obu, tile_list)
Parameters:
Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Parse one tile list obu based on the self context, store the result in the tile_list. It is for large scale tile coding mode.

New in version 1.18.

reference_frame_update(frame_header)
Parameters:

frame_header (GstCodecParsers.AV1FrameHeaderOBU) – a GstCodecParsers.AV1FrameHeaderOBU to load

Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Update the context of frame_header to parser’s state. This function is used when we finish one frame’s decoding/showing, and need to update info such as reference, global parameters.

New in version 1.18.

reset(annex_b)
Parameters:

annex_b (bool) – indicate whether conforms to annex b

Reset the current GstCodecParsers.AV1Parser's state totally.

New in version 1.18.

reset_annex_b()

Only reset the current GstCodecParsers.AV1Parser's annex b context. The other part of the state is kept.

New in version 1.20.

set_operating_point(operating_point)
Parameters:

operating_point (int) – the operating point to set

Returns:

The GstCodecParsers.AV1ParserResult.

Return type:

GstCodecParsers.AV1ParserResult

Set the operating point to filter OBUs.

New in version 1.20.