Functions

descriptor_from_custom (tag, data)

descriptor_from_custom_with_extension (tag, tag_extension, data)

descriptor_from_dvb_network_name (name)

descriptor_from_dvb_service (service_type, service_name, service_provider)

descriptor_from_dvb_subtitling (lang, type, composition, ancillary)

descriptor_from_iso_639_language (language)

descriptor_from_registration (format_identifier, additional_info)

descriptor_parse_audio_preselection_dump (source)

descriptor_parse_audio_preselection_free (source)

dvb_component_descriptor_free (source)

event_new_mpegts_section (section)

event_parse_mpegts_section (event)

find_descriptor (descriptors, tag)

find_descriptor_with_extension (descriptors, tag, tag_extension)

initialize ()

message_new_mpegts_section (parent, section)

message_parse_mpegts_section (message)

parse_descriptors (buffer, buf_len)

pat_new ()

scte_cancel_new (event_id)

scte_null_new ()

scte_splice_in_new (event_id, splice_time)

scte_splice_out_new (event_id, splice_time, duration)

section_from_atsc_mgt (mgt)

section_from_atsc_rrt (rrt)

section_from_atsc_stt (stt)

section_from_nit (nit)

section_from_pat (programs, ts_id)

section_from_pmt (pmt, pid)

section_from_scte_sit (sit, pid)

section_from_sdt (sdt)

Details

GstMpegts.descriptor_from_custom(tag, data)
Parameters:
  • tag (int) – descriptor tag

  • data (bytes) – descriptor data (after tag and length field)

Returns:

GstMpegts.Descriptor

Return type:

GstMpegts.Descriptor

Creates a GstMpegts.Descriptor with custom tag and data

GstMpegts.descriptor_from_custom_with_extension(tag, tag_extension, data)
Parameters:
  • tag (int) – descriptor tag

  • tag_extension (int) – descriptor tag extension

  • data (bytes) – descriptor data (after tag and length field)

Returns:

GstMpegts.Descriptor

Return type:

GstMpegts.Descriptor

Creates a GstMpegts.Descriptor with custom tag, tag_extension and data

New in version 1.20.

GstMpegts.descriptor_from_dvb_network_name(name)
Parameters:

name (str) – the network name to set

Returns:

the GstMpegts.Descriptor or None on fail

Return type:

GstMpegts.Descriptor

Creates a GstMpegts.Descriptor to be a GstMpegts.DVBDescriptorType.NETWORK_NAME, with the network name name. The data field of the GstMpegts.Descriptor will be allocated, and transferred to the caller.

GstMpegts.descriptor_from_dvb_service(service_type, service_name, service_provider)
Parameters:
Returns:

the GstMpegts.Descriptor or None on fail

Return type:

GstMpegts.Descriptor

Fills a GstMpegts.Descriptor to be a GstMpegts.DVBDescriptorType.SERVICE. The data field of the GstMpegts.Descriptor will be allocated, and transferred to the caller.

GstMpegts.descriptor_from_dvb_subtitling(lang, type, composition, ancillary)
Parameters:
  • lang (str) – a string containing the ISO639 language

  • type (int) – subtitling type

  • composition (int) – composition page id

  • ancillary (int) – ancillary page id

Return type:

GstMpegts.Descriptor

GstMpegts.descriptor_from_iso_639_language(language)
Parameters:

language (str) – ISO-639-2 language 3-str code

Returns:

GstMpegts.Descriptor, None on failure

Return type:

GstMpegts.Descriptor

Creates a GstMpegts.DescriptorType.ISO_639_LANGUAGE GstMpegts.Descriptor with a single language

GstMpegts.descriptor_from_registration(format_identifier, additional_info)
Parameters:
  • format_identifier (str) – a 4 character format identifier string

  • additional_info (bytes or None) – pointer to optional additional info

Returns:

GstMpegts.Descriptor, None on failure

Return type:

GstMpegts.Descriptor

Creates a GstMpegts.DescriptorType.REGISTRATION GstMpegts.Descriptor

GstMpegts.descriptor_parse_audio_preselection_dump(source)
Parameters:

source (GstMpegts.AudioPreselectionDescriptor) –

New in version 1.20.

GstMpegts.descriptor_parse_audio_preselection_free(source)
Parameters:

source (GstMpegts.AudioPreselectionDescriptor) –

New in version 1.20.

GstMpegts.dvb_component_descriptor_free(source)
Parameters:

source (GstMpegts.ComponentDescriptor) –

GstMpegts.event_new_mpegts_section(section)
Parameters:

section (GstMpegts.Section) – The GstMpegts.Section to put in a message

Returns:

The new custom Gst.Event.

Return type:

Gst.Event

