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; }
Required methods
fn cleanup(&self) -> u32
[src]
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 filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
[src]
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
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 crate::RTSPFilterResult::Remove
, the session will be set to the
expired state and removed from self
.
If func
returns crate::RTSPFilterResult::Keep
, the session will remain in self
.
If func
returns crate::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
, crate::RTSPFilterResult::Ref
will be assumed for all sessions.
func
a callback
user_data
user data passed to func
Returns
a GList with all
sessions for which func
returned crate::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]
Find the session with sessionid
in self
. The access time of the session
will be updated with crate::prelude::RTSPSessionExt::touch()
.
sessionid
the session id
Returns
the crate::RTSPSession
with sessionid
or None
when the session did not exist. [crate::glib::object::ObjectExt::unref()
] after usage.
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 remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), BoolError>
[src]
Remove sess
from self
, releasing the ref that the pool has on sess
.
sess
Returns
true
if the session was found and removed.
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]
&self,
f: F
) -> SignalHandlerId
fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
Implementors
impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O
[src]
impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O
[src]fn cleanup(&self) -> u32
[src]
fn create(&self) -> Result<RTSPSession, BoolError>
[src]
fn filter(
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
[src]
&self,
func: Option<&mut dyn FnMut(&RTSPSessionPool, &RTSPSession) -> RTSPFilterResult>
) -> Vec<RTSPSession>
fn find(&self, sessionid: &str) -> Option<RTSPSession>
[src]
fn max_sessions(&self) -> u32
[src]
fn n_sessions(&self) -> u32
[src]
fn remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), BoolError>
[src]
fn set_max_sessions(&self, max: u32)
[src]
fn connect_session_removed<F: Fn(&Self, &RTSPSession) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId
fn connect_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F
) -> SignalHandlerId
[src]
&self,
f: F
) -> SignalHandlerId