Trait gstreamer_rtsp_server::prelude::RTSPMediaExt
source · pub trait RTSPMediaExt: IsA<RTSPMedia> + Sealed + 'static {
Show 94 methods
// Provided methods
fn can_be_shared(&self) -> bool { ... }
fn collect_streams(&self) { ... }
fn create_stream(
&self,
payloader: &impl IsA<Element>,
pad: &impl IsA<Pad>,
) -> RTSPStream { ... }
fn find_stream(&self, control: &str) -> Option<RTSPStream> { ... }
fn address_pool(&self) -> Option<RTSPAddressPool> { ... }
fn base_time(&self) -> Option<ClockTime> { ... }
fn buffer_size(&self) -> u32 { ... }
fn clock(&self) -> Option<Clock> { ... }
fn does_retransmission(&self) -> bool { ... }
fn dscp_qos(&self) -> i32 { ... }
fn element(&self) -> Element { ... }
fn is_ensure_keyunit_on_start(&self) -> bool { ... }
fn ensure_keyunit_on_start_timeout(&self) -> u32 { ... }
fn latency(&self) -> u32 { ... }
fn max_mcast_ttl(&self) -> u32 { ... }
fn multicast_iface(&self) -> Option<GString> { ... }
fn profiles(&self) -> RTSPProfile { ... }
fn protocols(&self) -> RTSPLowerTrans { ... }
fn publish_clock_mode(&self) -> RTSPPublishClockMode { ... }
fn range_string(&self, play: bool, unit: RTSPRangeUnit) -> Option<GString> { ... }
fn is_rate_control(&self) -> bool { ... }
fn rates(&self) -> Option<(f64, f64)> { ... }
fn retransmission_time(&self) -> Option<ClockTime> { ... }
fn status(&self) -> RTSPMediaStatus { ... }
fn stream(&self, idx: u32) -> Option<RTSPStream> { ... }
fn suspend_mode(&self) -> RTSPSuspendMode { ... }
fn time_provider(
&self,
address: Option<&str>,
port: u16,
) -> Option<NetTimeProvider> { ... }
fn transport_mode(&self) -> RTSPTransportMode { ... }
fn has_completed_sender(&self) -> bool { ... }
fn is_bind_mcast_address(&self) -> bool { ... }
fn is_eos_shutdown(&self) -> bool { ... }
fn is_receive_only(&self) -> bool { ... }
fn is_reusable(&self) -> bool { ... }
fn is_shared(&self) -> bool { ... }
fn is_stop_on_disconnect(&self) -> bool { ... }
fn is_time_provider(&self) -> bool { ... }
fn lock(&self) { ... }
fn n_streams(&self) -> u32 { ... }
fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), BoolError> { ... }
fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>) { ... }
fn set_bind_mcast_address(&self, bind_mcast_addr: bool) { ... }
fn set_buffer_size(&self, size: u32) { ... }
fn set_clock(&self, clock: Option<&impl IsA<Clock>>) { ... }
fn set_do_retransmission(&self, do_retransmission: bool) { ... }
fn set_dscp_qos(&self, dscp_qos: i32) { ... }
fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool) { ... }
fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32) { ... }
fn set_eos_shutdown(&self, eos_shutdown: bool) { ... }
fn set_latency(&self, latency: u32) { ... }
fn set_max_mcast_ttl(&self, ttl: u32) -> bool { ... }
fn set_multicast_iface(&self, multicast_iface: Option<&str>) { ... }
fn set_pipeline_state(&self, state: State) { ... }
fn set_profiles(&self, profiles: RTSPProfile) { ... }
fn set_protocols(&self, protocols: RTSPLowerTrans) { ... }
fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode) { ... }
fn set_rate_control(&self, enabled: bool) { ... }
fn set_retransmission_time(&self, time: impl Into<Option<ClockTime>>) { ... }
fn set_reusable(&self, reusable: bool) { ... }
fn set_shared(&self, shared: bool) { ... }
fn set_state(
&self,
state: State,
transports: &[RTSPStreamTransport],
) -> bool { ... }
fn set_stop_on_disconnect(&self, stop_on_disconnect: bool) { ... }
fn set_suspend_mode(&self, mode: RTSPSuspendMode) { ... }
fn set_transport_mode(&self, mode: RTSPTransportMode) { ... }
fn suspend(&self) -> Result<(), BoolError> { ... }
fn unlock(&self) { ... }
fn unprepare(&self) -> Result<(), BoolError> { ... }
fn unsuspend(&self) -> Result<(), BoolError> { ... }
fn use_time_provider(&self, time_provider: bool) { ... }
fn get_property_bind_mcast_address(&self) -> bool { ... }
fn set_time_provider(&self, time_provider: bool) { ... }
fn connect_handle_message<F: Fn(&Self, &Message) -> bool + Send + Sync + 'static>(
&self,
detail: Option<&str>,
f: F,
) -> SignalHandlerId { ... }
fn connect_new_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_new_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_prepared<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_removed_stream<F: Fn(&Self, &RTSPStream) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_target_state<F: Fn(&Self, i32) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_unprepared<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_bind_mcast_address_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_buffer_size_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_clock_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dscp_qos_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_ensure_keyunit_on_start_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_ensure_keyunit_on_start_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_eos_shutdown_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_max_mcast_ttl_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_profiles_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_protocols_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_reusable_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_shared_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_stop_on_disconnect_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_suspend_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_time_provider_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_transport_mode_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn collect_streams(&self)
fn collect_streams(&self)
Find all payloader elements, they should be named pay`din the element of
self, and create
GstRTSPStreams` for them.
Collect all dynamic elements, named dynpay`d`, and add them to the list of dynamic elements.
Find all depayloader elements, they should be named depay`din the element of
self, and create
GstRTSPStreams` for them.
sourcefn create_stream(
&self,
payloader: &impl IsA<Element>,
pad: &impl IsA<Pad>,
) -> RTSPStream
fn create_stream( &self, payloader: &impl IsA<Element>, pad: &impl IsA<Pad>, ) -> RTSPStream
Create a new stream in self
that provides RTP data on pad
.
pad
should be a pad of an element inside self
->element.
§payloader
§pad
a gst::Pad
§Returns
a new RTSPStream
that remains valid for as long
as self
exists.
sourcefn find_stream(&self, control: &str) -> Option<RTSPStream>
fn find_stream(&self, control: &str) -> Option<RTSPStream>
Find a stream in self
with control
as the control uri.
§control
the control of the stream
§Returns
the RTSPStream
with
control uri control
or None
when a stream with that control did
not exist.
sourcefn address_pool(&self) -> Option<RTSPAddressPool>
fn address_pool(&self) -> Option<RTSPAddressPool>
Get the RTSPAddressPool
used as the address pool of self
.
§Returns
the RTSPAddressPool
of self
.
g_object_unref()
after usage.
sourcefn base_time(&self) -> Option<ClockTime>
fn base_time(&self) -> Option<ClockTime>
Get the base_time that is used by the pipeline in self
.
self
must be prepared before this method returns a valid base_time.
§Returns
the base_time used by self
.
sourcefn buffer_size(&self) -> u32
fn buffer_size(&self) -> u32
sourcefn clock(&self) -> Option<Clock>
fn clock(&self) -> Option<Clock>
Get the clock that is used by the pipeline in self
.
self
must be prepared before this method returns a valid clock object.
§Returns
the gst::Clock
used by self
. unref after usage.
sourcefn does_retransmission(&self) -> bool
fn does_retransmission(&self) -> bool
§Returns
Whether retransmission requests will be sent
sourcefn dscp_qos(&self) -> i32
fn dscp_qos(&self) -> i32
Get the configured DSCP QoS of attached media.
§Returns
the DSCP QoS value of attached streams or -1 if disabled.
sourcefn is_ensure_keyunit_on_start(&self) -> bool
fn is_ensure_keyunit_on_start(&self) -> bool
sourcefn ensure_keyunit_on_start_timeout(&self) -> u32
fn ensure_keyunit_on_start_timeout(&self) -> u32
sourcefn max_mcast_ttl(&self) -> u32
fn max_mcast_ttl(&self) -> u32
Get the the maximum time-to-live value of outgoing multicast packets.
§Returns
the maximum time-to-live value of outgoing multicast packets.
sourcefn multicast_iface(&self) -> Option<GString>
fn multicast_iface(&self) -> Option<GString>
Get the multicast interface used for self
.
§Returns
the multicast interface for self
.
g_free()
after usage.
sourcefn profiles(&self) -> RTSPProfile
fn profiles(&self) -> RTSPProfile
sourcefn protocols(&self) -> RTSPLowerTrans
fn protocols(&self) -> RTSPLowerTrans
sourcefn publish_clock_mode(&self) -> RTSPPublishClockMode
fn publish_clock_mode(&self) -> RTSPPublishClockMode
Gets if and how the media clock should be published according to RFC7273.
§Returns
The GstRTSPPublishClockMode
sourcefn range_string(&self, play: bool, unit: RTSPRangeUnit) -> Option<GString>
fn range_string(&self, play: bool, unit: RTSPRangeUnit) -> Option<GString>
sourcefn is_rate_control(&self) -> bool
fn is_rate_control(&self) -> bool
§Returns
whether self
will follow the Rate-Control=no behaviour as specified
in the ONVIF replay spec.
sourcefn rates(&self) -> Option<(f64, f64)>
fn rates(&self) -> Option<(f64, f64)>
Get the rate and applied_rate of the current segment.
§Returns
false
if looking up the rate and applied rate failed. Otherwise
true
is returned and rate
and applied_rate
are set to the rate and
applied_rate of the current segment.
§rate
the rate of the current segment
§applied_rate
the applied_rate of the current segment
sourcefn retransmission_time(&self) -> Option<ClockTime>
fn retransmission_time(&self) -> Option<ClockTime>
Get the amount of time to store retransmission data.
§Returns
the amount of time to store retransmission data.
sourcefn status(&self) -> RTSPMediaStatus
fn status(&self) -> RTSPMediaStatus
Get the status of self
. When self
is busy preparing, this function waits
until self
is prepared or in error.
§Returns
the status of self
.
sourcefn stream(&self, idx: u32) -> Option<RTSPStream>
fn stream(&self, idx: u32) -> Option<RTSPStream>
Retrieve the stream with index idx
from self
.
§idx
the stream index
§Returns
the RTSPStream
at index
idx
or None
when a stream with that index did not exist.
sourcefn suspend_mode(&self) -> RTSPSuspendMode
fn suspend_mode(&self) -> RTSPSuspendMode
sourcefn time_provider(
&self,
address: Option<&str>,
port: u16,
) -> Option<NetTimeProvider>
fn time_provider( &self, address: Option<&str>, port: u16, ) -> Option<NetTimeProvider>
Get the gst_net::NetTimeProvider
for the clock used by self
. The time provider
will listen on address
and port
for client time requests.
§address
an address or None
§port
a port or 0
§Returns
the gst_net::NetTimeProvider
of self
.
sourcefn transport_mode(&self) -> RTSPTransportMode
fn transport_mode(&self) -> RTSPTransportMode
sourcefn has_completed_sender(&self) -> bool
fn has_completed_sender(&self) -> bool
See RTSPStreamExt::is_complete()
, RTSPStreamExt::is_sender()
.
§Returns
whether self
has at least one complete sender stream.
sourcefn is_bind_mcast_address(&self) -> bool
fn is_bind_mcast_address(&self) -> bool
sourcefn is_eos_shutdown(&self) -> bool
fn is_eos_shutdown(&self) -> bool
sourcefn is_reusable(&self) -> bool
fn is_reusable(&self) -> bool
Check if the pipeline for self
can be shared between multiple clients in
theory. This simply returns the value set via set_shared()
.
To know if a media can be shared in practice, i.e. if it’s shareable and
either reusable or was never unprepared before, use
can_be_shared()
.
§Returns
true
if the media can be shared between clients.
sourcefn is_stop_on_disconnect(&self) -> bool
fn is_stop_on_disconnect(&self) -> bool
sourcefn is_time_provider(&self) -> bool
fn is_time_provider(&self) -> bool
Check if self
can provide a gst_net::NetTimeProvider
for its pipeline clock.
Use time_provider()
to get the network clock.
§Returns
true
if self
can provide a gst_net::NetTimeProvider
.
sourcefn lock(&self)
fn lock(&self)
Lock the entire media. This is needed by callers such as rtsp_client to protect the media when it is shared by many clients. The lock prevents that concurrent clients alters the shared media, while one client already is working with it. Typically the lock is taken in external RTSP API calls that uses shared media such as DESCRIBE, SETUP, ANNOUNCE, TEARDOWN, PLAY, PAUSE.
As best practice take the lock as soon as the function get hold of a shared media object. Release the lock right before the function returns.
sourcefn prepare(&self, thread: Option<RTSPThread>) -> Result<(), BoolError>
fn prepare(&self, thread: Option<RTSPThread>) -> Result<(), BoolError>
Prepare self
for streaming. This function will create the objects
to manage the streaming. A pipeline must have been set on self
with
RTSPMediaExtManual::take_pipeline()
.
It will preroll the pipeline and collect vital information about the streams such as the duration.
§thread
a RTSPThread
to run the
bus handler or None
§Returns
true
on success.
sourcefn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>)
fn set_address_pool(&self, pool: Option<&impl IsA<RTSPAddressPool>>)
sourcefn set_bind_mcast_address(&self, bind_mcast_addr: bool)
fn set_bind_mcast_address(&self, bind_mcast_addr: bool)
Decide whether the multicast socket should be bound to a multicast address or INADDR_ANY.
§bind_mcast_addr
the new value
sourcefn set_buffer_size(&self, size: u32)
fn set_buffer_size(&self, size: u32)
sourcefn set_do_retransmission(&self, do_retransmission: bool)
fn set_do_retransmission(&self, do_retransmission: bool)
Set whether retransmission requests will be sent
sourcefn set_dscp_qos(&self, dscp_qos: i32)
fn set_dscp_qos(&self, dscp_qos: i32)
Configure the dscp qos of attached streams to dscp_qos
.
§dscp_qos
a new dscp qos value (0-63, or -1 to disable)
sourcefn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool)
fn set_ensure_keyunit_on_start(&self, ensure_keyunit_on_start: bool)
Set whether or not a keyunit should be ensured when a client connects. It will also configure the streams to drop delta units to ensure that they start on a keyunit.
Note that this will only affect non-shared medias for now.
§ensure_keyunit_on_start
the new value
sourcefn set_ensure_keyunit_on_start_timeout(&self, timeout: u32)
fn set_ensure_keyunit_on_start_timeout(&self, timeout: u32)
Sets the maximum allowed time before the first keyunit is considered expired.
Note that this will only have an effect when ensure-keyunit-on-start is enabled.
§timeout
the new value
sourcefn set_eos_shutdown(&self, eos_shutdown: bool)
fn set_eos_shutdown(&self, eos_shutdown: bool)
Set or unset if an EOS event will be sent to the pipeline for self
before
it is unprepared.
§eos_shutdown
the new value
sourcefn set_latency(&self, latency: u32)
fn set_latency(&self, latency: u32)
sourcefn set_max_mcast_ttl(&self, ttl: u32) -> bool
fn set_max_mcast_ttl(&self, ttl: u32) -> bool
sourcefn set_multicast_iface(&self, multicast_iface: Option<&str>)
fn set_multicast_iface(&self, multicast_iface: Option<&str>)
sourcefn set_pipeline_state(&self, state: State)
fn set_pipeline_state(&self, state: State)
sourcefn set_profiles(&self, profiles: RTSPProfile)
fn set_profiles(&self, profiles: RTSPProfile)
sourcefn set_protocols(&self, protocols: RTSPLowerTrans)
fn set_protocols(&self, protocols: RTSPLowerTrans)
sourcefn set_publish_clock_mode(&self, mode: RTSPPublishClockMode)
fn set_publish_clock_mode(&self, mode: RTSPPublishClockMode)
Sets if and how the media clock should be published according to RFC7273.
§mode
the clock publish mode
sourcefn set_rate_control(&self, enabled: bool)
fn set_rate_control(&self, enabled: bool)
Define whether self
will follow the Rate-Control=no behaviour as specified
in the ONVIF replay spec.
sourcefn set_retransmission_time(&self, time: impl Into<Option<ClockTime>>)
fn set_retransmission_time(&self, time: impl Into<Option<ClockTime>>)
sourcefn set_reusable(&self, reusable: bool)
fn set_reusable(&self, reusable: bool)
Set or unset if the pipeline for self
can be reused after the pipeline has
been unprepared.
§reusable
the new value
sourcefn set_state(&self, state: State, transports: &[RTSPStreamTransport]) -> bool
fn set_state(&self, state: State, transports: &[RTSPStreamTransport]) -> bool
sourcefn set_stop_on_disconnect(&self, stop_on_disconnect: bool)
fn set_stop_on_disconnect(&self, stop_on_disconnect: bool)
Set or unset if the pipeline for self
should be stopped when a
client disconnects without sending TEARDOWN.
§stop_on_disconnect
the new value
sourcefn set_suspend_mode(&self, mode: RTSPSuspendMode)
fn set_suspend_mode(&self, mode: RTSPSuspendMode)
Control how @ media will be suspended after the SDP has been generated and after a PAUSE request has been performed.
Media must be unprepared when setting the suspend mode.
§mode
the new RTSPSuspendMode
sourcefn set_transport_mode(&self, mode: RTSPTransportMode)
fn set_transport_mode(&self, mode: RTSPTransportMode)
sourcefn suspend(&self) -> Result<(), BoolError>
fn suspend(&self) -> Result<(), BoolError>
Suspend self
. The state of the pipeline managed by self
is set to
GST_STATE_NULL but all streams are kept. self
can be prepared again
with unsuspend()
self
must be prepared with prepare()
;
§Returns
true
on success.
sourcefn use_time_provider(&self, time_provider: bool)
fn use_time_provider(&self, time_provider: bool)
Set self
to provide a gst_net::NetTimeProvider
.
§time_provider
if a gst_net::NetTimeProvider
should be used