Creates a new Gst.Event for a GstMpegts.Section.

New in version 1.20.

GstMpegts.event_parse_mpegts_section(event)
Parameters:

event (Gst.Event) – Gst.Event containing a GstMpegts.Section

Returns:

The extracted GstMpegts.Section , or None if the event did not contain a valid GstMpegts.Section.

Return type:

GstMpegts.Section

Extracts the GstMpegts.Section contained in the event Gst.Event

GstMpegts.find_descriptor(descriptors, tag)
Parameters:
Returns:

the first descriptor matching tag, else None.

Return type:

GstMpegts.Descriptor

Finds the first descriptor of type tag in the array.

Note: To look for descriptors that can be present more than once in an array of descriptors, iterate the GLib.Array manually.

GstMpegts.find_descriptor_with_extension(descriptors, tag, tag_extension)
Parameters:
Returns:

the first descriptor matchin tag with tag_extension, else None.

Return type:

GstMpegts.Descriptor

Finds the first descriptor of type tag with tag_extension in the array.

Note: To look for descriptors that can be present more than once in an array of descriptors, iterate the GLib.Array manually.

New in version 1.20.

GstMpegts.initialize()

Initializes the MPEG-TS helper library. Must be called before any usage.

GstMpegts.message_new_mpegts_section(parent, section)
Parameters:
Returns:

The new Gst.Message to be posted, or None if the section is not valid.

Return type:

Gst.Message

Creates a new Gst.Message for a GstMpegtsSection.

GstMpegts.message_parse_mpegts_section(message)
Parameters:

message (Gst.Message) – a Gst.Message

Returns:

the contained GstMpegts.Section, or None.

Return type:

GstMpegts.Section

Returns the GstMpegts.Section contained in a message.

GstMpegts.parse_descriptors(buffer, buf_len)
Parameters:
  • buffer (int) – descriptors to parse

  • buf_len (int) – Size of buffer

Returns:

an array of the parsed descriptors or None if there was an error. Release with #g_array_unref when done with it.

Return type:

[GstMpegts.Descriptor]

Parses the descriptors present in buffer and returns them as an array.

Note: The data provided in buffer will not be copied.

GstMpegts.pat_new()
Returns:

A newly allocated GLib.PtrArray

Return type:

[GstMpegts.PatProgram]

Allocates a new GLib.PtrArray for GstMpegts.PatProgram. The array can be filled and then converted to a PAT section with GstMpegts.Section.from_pat().

GstMpegts.scte_cancel_new(event_id)
Parameters:

event_id (int) – The event ID to cancel.

Returns:

A newly allocated GstMpegts.SCTESIT

Return type:

GstMpegts.SCTESIT

Allocates and initializes a new INSERT command GstMpegts.SCTESIT setup to cancel the specified event_id.

GstMpegts.scte_null_new()
Returns:

A newly allocated GstMpegts.SCTESIT

Return type:

GstMpegts.SCTESIT

Allocates and initializes a None command GstMpegts.SCTESIT.

GstMpegts.scte_splice_in_new(event_id, splice_time)
Parameters:
  • event_id (int) – The event ID.

  • splice_time (int) – The running time for the splice event

Returns:

A newly allocated GstMpegts.SCTESIT

Return type:

GstMpegts.SCTESIT

Allocates and initializes a new “Splice In” INSERT command GstMpegts.SCTESIT for the given event_id and splice_time.

If the splice_time is GObject.G_MAXUINT64 then the event will be immediate as opposed to for the target splice_time.

GstMpegts.scte_splice_out_new(event_id, splice_time, duration)
Parameters:
  • event_id (int) – The event ID.

  • splice_time (int) – The running time for the splice event

  • duration (int) – The optional duration.

Returns:

A newly allocated GstMpegts.SCTESIT

Return type:

GstMpegts.SCTESIT

Allocates and initializes a new “Splice Out” INSERT command GstMpegts.SCTESIT for the given event_id, splice_time and duration.

If the splice_time is GObject.G_MAXUINT64 then the event will be immediate as opposed to for the target splice_time.

If the duration is 0 it won’t be specified in the event.

GstMpegts.section_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.

GstMpegts.section_from_atsc_rrt(rrt)
Parameters:

rrt (GstMpegts.AtscRRT) –

Return type:

GstMpegts.Section

GstMpegts.section_from_atsc_stt(stt)
Parameters:

stt (GstMpegts.AtscSTT) –

Return type:

GstMpegts.Section

GstMpegts.section_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

GstMpegts.section_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

GstMpegts.section_from_pmt(pmt, pid)
Parameters:
Returns:

GstMpegts.Section

Return type:

GstMpegts.Section

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

GstMpegts.section_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

GstMpegts.section_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