Trait gstreamer_rtsp_server::prelude::RTSPSessionExt
source · pub trait RTSPSessionExt: IsA<RTSPSession> + Sealed + 'static {
Show 19 methods
// Provided methods
fn allow_expire(&self) { ... }
fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult>,
) -> Vec<RTSPSessionMedia> { ... }
fn header(&self) -> Option<GString> { ... }
fn sessionid(&self) -> Option<GString> { ... }
fn timeout(&self) -> u32 { ... }
fn is_expired_usec(&self, now: i64) -> bool { ... }
fn manage_media(
&self,
path: &str,
media: impl IsA<RTSPMedia>,
) -> RTSPSessionMedia { ... }
fn next_timeout_usec(&self, now: i64) -> i32 { ... }
fn prevent_expire(&self) { ... }
fn release_media(&self, media: &impl IsA<RTSPSessionMedia>) -> bool { ... }
fn set_timeout(&self, timeout: u32) { ... }
fn touch(&self) { ... }
fn extra_timeout(&self) -> u32 { ... }
fn set_extra_timeout(&self, extra_timeout: u32) { ... }
fn is_timeout_always_visible(&self) -> bool { ... }
fn set_timeout_always_visible(&self, timeout_always_visible: bool) { ... }
fn connect_extra_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_timeout_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_timeout_always_visible_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}
Expand description
Provided Methods§
sourcefn allow_expire(&self)
fn allow_expire(&self)
Allow self
to expire. This method must be called an equal
amount of time as prevent_expire()
.
sourcefn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult>,
) -> Vec<RTSPSessionMedia>
fn filter( &self, func: Option<&mut dyn FnMut(&RTSPSession, &RTSPSessionMedia) -> RTSPFilterResult>, ) -> Vec<RTSPSessionMedia>
Call func
for each media in self
. The result value of func
determines
what happens to the media. func
will be called with self
locked so no further actions on self
can be performed from func
.
If func
returns RTSPFilterResult::Remove
, the media will be removed from
self
.
If func
returns RTSPFilterResult::Keep
, the media will remain in self
.
If func
returns RTSPFilterResult::Ref
, the media will remain in self
but
will also be added with an additional ref to the result GList
of this
function..
When func
is None
, RTSPFilterResult::Ref
will be assumed for all media.
§func
a callback
§Returns
a GList with all
media for which func
returned RTSPFilterResult::Ref
. After usage, each
element in the GList
should be unreffed before the list is freed.
sourcefn header(&self) -> Option<GString>
fn header(&self) -> Option<GString>
Get the string that can be placed in the Session header field.
§Returns
the Session header of self
.
g_free()
after usage.
sourcefn sessionid(&self) -> Option<GString>
fn sessionid(&self) -> Option<GString>
Get the sessionid of self
.
§Returns
the sessionid of self
.
The value remains valid as long as self
is alive.
sourcefn is_expired_usec(&self, now: i64) -> bool
fn is_expired_usec(&self, now: i64) -> bool
sourcefn manage_media(
&self,
path: &str,
media: impl IsA<RTSPMedia>,
) -> RTSPSessionMedia
fn manage_media( &self, path: &str, media: impl IsA<RTSPMedia>, ) -> RTSPSessionMedia
Manage the media object obj
in self
. path
will be used to retrieve this
media from the session with RTSPSessionExtManual::media()
.
Ownership is taken from media
.
§path
the path for the media
§media
§Returns
a new RTSPSessionMedia
object.
sourcefn next_timeout_usec(&self, now: i64) -> i32
fn next_timeout_usec(&self, now: i64) -> i32
sourcefn prevent_expire(&self)
fn prevent_expire(&self)
Prevent self
from expiring.
sourcefn release_media(&self, media: &impl IsA<RTSPSessionMedia>) -> bool
fn release_media(&self, media: &impl IsA<RTSPSessionMedia>) -> bool
sourcefn set_timeout(&self, timeout: u32)
fn set_timeout(&self, timeout: u32)
Configure self
for a timeout of timeout
seconds. The session will be
cleaned up when there is no activity for timeout
seconds.
§timeout
the new timeout