GstMpegts.Section

Fields

Name

Type

Access

Description

cached_parsed

object

r

crc

int

r/w

Checksum (if applicable)

current_next_indicator

bool

r/w

Applies to current/next stream or not

data

int

r

destroy_parsed

GLib.DestroyNotify

r

last_section_number

int

r/w

Number of the last expected section (if multiple)

offset

int

r

packetizer

GstMpegts.PacketizeFunc

r

parent

Gst.MiniObject

r

pid

int

r/w

The PID on which this section was found or belongs to.

section_length

int

r

section_number

int

r/w

Number of the section (if multiple)

section_type

GstMpegts.SectionType

r/w

The type of section.

short_section

bool

r

subtable_extension

int

r/w

This meaning differs per section. See the documentation of the parsed section type for the meaning of this field

table_id

int

r/w

The table id of this section. See GstMpegts.SectionTableID and derivates for more information.

version_number

int

r/w

Version of the section.

Methods

class

from_atsc_mgt (mgt)

class

from_atsc_rrt (rrt)

class

from_atsc_stt (stt)

class

from_nit (nit)

class

from_pat (programs, ts_id)

class

from_pmt (pmt, pid)

class

from_scte_sit (sit, pid)

class

from_sdt (sdt)

class

new (pid, data)

get_atsc_cvct ()

get_atsc_eit ()

get_atsc_ett ()

get_atsc_mgt ()

get_atsc_rrt ()

get_atsc_stt ()

get_atsc_tvct ()

get_bat ()

get_cat ()

get_data ()

get_eit ()

get_nit ()

get_pat ()

get_pmt ()

get_scte_sit ()

get_sdt ()

get_sit ()

get_tdt ()

get_tot ()

get_tsdt ()

packetize ()

send_event (element)

Details

class GstMpegts.Section
Generic usage of sections with GstMpegts.Section

The GstMpegts.Section object is the representation of MPEG-TS Section (SI or PSI).

Various elements can post those on the bus via Gst.Message of type Gst.MessageType.ELEMENT. The GstMpegts.message_parse_mpegts_section() function provides access to the section.

Applications (or other elements) can create them either by using one of the gst_mpegts_section_from_* functions, or by providing the raw SI data via GstMpegts.Section.new().

Elements outputting MPEG-TS streams can also create sections using the various convenience functions and then get the packetized data (to be inserted in MPEG-TS packets) using GstMpegts.Section.packetize().

For more details, refer to the ITU H.222.0 or ISO/IEC 13818-1 specifications and other specifications mentioned in the documentation.

Supported base MPEG-TS sections

These are the sections for which parsing and packetizing code exists.

Program Association Table (PAT)

See:

Conditional Access Table (CAT)

See:

Program Map Table (PMT)

See:

Transport Stream Description Table (TSDT)

See:

API
classmethod from_atsc_mgt(mgt)
Parameters:

mgt (GstMpegts.AtscMGT) – a GstMpegts.AtscMGT to create the GstMpegts.Section from

Returns:

the GstMpegts.Section

Return type:

GstMpegts.Section

New in version 1.18.

classmethod from_atsc_rrt(rrt)
Parameters:

rrt (GstMpegts.AtscRRT) –

Return type:

GstMpegts.Section

classmethod from_atsc_stt(stt)
Parameters:

stt (GstMpegts.AtscSTT) –

Return type:

GstMpegts.Section

classmethod from_nit(nit)
Parameters:

nit (GstMpegts.NIT) – a GstMpegts.NIT to create the GstMpegts.Section from

Returns:

the GstMpegts.Section

Return type:

GstMpegts.Section

Ownership of nit is taken. The data in nit is managed by the GstMpegts.Section

classmethod from_pat(programs, ts_id)
Parameters:
Returns:

a GstMpegts.Section

Return type:

GstMpegts.Section

Creates a PAT GstMpegts.Section from the programs array of GstMpegts.PatPrograms

classmethod from_pmt(pmt, pid)
Parameters:
Returns:

GstMpegts.Section

Return type:

GstMpegts.Section

Creates a GstMpegts.Section from pmt that is bound to pid

classmethod from_scte_sit(sit, pid)
Parameters:
Returns:

the GstMpegts.Section

Return type:

GstMpegts.Section

Ownership of sit is taken. The data in sit is managed by the GstMpegts.Section

classmethod from_sdt(sdt)
Parameters:

sdt (GstMpegts.SDT) – a GstMpegts.SDT to create the GstMpegts.Section from

Returns:

the GstMpegts.Section

Return type:

GstMpegts.Section

Ownership of sdt is taken. The data in sdt is managed by the GstMpegts.Section

classmethod new(pid, data)
Parameters:
  • pid (int) – the PID to which this section belongs

  • data (bytes) – a pointer to the beginning of the section (i.e. the first byte should contain the table_id field).

Returns:

A new GstMpegts.Section if the data was valid, else None

