GstRtspServer.RTSPMediaFactory¶
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY |
||
r/w |
The kernel UDP buffer size to use |
||
r/w |
Clock to be used by the pipelines created for all medias of this factory |
||
r/w |
The IP DSCP field to use |
||
r/w |
Whether the created media should send and receive RTCP |
||
r/w |
If media from this factory should ensure a key unit when a client connects. |
||
r/w |
Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects. |
||
r/w |
Send EOS down the pipeline before shutting down |
||
r/w |
Latency used for receiving media in milliseconds |
||
r/w |
A launch description of the pipeline |
||
r/w |
The maximum time-to-live value of outgoing multicast packets |
||
r/w |
Allowed transfer profiles |
||
r/w |
Allowed lower transport protocols |
||
r/w |
If media from this factory is shared |
||
r/w |
If media from this factory should be stopped when a client disconnects without TEARDOWN |
||
r/w |
Control how media will be suspended |
||
r/w |
If media from this factory is for PLAY or RECORD |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GstRtspServer.RTSPMediaFactory(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The definition and logic for constructing the pipeline for a media. The media can contain multiple streams like audio and video.
- classmethod new()[source]¶
- Returns:
a new
GstRtspServer.RTSPMediaFactory
object.- Return type:
Create a new
GstRtspServer.RTSPMediaFactory
instance.
- add_role_from_structure(structure)[source]¶
- Parameters:
structure (
Gst.Structure
) –
A convenience wrapper around
GstRtspServer.RTSPPermissions.add_role_from_structure
(). If self had no permissions, new permissions will be created and the role will be added to it.New in version 1.14.
- construct(url)[source]¶
- Parameters:
url (
GstRtsp.RTSPUrl
) – the url used- Returns:
a new
GstRtspServer.RTSPMedia
if the media could be prepared.- Return type:
Construct the media object and create its streams. Implementations should create the needed gstreamer elements and add them to the result object. No state changes should be performed on them yet.
One or more
GstRtspServer.RTSPStream
objects should be created from the result withGstRtspServer.RTSPMedia.create_stream
().After the media is constructed, it can be configured and then prepared with
GstRtspServer.RTSPMedia.prepare
().The returned media will be locked and must be unlocked afterwards.
- create_element(url)[source]¶
- Parameters:
url (
GstRtsp.RTSPUrl
) – the url used- Returns:
a new
Gst.Element
.- Return type:
Gst.Element
orNone
Construct and return a
Gst.Element
that is aGst.Bin
containing the elements to use for streaming the media.The bin should contain payloaders pay\%d for each stream. The default implementation of this function returns the bin created from the launch parameter.
- get_address_pool()[source]¶
- Returns:
the
GstRtspServer.RTSPAddressPool
of self.GObject.Object.unref
() after usage.- Return type:
Get the
GstRtspServer.RTSPAddressPool
used as the address pool of self.
- get_buffer_size()[source]¶
- Returns:
the kernel UDP buffer size.
- Return type:
Get the kernel UDP buffer size.
- get_clock()[source]¶
-
Returns the clock that is going to be used by the pipelines of all medias created from this factory.
New in version 1.8.
- get_do_retransmission()[source]¶
- Returns:
Whether retransmission requests will be sent for receiving media
- Return type:
New in version 1.16.
- get_dscp_qos()[source]¶
- Returns:
the media DSCP QoS value or -1 if disabled.
- Return type:
Get the configured media DSCP QoS.
New in version 1.18.
- get_ensure_keyunit_on_start()[source]¶
- Returns:
The ensure-keyunit-on-start flag.
- Return type:
Get ensure-keyunit-on-start flag.
New in version 1.24.
- get_ensure_keyunit_on_start_timeout()[source]¶
- Returns:
The ensure-keyunit-on-start-timeout time.
- Return type:
Get ensure-keyunit-on-start-timeout time.
New in version 1.24.
- get_latency()[source]¶
- Returns:
latency in milliseconds
- Return type:
Get the latency that is used for receiving media
- get_launch()[source]¶
-
Get the
Gst.parse_launch
() pipeline description that will be used in the default prepare vmethod.
- get_max_mcast_ttl()[source]¶
- Returns:
the maximum time-to-live value of outgoing multicast packets.
- Return type:
Get the the maximum time-to-live value of outgoing multicast packets.
New in version 1.16.
- get_media_gtype()[source]¶
- Return type:
Return the
GObject.GType
of theGstRtspServer.RTSPMedia
subclass this factory will create.New in version 1.6.
- get_permissions()[source]¶
- Returns:
a
GstRtspServer.RTSPPermissions
object, unref after usage.- Return type:
Get the permissions object from self.
- get_publish_clock_mode()[source]¶
- Returns:
- Return type:
Gets if and how the media clock should be published according to RFC7273.
New in version 1.8.
- get_retransmission_time()[source]¶
- Returns:
a #GstClockTime
- Return type:
Get the time that is stored for retransmission purposes
- get_suspend_mode()[source]¶
- Returns:
- Return type:
Get how media created from this factory will be suspended.
- get_transport_mode()[source]¶
- Returns:
The transport mode.
- Return type:
Get if media created from this factory can be used for PLAY or RECORD methods.
- is_bind_mcast_address()[source]¶
- Returns:
True
if multicast sockets are configured to be bound to multicast addresses.- Return type:
Check if multicast sockets are configured to be bound to multicast addresses.
New in version 1.16.
- is_eos_shutdown()[source]¶
-
Get if media created from this factory will have an EOS event sent to the pipeline before shutdown.
-
Get if media created from this factory can be shared between clients.
- set_address_pool(pool)[source]¶
- Parameters:
pool (
GstRtspServer.RTSPAddressPool
orNone
) – aGstRtspServer.RTSPAddressPool
configure pool to be used as the address pool of self.
- set_bind_mcast_address(bind_mcast_addr)[source]¶
- Parameters:
bind_mcast_addr (
bool
) – the new value
Decide whether the multicast socket should be bound to a multicast address or INADDR_ANY.
New in version 1.16.
- set_buffer_size(size)[source]¶
- Parameters:
size (
int
) – the new value
Set the kernel UDP buffer size.
- set_clock(clock)[source]¶
-
Configures a specific clock to be used by the pipelines of all medias created from this factory.
New in version 1.8.
- set_do_retransmission(do_retransmission)[source]¶
- Parameters:
do_retransmission (
bool
) –
Set whether retransmission requests will be sent for receiving media
New in version 1.16.
- set_dscp_qos(dscp_qos)[source]¶
- Parameters:
dscp_qos (
int
) – a new dscp qos value (0-63, or -1 to disable)
Configure the media dscp qos to dscp_qos.
New in version 1.18.
- set_enable_rtcp(enable)[source]¶
- Parameters:
enable (
bool
) – the new value
Decide whether the created media should send and receive RTCP
New in version 1.20.
- set_ensure_keyunit_on_start(ensure_keyunit_on_start)[source]¶
- Parameters:
ensure_keyunit_on_start (
bool
) – the new value
If media from this factory should ensure a key unit when a client connects.
New in version 1.24.
- set_ensure_keyunit_on_start_timeout(timeout)[source]¶
- Parameters:
timeout (
int
) – the new value
Configures medias from this factory to consider keyunits older than timeout to be expired. Expired keyunits will be discarded.
New in version 1.24.
- set_eos_shutdown(eos_shutdown)[source]¶
- Parameters:
eos_shutdown (
bool
) – the new value
Configure if media created from this factory will have an EOS sent to the pipeline before shutdown.
- set_latency(latency)[source]¶
- Parameters:
latency (
int
) – latency in milliseconds
Configure the latency used for receiving media
- set_launch(launch)[source]¶
- Parameters:
launch (
str
) – the launch description
The
Gst.parse_launch
() line to use for constructing the pipeline in the default prepare vmethod.The pipeline description should return a
Gst.Bin
as the toplevel element which can be accomplished by enclosing the description with brackets ‘(’ ‘)’.The description should return a pipeline with payloaders named pay0, pay1, etc.. Each of the payloaders will result in a stream.
- set_max_mcast_ttl(ttl)[source]¶
- Parameters:
ttl (
int
) – the new multicast ttl value- Returns:
True
if the requested ttl has been set successfully.- Return type:
Set the maximum time-to-live value of outgoing multicast packets.
New in version 1.16.
- set_media_gtype(media_gtype)[source]¶
- Parameters:
media_gtype (
GObject.GType
) – theGObject.GType
of the class to create
Configure the
GObject.GType
of theGstRtspServer.RTSPMedia
subclass to create (by default, overridden construct vmethods may of course do something different)New in version 1.6.
- set_permissions(permissions)[source]¶
- Parameters:
permissions (
GstRtspServer.RTSPPermissions
orNone
) – aGstRtspServer.RTSPPermissions
Set permissions on self.
- set_profiles(profiles)[source]¶
- Parameters:
profiles (
GstRtsp.RTSPProfile
) – the new flags
Configure the allowed profiles for self.
- set_protocols(protocols)[source]¶
- Parameters:
protocols (
GstRtsp.RTSPLowerTrans
) – the new flags
Configure the allowed lower transport for self.
- set_publish_clock_mode(mode)[source]¶
- Parameters:
mode (
GstRtspServer.RTSPPublishClockMode
) – the clock publish mode
Sets if and how the media clock should be published according to RFC7273.
New in version 1.8.
- set_retransmission_time(time)[source]¶
- Parameters:
time (
int
) – a #GstClockTime
Configure the time to store for possible retransmission
- Parameters:
shared (
bool
) – the new value
Configure if media created from this factory can be shared between clients.
- set_stop_on_disconnect(stop_on_disconnect)[source]¶
- Parameters:
stop_on_disconnect (
bool
) – the new value
Configure if media created from this factory should be stopped when a client disconnects without sending TEARDOWN.
- set_suspend_mode(mode)[source]¶
- Parameters:
mode (
GstRtspServer.RTSPSuspendMode
) – the newGstRtspServer.RTSPSuspendMode
Configure how media created from this factory will be suspended.
- set_transport_mode(mode)[source]¶
- Parameters:
mode (
GstRtspServer.RTSPTransportMode
) – the new value
Configure if this factory creates media for PLAY or RECORD modes.
- do_configure(media) virtual¶
- Parameters:
media (
GstRtspServer.RTSPMedia
) –
configure the media created with construct. The default implementation will configure the ‘shared’ property of the media.
- do_construct(url) virtual¶
- Parameters:
url (
GstRtsp.RTSPUrl
) – the url used- Returns:
a new
GstRtspServer.RTSPMedia
if the media could be prepared.- Return type:
Construct the media object and create its streams. Implementations should create the needed gstreamer elements and add them to the result object. No state changes should be performed on them yet.
One or more
GstRtspServer.RTSPStream
objects should be created from the result withGstRtspServer.RTSPMedia.create_stream
().After the media is constructed, it can be configured and then prepared with
GstRtspServer.RTSPMedia.prepare
().The returned media will be locked and must be unlocked afterwards.
- do_create_element(url) virtual¶
- Parameters:
url (
GstRtsp.RTSPUrl
) – the url used- Returns:
a new
Gst.Element
.- Return type:
Gst.Element
orNone
Construct and return a
Gst.Element
that is aGst.Bin
containing the elements to use for streaming the media.The bin should contain payloaders pay\%d for each stream. The default implementation of this function returns the bin created from the launch parameter.
- do_gen_key(url) virtual¶
- Parameters:
url (
GstRtsp.RTSPUrl
) –- Return type:
convert url to a key for caching shared
GstRtspServer.RTSPMedia
objects. The default implementation of this function will use the complete URL including the query parameters to return a key.
- do_media_configure(media) virtual¶
- Parameters:
media (
GstRtspServer.RTSPMedia
) –
signal emitted when a media should be configured
- do_media_constructed(media) virtual¶
- Parameters:
media (
GstRtspServer.RTSPMedia
) –
signal emitted when a media was constructed
Signal Details¶
- GstRtspServer.RTSPMediaFactory.signals.media_configure(r_t_s_p_media_factory, object)¶
- Signal Name:
media-configure
- Flags:
- Parameters:
r_t_s_p_media_factory (
GstRtspServer.RTSPMediaFactory
) – The object which received the signalobject (
GstRtspServer.RTSPMedia
) –
- GstRtspServer.RTSPMediaFactory.signals.media_constructed(r_t_s_p_media_factory, object)¶
- Signal Name:
media-constructed
- Flags:
- Parameters:
r_t_s_p_media_factory (
GstRtspServer.RTSPMediaFactory
) – The object which received the signalobject (
GstRtspServer.RTSPMedia
) –
Property Details¶
- GstRtspServer.RTSPMediaFactory.props.bind_mcast_address¶
-
Whether the multicast sockets should be bound to multicast addresses or INADDR_ANY
- GstRtspServer.RTSPMediaFactory.props.buffer_size¶
-
The kernel UDP buffer size to use
- GstRtspServer.RTSPMediaFactory.props.clock¶
-
Clock to be used by the pipelines created for all medias of this factory
- GstRtspServer.RTSPMediaFactory.props.dscp_qos¶
-
The IP DSCP field to use
- GstRtspServer.RTSPMediaFactory.props.enable_rtcp¶
-
Whether the created media should send and receive RTCP
New in version 1.20.
- GstRtspServer.RTSPMediaFactory.props.ensure_keyunit_on_start¶
-
If media from this factory should ensure a key unit when a client connects.
This property will ensure that the stream always starts on a key unit instead of a delta unit which the client would not be able to decode.
Note that this will only affect non-shared medias for now.
New in version 1.24.
- GstRtspServer.RTSPMediaFactory.props.ensure_keyunit_on_start_timeout¶
-
Timeout in milliseconds used to determine if a keyunit should be discarded when a client connects.
If the timeout has been reached a new keyframe will be forced, otherwise the currently blocking keyframe will be used.
This options is only relevant when ensure-keyunit-on-start is enabled.
New in version 1.24.
- GstRtspServer.RTSPMediaFactory.props.eos_shutdown¶
-
Send EOS down the pipeline before shutting down
- GstRtspServer.RTSPMediaFactory.props.latency¶
-
Latency used for receiving media in milliseconds
- GstRtspServer.RTSPMediaFactory.props.launch¶
-
A launch description of the pipeline
- GstRtspServer.RTSPMediaFactory.props.max_mcast_ttl¶
-
The maximum time-to-live value of outgoing multicast packets
- GstRtspServer.RTSPMediaFactory.props.profiles¶
- Name:
profiles
- Type:
- Default Value:
- Flags:
Allowed transfer profiles
- GstRtspServer.RTSPMediaFactory.props.protocols¶
- Name:
protocols
- Type:
- Default Value:
GstRtsp.RTSPLowerTrans.UDP
|GstRtsp.RTSPLowerTrans.UDP_MCAST
|GstRtsp.RTSPLowerTrans.TCP
- Flags:
Allowed lower transport protocols
-
If media from this factory is shared
- GstRtspServer.RTSPMediaFactory.props.stop_on_disconnect¶
-
If media from this factory should be stopped when a client disconnects without TEARDOWN
- GstRtspServer.RTSPMediaFactory.props.suspend_mode¶
- Name:
suspend-mode
- Type:
- Default Value:
- Flags:
Control how media will be suspended
- GstRtspServer.RTSPMediaFactory.props.transport_mode¶
- Name:
transport-mode
- Type:
- Default Value:
- Flags:
If media from this factory is for PLAY or RECORD