GstMse.SourceBuffer

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

abort ()

append_buffer (buf)

change_content_type (type)

get_append_mode ()

get_append_window_end ()

get_append_window_start ()

get_buffered ()

get_content_type ()

get_timestamp_offset ()

get_updating ()

remove (start, end)

set_append_mode (mode)

set_append_window_end (end)

set_append_window_start (start)

set_timestamp_offset (offset)

Virtual Methods

Inherited:

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

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

append-mode

GstMse.SourceBufferAppendMode

r/w

Either Segments or Sequence

append-window-end

int

r

The timestamp representing the end of the append window

append-window-start

int

r

The timestamp representing the start of the append window

buffered

GLib.Array

r

The set of Time Intervals that have been loaded into the current Source Buffer

content-type

str

r/w/c

The MIME content-type of the data stream

timestamp-offset

int

r/w

The next media segment appended to the current Source Buffer will have its start timestamp increased by this amount

updating

bool

r

Whether the current Source Buffer is still asynchronously processing previously issued commands

Signals

Inherited:

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

Name

Short Description

on-abort

Emitted when self was aborted after a call to GstMse.SourceBuffer.abort().

on-error

Emitted when self has encountered an error after a call to GstMse.SourceBuffer.append_buffer().

on-update

Emitted when self has successfully processed data after a call to GstMse.SourceBuffer.append_buffer().

on-update-end

Emitted when self is no longer in the updating state after a call to GstMse.SourceBuffer.append_buffer().

on-update-start

Emitted when self has begun to process data after a call to GstMse.SourceBuffer.append_buffer().

Fields

Inherited:

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

Class Details

