GstMse.MediaSource¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
A SourceBufferList of all SourceBuffers that are active in this Media Source |
||
r/w |
The Duration of the Media Source as a GstClockTime |
||
r/w |
The Position of the Media Source as a GstClockTime |
||
r |
The Ready State of the Media Source |
||
r |
A SourceBufferList of all SourceBuffers in this Media Source |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when self has ended, normally through |
|
Emitted when self has been opened. |
Fields¶
- Inherited:
Class Details¶
- class GstMse.MediaSource(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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 someGst.Pipeline
usingGstMse.MediaSource.attach
(). Then create at least oneGstMse.SourceBuffer
usingGstMse.MediaSource.add_source_buffer
(). Finally, feed some media data to the Source Buffer(s) usingGstMse.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:
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:
Creates a new
GstMse.MediaSource
instance. The instance is in theGstMse.MediaSourceReadyState.CLOSED
state and is not associated with any media player.New in version 1.24.
- add_source_buffer(type)¶
- Parameters:
type (
str
) – A MIME type describing the format of the incoming media- Raises:
- Returns:
a new
GstMse.SourceBuffer
instance on success, otherwiseNULL
- Return type:
Add a
GstMse.SourceBuffer
to thisGstMse.MediaSource
of the specified media type. The Media Source must be in theGstMse.MediaSourceReadyState
GstMse.MediaSourceReadyState.OPEN
.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 aGstMse.MediaSource
.New in version 1.24.
- clear_live_seekable_range()¶
- Raises:
- Returns:
TRUE
on success,FALSE
otherwise- Return type:
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.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:
- Returns:
TRUE
on success,FALSE
otherwise- Return type:
Mark self as reaching the end of stream, disallowing new data inputs.
New in version 1.24.
- get_active_source_buffers()¶
- Returns:
a new
GstMse.SourceBufferList
instance- Return type:
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.New in version 1.24.
- get_duration()¶
- Returns:
the current duration as a #GstClockTime
- Return type:
Gets the current duration of self.
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:
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:
Gets the current Ready State of the Media Source.
New in version 1.24.
- get_source_buffers()¶
- Returns:
a
GstMse.SourceBufferList
instance- Return type:
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.New in version 1.24.
- remove_source_buffer(buffer)¶
- Parameters:
buffer (
GstMse.SourceBuffer
) –GstMse.SourceBuffer
instance- Raises:
- Returns:
TRUE
on success,FALSE
otherwise- Return type:
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
.New in version 1.24.
- set_duration(duration)¶
- Parameters:
duration (
int
) – The new duration to apply to self.- Raises:
- Returns:
TRUE
on success,FALSE
otherwise- Return type:
Sets the duration of self.
New in version 1.24.
- set_live_seekable_range(start, end)¶
- Parameters:
- Raises:
- Returns:
TRUE
on success,FALSE
otherwise- Return type:
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.New in version 1.24.
Signal Details¶
- GstMse.MediaSource.signals.on_source_close(media_source)¶
- Signal Name:
on-source-close
- Flags:
- 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:
- Parameters:
media_source (
GstMse.MediaSource
) – The object which received the signal
Emitted when self has ended, normally through
GstMse.MediaSource.end_of_stream
().New in version 1.24.
- GstMse.MediaSource.signals.on_source_open(media_source)¶
- Signal Name:
on-source-open
- Flags:
- Parameters:
media_source (
GstMse.MediaSource
) – The object which received the signal
Emitted when self has been opened.
New in version 1.24.
Property Details¶
- GstMse.MediaSource.props.active_source_buffers¶
- Name:
active-source-buffers
- Type:
- Default Value:
- Flags:
A
GstMse.SourceBufferList
of everyGstMse.SourceBuffer
in this Media Source that is considered activeNew in version 1.24.
- GstMse.MediaSource.props.duration¶
-
The Duration of the Media Source as a #GstClockTime
New in version 1.24.
- GstMse.MediaSource.props.position¶
-
The position of the player consuming from the Media Source
New in version 1.24.
- GstMse.MediaSource.props.ready_state¶
- Name:
ready-state
- Type:
- Default Value:
- Flags:
The Ready State of the Media Source
New in version 1.24.
- GstMse.MediaSource.props.source_buffers¶
- Name:
source-buffers
- Type:
- Default Value:
- Flags:
A
GstMse.SourceBufferList
of everyGstMse.SourceBuffer
in this Media SourceNew in version 1.24.