Trait gstreamer_rtsp_server::prelude::RTSPSessionPoolExt [−][src]
pub trait RTSPSessionPoolExt: 'static { fn cleanup(&self) -> u32; fn create(&self) -> Result<RTSPSession, BoolError>; fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>; fn find(&self, sessionid: &str) -> Option<RTSPSession>; fn max_sessions(&self) -> u32; fn n_sessions(&self) -> u32; fn remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), BoolError>; fn set_max_sessions(&self, max: u32); fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId; fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId; }
Expand description
Required methods
Inspect all the sessions in self
and remove the sessions that are inactive
for more than their timeout.
Returns
the amount of sessions that got removed.
fn create(&self) -> Result<RTSPSession, BoolError>
[src]
fn create(&self) -> Result<RTSPSession, BoolError>
[src]fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
[src]
fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
[src]Call func
for each session in self
. The result value of func
determines
what happens to the session. func
will be called with the session pool
locked so no further actions on self
can be performed from func
.
If func
returns RTSPFilterResult::Remove
, the session will be set to the
expired state and removed from self
.
If func
returns RTSPFilterResult::Keep
, the session will remain in self
.
If func
returns RTSPFilterResult::Ref
, the session 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 sessions.
func
a callback
Returns
a GList with all
sessions for which func
returned RTSPFilterResult::Ref
. After usage, each
element in the GList should be unreffed before the list is freed.
fn find(&self, sessionid: &str) -> Option<RTSPSession>
[src]
fn find(&self, sessionid: &str) -> Option<RTSPSession>
[src]Find the session with sessionid
in self
. The access time of the session
will be updated with RTSPSessionExt::touch()
.
sessionid
the session id
Returns
the RTSPSession
with sessionid
or None
when the session did not exist. g_object_unref()
after usage.
fn max_sessions(&self) -> u32
[src]
fn max_sessions(&self) -> u32
[src]Get the maximum allowed number of sessions in self
. 0 means an unlimited
amount of sessions.
Returns
the maximum allowed number of sessions.
fn n_sessions(&self) -> u32
[src]
fn n_sessions(&self) -> u32
[src]fn set_max_sessions(&self, max: u32)
[src]
fn set_max_sessions(&self, max: u32)
[src]Configure the maximum allowed number of sessions in self
to max
.
A value of 0 means an unlimited amount of sessions.
max
the maximum number of sessions
fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]Implementors
fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
[src]fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]