[][src]Trait gstreamer_rtsp_server::prelude::RTSPSessionPoolExt

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 get_max_sessions(&self) -> u32;
fn get_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_property_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all RTSPSessionPool methods.

Implementors

RTSPSessionPool

Required methods

fn cleanup(&self) -> u32

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>

Create a new RTSPSession object in self.

Returns

a new RTSPSession.

fn filter(
    &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 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

user_data

user data passed to func

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>

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. gobject::ObjectExt::unref after usage.

fn get_max_sessions(&self) -> u32

Get the maximum allowed number of sessions in self. 0 means an unlimited amount of sessions.

Returns

the maximum allowed number of sessions.

fn get_n_sessions(&self) -> u32

Get the amount of active sessions in self.

Returns

the amount of active sessions in self.

fn remove<P: IsA<RTSPSession>>(&self, sess: &P) -> Result<(), BoolError>

Remove sess from self, releasing the ref that the pool has on sess.

sess

a RTSPSession

Returns

true if the session was found and removed.

fn set_max_sessions(&self, max: u32)

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

fn connect_property_max_sessions_notify<F: Fn(&Self) + Send + Sync + 'static>(
    &self,
    f: F
) -> SignalHandlerId

Loading content...

Implementors

impl<O: IsA<RTSPSessionPool>> RTSPSessionPoolExt for O[src]

Loading content...