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.MediaSourceis 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.MseSrcthat is in someGst.PipelineusingGstMse.MediaSource.attach(). Then create at least oneGstMse.SourceBufferusingGstMse.MediaSource.add_source_buffer(). Finally, feed some media data to the Source Buffer(s) usingGstMse.SourceBuffer.append_buffer() and play the pipeline.Added in version 1.24.
- classmethod is_type_supported(type)¶
- Parameters:
type (
str) – A MIME type value- Returns:
TRUEwhen supported,FALSEotherwise- Return type:
Determines whether the current Media Source configuration can process media of the supplied type.
Added in version 1.24.
- classmethod new()¶
- Returns:
a new
GstMse.MediaSourceinstance- Return type:
Creates a new
GstMse.MediaSourceinstance. The instance is in theGstMse.MediaSourceReadyState.CLOSEDstate and is not associated with any media player.Added 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.SourceBufferinstance on success, otherwiseNULL- Return type:
Add a
GstMse.SourceBufferto thisGstMse.MediaSourceof the specified media type. The Media Source must be in theGstMse.MediaSourceReadyStateGstMse.MediaSourceReadyState.OPEN.Added in version 1.24.
- attach(element)¶
- Parameters:
element (
GstMse.MseSrc) –GstMse.MseSrcsource Element
Associates self with element. Normally, the Element will be part of a
Gst.Pipelinethat plays back the data submitted to the Media Source’s Source Buffers.GstMse.MseSrcis a special source element that is designed to consume media from aGstMse.MediaSource.Added in version 1.24.
- clear_live_seekable_range()¶
- Raises:
- Returns:
TRUEon success,FALSEotherwise- 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.Added in version 1.24.
- detach()¶
Detaches self from any
GstMse.MseSrcelement that it may be associated with.Added in version 1.24.
- end_of_stream(eos_error)¶
- Parameters:
eos_error (
GstMse.MediaSourceEOSError) – The error type, if any- Raises:
- Returns:
TRUEon success,FALSEotherwise- Return type:
Mark self as reaching the end of stream, disallowing new data inputs.
Added in version 1.24.
- get_active_source_buffers()¶
- Returns:
a new
GstMse.SourceBufferListinstance- Return type:
Gets a
GstMse.SourceBufferListcontaining 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.Added in version 1.24.
- get_duration()¶
- Returns:
the current duration as a #GstClockTime
- Return type:
Gets the current duration of self.
Added 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.
Added 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.
Added in version 1.24.
- get_ready_state()¶
- Returns:
the current
GstMse.MediaSourceReadyStatevalue- Return type:
Gets the current Ready State of the Media Source.
Added in version 1.24.
- get_source_buffers()¶
- Returns:
a
GstMse.SourceBufferListinstance- Return type:
Gets a
GstMse.SourceBufferListcontaining all the Source Buffers currently associated with this Media Source. This object will reflect any future changes to the parent Media Source as well.Added in version 1.24.
- remove_source_buffer(buffer)¶
- Parameters:
buffer (
GstMse.SourceBuffer) –GstMse.SourceBufferinstance- Raises:
- Returns:
TRUEon success,FALSEotherwise- Return type:
Remove buffer from self.
buffer must have been created as a child of self and self must be in the
GstMse.MediaSourceReadyStateGstMse.MediaSourceReadyState.OPEN.Added in version 1.24.
- set_duration(duration)¶
- Parameters:
duration (
int) – The new duration to apply to self.- Raises:
- Returns:
TRUEon success,FALSEotherwise- Return type:
Sets the duration of self.
Added in version 1.24.
- set_live_seekable_range(start, end)¶
- Parameters:
- Raises:
- Returns:
TRUEon success,FALSEotherwise- 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.Added 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().Added 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.
Added in version 1.24.
Property Details¶
- GstMse.MediaSource.props.active_source_buffers¶
- Name:
active-source-buffers- Type:
- Default Value:
- Flags:
A
GstMse.SourceBufferListof everyGstMse.SourceBufferin this Media Source that is considered activeAdded in version 1.24.
- GstMse.MediaSource.props.duration¶
-
The Duration of the Media Source as a #GstClockTime
Added in version 1.24.
- GstMse.MediaSource.props.position¶
-
The position of the player consuming from the Media Source
Added in version 1.24.
- GstMse.MediaSource.props.ready_state¶
- Name:
ready-state- Type:
- Default Value:
- Flags:
The Ready State of the Media Source
Added in version 1.24.
- GstMse.MediaSource.props.source_buffers¶
- Name:
source-buffers- Type:
- Default Value:
- Flags:
A
GstMse.SourceBufferListof everyGstMse.SourceBufferin this Media SourceAdded in version 1.24.