GstMse.MediaSource

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GstMse.MediaSource GstMse.MediaSource Gst.Object->GstMse.MediaSource

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

is_type_supported (type)

class

new ()

add_source_buffer (type)

attach (element)

clear_live_seekable_range ()

detach ()

end_of_stream (eos_error)

get_active_source_buffers ()

get_duration ()

get_live_seekable_range ()

get_position ()

get_ready_state ()

get_source_buffers ()

remove_source_buffer (buffer)

set_duration (duration)

set_live_seekable_range (start, end)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

active-source-buffers

GstMse.SourceBufferList

r

A SourceBufferList of all SourceBuffers that are active in this Media Source

duration

int

r/w

The Duration of the Media Source as a GstClockTime

position

int

r/w

The Position of the Media Source as a GstClockTime

ready-state

GstMse.MediaSourceReadyState

r

The Ready State of the Media Source

source-buffers

GstMse.SourceBufferList

r

A SourceBufferList of all SourceBuffers in this Media Source

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Short Description

on-source-close

on-source-ended

Emitted when self has ended, normally through GstMse.MediaSource.end_of_stream().

on-source-open

Emitted when self has been opened.

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Class Details

class GstMse.MediaSource(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstMse.MediaSourceClass

GstMse.MediaSource is the entry point into the W3C Media Source API. It offers functionality similar to #GstAppSrc for client-side web or JavaScript applications decoupling the source of media from its processing and playback.

To interact with a Media Source, connect it to a GstMse.MseSrc that is in some Gst.Pipeline using GstMse.MediaSource.attach(). Then create at least one GstMse.SourceBuffer using GstMse.MediaSource.add_source_buffer(). Finally, feed some media data to the Source Buffer(s) using GstMse.SourceBuffer.append_buffer() and play the pipeline.

New in version 1.24.

classmethod is_type_supported(type)
Parameters:

type (str) – A MIME type value

Returns:

TRUE when supported, FALSE otherwise

Return type:

bool

Determines whether the current Media Source configuration can process media of the supplied type.

New in version 1.24.

classmethod new()
Returns:

a new GstMse.MediaSource instance

Return type:

GstMse.MediaSource

Creates a new GstMse.MediaSource instance. The instance is in the GstMse.MediaSourceReadyState.CLOSED state and is not associated with any media player.

Specification

New in version 1.24.

add_source_buffer(type)
Parameters:

type (str) – A MIME type describing the format of the incoming media

Raises:

GLib.Error

Returns:

a new GstMse.SourceBuffer instance on success, otherwise NULL

Return type:

GstMse.SourceBuffer

Add a GstMse.SourceBuffer to this GstMse.MediaSource of the specified media type. The Media Source must be in the GstMse.MediaSourceReadyState GstMse.MediaSourceReadyState.OPEN.

Specification

New in version 1.24.

attach(element)
Parameters:

element (GstMse.MseSrc) – GstMse.MseSrc source Element

Associates self with element. Normally, the Element will be part of a Gst.Pipeline that plays back the data submitted to the Media Source’s Source Buffers.

GstMse.MseSrc is a special source element that is designed to consume media from a GstMse.MediaSource.

Specification

New in version 1.24.

clear_live_seekable_range()
Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Clear the live seekable range for self. This will inform the component playing this Media Source that there is no seekable time range.

If the ready state is not GstMse.MediaSourceReadyState.OPEN, it will fail and set an error.

Specification

New in version 1.24.

detach()

Detaches self from any GstMse.MseSrc element that it may be associated with.

New in version 1.24.

end_of_stream(eos_error)
Parameters:

eos_error (GstMse.MediaSourceEOSError) – The error type, if any

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Mark self as reaching the end of stream, disallowing new data inputs.

Specification

New in version 1.24.

get_active_source_buffers()
Returns:

a new GstMse.SourceBufferList instance

Return type:

GstMse.SourceBufferList

Gets a GstMse.SourceBufferList containing all the Source Buffers currently associated with this Media Source that are considered “active.” For a Source Buffer to be considered active, either its video track is selected, its audio track is enabled, or its text track is visible or hidden. This object will reflect any future changes to the parent Media Source as well.

Specification

New in version 1.24.

get_duration()
Returns:

the current duration as a #GstClockTime

Return type:

int

Gets the current duration of self.

Specification

New in version 1.24.

get_live_seekable_range()
Returns:

time range

Return type:

range: GstMse.MediaSourceRange

Get the live seekable range of self. Will fill in the supplied range with the current live seekable range.

New in version 1.24.

get_position()
Returns:

the current playback position as a #GstClockTime

Return type:

int

Gets the current playback position of the Media Source.

New in version 1.24.

get_ready_state()
Returns:

the current GstMse.MediaSourceReadyState value

Return type:

GstMse.MediaSourceReadyState

Gets the current Ready State of the Media Source.

Specification

New in version 1.24.

get_source_buffers()
Returns:

a GstMse.SourceBufferList instance

Return type:

GstMse.SourceBufferList

Gets a GstMse.SourceBufferList containing all the Source Buffers currently associated with this Media Source. This object will reflect any future changes to the parent Media Source as well.

Specification

New in version 1.24.

remove_source_buffer(buffer)
Parameters:

buffer (GstMse.SourceBuffer) – GstMse.SourceBuffer instance

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Remove buffer from self.

buffer must have been created as a child of self and self must be in the GstMse.MediaSourceReadyState GstMse.MediaSourceReadyState.OPEN.

Specification

New in version 1.24.

set_duration(duration)
Parameters:

duration (int) – The new duration to apply to self.

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Sets the duration of self.

Specification

New in version 1.24.

set_live_seekable_range(start, end)
Parameters:
  • start (int) – The earliest point in the stream considered seekable

  • end (int) – The latest point in the stream considered seekable

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Set the live seekable range for self. This range informs the component playing this Media Source what it can allow the user to seek through.

If the ready state is not GstMse.MediaSourceReadyState.OPEN, or the supplied start time is later than end it will fail and set an error.

Specification

New in version 1.24.

Signal Details

GstMse.MediaSource.signals.on_source_close(media_source)
Signal Name:

on-source-close

Flags:

RUN_LAST

Parameters:

media_source (GstMse.MediaSource) – The object which received the signal

GstMse.MediaSource.signals.on_source_ended(media_source)
Signal Name:

on-source-ended

Flags:

RUN_LAST

Parameters:

media_source (GstMse.MediaSource) – The object which received the signal

Emitted when self has ended, normally through GstMse.MediaSource.end_of_stream().

Specification

New in version 1.24.

GstMse.MediaSource.signals.on_source_open(media_source)
Signal Name:

on-source-open

Flags:

RUN_LAST

Parameters:

media_source (GstMse.MediaSource) – The object which received the signal

Emitted when self has been opened.

Specification

New in version 1.24.

Property Details

GstMse.MediaSource.props.active_source_buffers
Name:

active-source-buffers

Type:

GstMse.SourceBufferList

Default Value:

None

Flags:

READABLE

A GstMse.SourceBufferList of every GstMse.SourceBuffer in this Media Source that is considered active

Specification

New in version 1.24.

GstMse.MediaSource.props.duration
Name:

duration

Type:

int

Default Value:

18446744073709551615

Flags:

READABLE, WRITABLE

The Duration of the Media Source as a #GstClockTime

Specification

New in version 1.24.

GstMse.MediaSource.props.position
Name:

position

Type:

int

Default Value:

18446744073709551615

Flags:

READABLE, WRITABLE

The position of the player consuming from the Media Source

New in version 1.24.

GstMse.MediaSource.props.ready_state
Name:

ready-state

Type:

GstMse.MediaSourceReadyState

Default Value:

GstMse.MediaSourceReadyState.CLOSED

Flags:

READABLE

The Ready State of the Media Source

Specification

New in version 1.24.

GstMse.MediaSource.props.source_buffers
Name:

source-buffers

Type:

GstMse.SourceBufferList

Default Value:

None

Flags:

READABLE

A GstMse.SourceBufferList of every GstMse.SourceBuffer in this Media Source

Specification

New in version 1.24.