class GstMse.SourceBuffer(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstMse.SourceBufferClass

The Source Buffer is the primary means of data flow between an application and the Media Source API. It represents a single timeline of media, containing some combination of audio, video, and text tracks. An application is responsible for feeding raw data into the Source Buffer using GstMse.SourceBuffer.append_buffer() and the Source Buffer will asynchronously process the data into tracks of time-coded multimedia samples.

The application as well as the associated playback component can then select to play media from any subset of tracks across all Source Buffers of a Media Source.

A few control points are also provided to customize the behavior.

New in version 1.24.

abort()
Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Attempts to end any processing of the currently pending data and reset the media parser.

Specification

New in version 1.24.

append_buffer(buf)
Parameters:

buf (Gst.Buffer) – The media data to append

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Schedules the bytes inside buf to be processed by self. When it is possible to accept the supplied data, it will be processed asynchronously and fill in the track buffers for playback purposes.

Specification

New in version 1.24.

change_content_type(type)
Parameters:

type (str) – the desired content type

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Attempts to change the content type of self to type. Any new data appended to the Source Buffer must be of the supplied type afterward.

New in version 1.24.

get_append_mode()
Returns:

The current GstMse.SourceBufferAppendMode

Return type:

GstMse.SourceBufferAppendMode

Specification

New in version 1.24.

get_append_window_end()
Returns:

The current Append Window end time as a #GstClockTime

Return type:

int

Returns the current append window end time. Any segment processed that starts after this value will be ignored.

Specification

New in version 1.24.

get_append_window_start()
Returns:

The current Append Window start time as a #GstClockTime

Return type:

int

Returns the current append window start time. Any segment processed that ends earlier than this value will be ignored.

Specification

New in version 1.24.

get_buffered()
Raises:

GLib.Error

Returns:

a GLib.Array of GstMse.MediaSourceRange values.

Return type:

[GstMse.MediaSourceRange]

Returns a sequence of GstMse.MediaSourceRange values representing which segments of self are buffered in memory.

Specification

New in version 1.24.

get_content_type()
Returns:

a string representing the content type

Return type:

str

Returns the current content type of self.

New in version 1.24.

get_timestamp_offset()
Returns:

The current timestamp offset as a #GstClockTime

Return type:

int

Specification

New in version 1.24.

get_updating()
Returns:

Whether self is currently adding or removing media content.

Return type:

bool

Specification

New in version 1.24.

remove(start, end)
Parameters:
  • start (int) – The beginning timestamp of data to remove

  • end (int) – The end timestamp of data to remove

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Attempts to remove any parsed data between start and end from self.

Specification

New in version 1.24.

set_append_mode(mode)
Parameters:

mode (GstMse.SourceBufferAppendMode) – GstMse.SourceBufferAppendMode the desired Append Mode

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Changes the Append Mode of self. This influences what timestamps will be assigned to media processed by this Source Buffer. In Segment mode, the timestamps in each segment determine the position of each sample after it is processed. In Sequence mode, the timestamp of each processed sample is generated based on the end of the most recently processed segment.

Specification

New in version 1.24.

set_append_window_end(end)
Parameters:

end (int) – the append window end

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Modifies the current append window end of self. If successful, samples processed after setting this value that start after this point will be ignored.

Specification

New in version 1.24.

set_append_window_start(start)
Parameters:

start (int) – the append window end

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Modifies the current append window start of self. If successful, samples processed after setting this value that end before this point will be ignored.

Specification

New in version 1.24.

set_timestamp_offset(offset)
Parameters:

offset (int) – The new timestamp offset

Raises:

GLib.Error

Returns:

TRUE on success, FALSE otherwise

Return type:

bool

Attempt to set the timestamp offset of self. Any media processed after this value is set will have this value added to its start time.

Specification

New in version 1.24.

Signal Details

GstMse.SourceBuffer.signals.on_abort(source_buffer)
Signal Name:

on-abort

Flags:

RUN_LAST

Parameters:

source_buffer (GstMse.SourceBuffer) – The object which received the signal

Emitted when self was aborted after a call to GstMse.SourceBuffer.abort().

Specification

New in version 1.24.

GstMse.SourceBuffer.signals.on_error(source_buffer)
Signal Name:

on-error

Flags:

RUN_LAST

Parameters:

source_buffer (GstMse.SourceBuffer) – The object which received the signal

Emitted when self has encountered an error after a call to GstMse.SourceBuffer.append_buffer().

Specification

New in version 1.24.

GstMse.SourceBuffer.signals.on_update(source_buffer)
Signal Name:

on-update

Flags:

RUN_LAST

Parameters:

source_buffer (GstMse.SourceBuffer) – The object which received the signal

Emitted when self has successfully processed data after a call to GstMse.SourceBuffer.append_buffer().

Specification

New in version 1.24.

GstMse.SourceBuffer.signals.on_update_end(source_buffer)
Signal Name:

on-update-end

Flags:

RUN_LAST

Parameters:

source_buffer (GstMse.SourceBuffer) – The object which received the signal

Emitted when self is no longer in the updating state after a call to GstMse.SourceBuffer.append_buffer(). This can happen after a successful or unsuccessful append.

Specification

New in version 1.24.

GstMse.SourceBuffer.signals.on_update_start(source_buffer)
Signal Name:

on-update-start

Flags:

RUN_LAST

Parameters:

source_buffer (GstMse.SourceBuffer) – The object which received the signal

Emitted when self has begun to process data after a call to GstMse.SourceBuffer.append_buffer().

Specification

New in version 1.24.

Property Details

GstMse.SourceBuffer.props.append_mode
Name:

append-mode

Type:

GstMse.SourceBufferAppendMode

Default Value:

GstMse.SourceBufferAppendMode.SEGMENTS

Flags:

READABLE, WRITABLE

Affects how timestamps of processed media segments are interpreted. In GstMse.SourceBufferAppendMode.SEGMENTS, the start timestamp of a processed media segment is used directly along with GstMse.SourceBuffer :timestamp-offset . In GstMse.SourceBufferAppendMode.SEQUENCE, the timestamp of a processed media segment is ignored and replaced with the end time of the most recently appended segment.

Specification

New in version 1.24.

GstMse.SourceBuffer.props.append_window_end
Name:

append-window-end

Type:

int

Default Value:

18446744073709551615

Flags:

READABLE

Any segments processed which have a start time greater than this value will be ignored by this Source Buffer.

Specification

New in version 1.24.

GstMse.SourceBuffer.props.append_window_start
Name:

append-window-start

Type:

int

Default Value:

0

Flags:

READABLE

Any segments processed which end before this value will be ignored by this Source Buffer.

Specification

New in version 1.24.

GstMse.SourceBuffer.props.buffered
Name:

buffered

Type:

GLib.Array

Default Value:

None

Flags:

READABLE

The set of Time Intervals that have been loaded into the current Source Buffer

Specification

New in version 1.24.

GstMse.SourceBuffer.props.content_type
Name:

content-type

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The MIME content-type of the data stream

New in version 1.24.

GstMse.SourceBuffer.props.timestamp_offset
Name:

timestamp-offset

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

The next media segment appended to the current Source Buffer will have its start timestamp increased by this amount.

Specification

New in version 1.24.

GstMse.SourceBuffer.props.updating
Name:

updating

Type:

bool

Default Value:

False

Flags:

READABLE

Whether the current source buffer is still asynchronously processing previously issued commands.

Specification

New in version 1.24.