Return type:

GstMpegts.Section

Creates a new GstMpegts.Section from the provided data.

Note: Ensuring data is big enough to contain the full section is the responsibility of the caller. If it is not big enough, None will be returned.

Note: it is the responsibility of the caller to ensure data does point to the beginning of the section.

get_atsc_cvct()
Returns:

The GstMpegts.AtscVCT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscVCT

Returns the GstMpegts.AtscVCT contained in the self

get_atsc_eit()
Returns:

The GstMpegts.AtscEIT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscEIT

Returns the GstMpegts.AtscEIT contained in the self.

get_atsc_ett()
Returns:

The GstMpegts.AtscETT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscETT

Returns the GstMpegts.AtscETT contained in the self.

get_atsc_mgt()
Returns:

The GstMpegts.AtscMGT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscMGT

Returns the GstMpegts.AtscMGT contained in the self.

get_atsc_rrt()
Returns:

The GstMpegts.AtscRRT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscRRT

Returns the GstMpegts.AtscRRT contained in the self.

New in version 1.18.

get_atsc_stt()
Returns:

The GstMpegts.AtscSTT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscSTT

Returns the GstMpegts.AtscSTT contained in the self.

get_atsc_tvct()
Returns:

The GstMpegts.AtscVCT contained in the section, or None if an error happened.

Return type:

GstMpegts.AtscVCT

Returns the GstMpegts.AtscVCT contained in the self

get_bat()
Returns:

The GstMpegts.BAT contained in the section, or None if an error happened.

Return type:

GstMpegts.BAT

Returns the GstMpegts.BAT contained in the self.

get_cat()
Returns:

The array of GstMpegts.Descriptor contained in the section, or None if an error happened. Release with #g_array_unref when done.

Return type:

[GstMpegts.Descriptor]

Parses a Conditional Access Table.

Returns the array of GstMpegts.Descriptor contained in the Conditional Access Table.

get_data()
Returns:

The original unparsed section data.

Return type:

GLib.Bytes

Gets the original unparsed section data.

get_eit()
Returns:

The GstMpegts.EIT contained in the section, or None if an error happened.

Return type:

GstMpegts.EIT

Returns the GstMpegts.EIT contained in the self.

get_nit()
Returns:

The GstMpegts.NIT contained in the section, or None if an error happened.

Return type:

GstMpegts.NIT

Returns the GstMpegts.NIT contained in the self.

get_pat()
Returns:

The GstMpegts.PatProgram contained in the section, or None if an error happened or the self did not contain a valid PAT. Release with #g_ptr_array_unref when done.

Return type:

[GstMpegts.PatProgram]

Parses a Program Association Table (ITU H.222.0, ISO/IEC 13818-1).

Returns the array of GstMpegts.PatProgram contained in the section.

Note: The PAT transport_stream_id field corresponds to the “subtable_extension” field of the provided self.

get_pmt()
Returns:

The GstMpegts.PMT contained in the section, or None if an error happened.

Return type:

GstMpegts.PMT

Parses the Program Map Table contained in the self.

get_scte_sit()
Returns:

The GstMpegts.SCTESIT contained in the section, or None if an error happened.

Return type:

GstMpegts.SCTESIT

Returns the GstMpegts.SCTESIT contained in the self.

get_sdt()
Returns:

The GstMpegts.SDT contained in the section, or None if an error happened.

Return type:

GstMpegts.SDT

Returns the GstMpegts.SDT contained in the self.

get_sit()
Returns:

The GstMpegts.SIT contained in the section, or None if an error happened.

Return type:

GstMpegts.SIT

Returns the GstMpegts.SIT contained in the self.

New in version 1.20.

get_tdt()
Returns:

The Gst.DateTime contained in the section, or None if an error happened. Release with Gst.DateTime.unref when done.

Return type:

Gst.DateTime

Returns the Gst.DateTime of the TDT

get_tot()
Returns:

The GstMpegts.TOT contained in the section, or None if an error happened.

Return type:

GstMpegts.TOT

Returns the GstMpegts.TOT contained in the self.

get_tsdt()
Returns:

The array of GstMpegts.Descriptor contained in the section, or None if an error happened. Release with #g_array_unref when done.

Return type:

[GstMpegts.Descriptor]

Parses a Transport Stream Description Table.

Returns the array of GstMpegts.Descriptor contained in the section

packetize()
Returns:

pointer to section data, or None on failure.

output_size:

#gsize to hold the size of the data

Return type:

(int, output_size: int)

Packetize (i.e. serialize) the self. If the data in self has already been packetized, the data pointer is returned immediately. Otherwise, the data field is allocated and populated.

send_event(element)
Parameters:

element (Gst.Element) – The Gst.Element to send to section event to

Returns:

True if the event was sent to the element.

Return type:

bool

Creates a custom Gst.Event with a GstMpegtsSection and send it the element Gst.Element.