GstRTSPSession

GstRTSPSession

Synopsis

                    GstRTSPSession;
                    GstRTSPSessionClass;
                    GstRTSPSessionStream;
                    GstRTSPSessionMedia;
GstRTSPSession *    gst_rtsp_session_new                (const gchar *sessionid);
const gchar *       gst_rtsp_session_get_sessionid      (GstRTSPSession *session);
void                gst_rtsp_session_set_timeout        (GstRTSPSession *session,
                                                         guint timeout);
guint               gst_rtsp_session_get_timeout        (GstRTSPSession *session);
void                gst_rtsp_session_touch              (GstRTSPSession *session);
void                gst_rtsp_session_prevent_expire     (GstRTSPSession *session);
void                gst_rtsp_session_allow_expire       (GstRTSPSession *session);
gint                gst_rtsp_session_next_timeout       (GstRTSPSession *session,
                                                         GTimeVal *now);
gboolean            gst_rtsp_session_is_expired         (GstRTSPSession *session,
                                                         GTimeVal *now);
GstRTSPSessionMedia * gst_rtsp_session_manage_media     (GstRTSPSession *sess,
                                                         const GstRTSPUrl *uri,
                                                         GstRTSPMedia *media);
gboolean            gst_rtsp_session_release_media      (GstRTSPSession *sess,
                                                         GstRTSPSessionMedia *media);
GstRTSPSessionMedia * gst_rtsp_session_get_media        (GstRTSPSession *sess,
                                                         const GstRTSPUrl *url);
gboolean            gst_rtsp_session_media_set_state    (GstRTSPSessionMedia *media,
                                                         GstState state);
GstRTSPSessionStream * gst_rtsp_session_media_get_stream
                                                        (GstRTSPSessionMedia *media,
                                                         guint idx);
gboolean            gst_rtsp_session_media_alloc_channels
                                                        (GstRTSPSessionMedia *media,
                                                         GstRTSPRange *range);
GstRTSPTransport *  gst_rtsp_session_stream_set_transport
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPTransport *ct);
void                gst_rtsp_session_stream_set_callbacks
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPSendFunc send_rtp,
                                                         GstRTSPSendFunc send_rtcp,
                                                         GstRTSPSendListFunc send_rtp_list,
                                                         GstRTSPSendListFunc send_rtcp_list,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);
void                gst_rtsp_session_stream_set_keepalive
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPKeepAliveFunc keep_alive,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Object Hierarchy

  GObject
   +----GstRTSPSession

Properties

  "sessionid"                gchar*                : Read / Write / Construct Only
  "timeout"                  guint                 : Read / Write

Description

Details

GstRTSPSession

typedef struct _GstRTSPSession GstRTSPSession;

Session information kept by the server for a specific client. One client session, identified with a session id, can handle multiple medias identified with the url of a media.


GstRTSPSessionClass

typedef struct {
  GObjectClass  parent_class;
} GstRTSPSessionClass;

GstRTSPSessionStream

typedef struct {
  GstRTSPMediaTrans trans;

  /* the stream of the media */
  GstRTSPMediaStream *media_stream;
} GstRTSPSessionStream;

Configuration of a stream. A stream is an audio or video stream related to a media.

GstRTSPMediaTrans trans;

the media transport

GstRTSPMediaStream *media_stream;

the controlled media stream

GstRTSPSessionMedia

typedef struct {
  /* the url of the media */
  GstRTSPUrl   *url;

  /* the pipeline for the media */
  GstRTSPMedia *media;

  /* the server state */
  GstRTSPState  state;

  /* counter for channels */
  guint         counter;

  /* configuration for the different streams */
  GArray       *streams;
} GstRTSPSessionMedia;

State of a client session regarding a specific media identified by uri.


gst_rtsp_session_new ()

GstRTSPSession *    gst_rtsp_session_new                (const gchar *sessionid);

Create a new GstRTSPSession instance.


gst_rtsp_session_get_sessionid ()

const gchar *       gst_rtsp_session_get_sessionid      (GstRTSPSession *session);

Get the sessionid of session.

session :

a GstRTSPSession

Returns :

the sessionid of session. The value remains valid as long as session is alive.

gst_rtsp_session_set_timeout ()

void                gst_rtsp_session_set_timeout        (GstRTSPSession *session,
                                                         guint timeout);

Configure session for a timeout of timeout seconds. The session will be cleaned up when there is no activity for timeout seconds.

session :

a GstRTSPSession

timeout :

the new timeout

gst_rtsp_session_get_timeout ()

guint               gst_rtsp_session_get_timeout        (GstRTSPSession *session);

Get the timeout value of session.

session :

a GstRTSPSession

Returns :

the timeout of session in seconds.

gst_rtsp_session_touch ()

void                gst_rtsp_session_touch              (GstRTSPSession *session);

Update the last_access time of the session to the current time.

session :

a GstRTSPSession

gst_rtsp_session_prevent_expire ()

void                gst_rtsp_session_prevent_expire     (GstRTSPSession *session);

gst_rtsp_session_allow_expire ()

void                gst_rtsp_session_allow_expire       (GstRTSPSession *session);

gst_rtsp_session_next_timeout ()

gint                gst_rtsp_session_next_timeout       (GstRTSPSession *session,
                                                         GTimeVal *now);

Get the amount of milliseconds till the session will expire.

session :

a GstRTSPSession

now :

the current system time

Returns :

the amount of milliseconds since the session will time out.

gst_rtsp_session_is_expired ()

gboolean            gst_rtsp_session_is_expired         (GstRTSPSession *session,
                                                         GTimeVal *now);

Check if session timeout out.

session :

a GstRTSPSession

now :

the current system time

Returns :

TRUE if session timed out

gst_rtsp_session_manage_media ()

GstRTSPSessionMedia * gst_rtsp_session_manage_media     (GstRTSPSession *sess,
                                                         const GstRTSPUrl *uri,
                                                         GstRTSPMedia *media);

Manage the media object obj in sess. uri will be used to retrieve this media from the session with gst_rtsp_session_get_media().

Ownership is taken from media.

sess :

a GstRTSPSession

uri :

the uri for the media

media :

a GstRTSPMedia

Returns :

a new GstRTSPSessionMedia object.

gst_rtsp_session_release_media ()

gboolean            gst_rtsp_session_release_media      (GstRTSPSession *sess,
                                                         GstRTSPSessionMedia *media);

Release the managed media in sess, freeing the memory allocated by it.

sess :

a GstRTSPSession

media :

a GstRTSPMedia

Returns :

TRUE if there are more media session left in sess.

gst_rtsp_session_get_media ()

GstRTSPSessionMedia * gst_rtsp_session_get_media        (GstRTSPSession *sess,
                                                         const GstRTSPUrl *url);

Get the session media of the url.

sess :

a GstRTSPSession

url :

the url for the media

Returns :

the configuration for url in sess.

gst_rtsp_session_media_set_state ()

gboolean            gst_rtsp_session_media_set_state    (GstRTSPSessionMedia *media,
                                                         GstState state);

Tell the media object media to change to state.

media :

a GstRTSPSessionMedia

state :

the new state

Returns :

TRUE on success.

gst_rtsp_session_media_get_stream ()

GstRTSPSessionStream * gst_rtsp_session_media_get_stream
                                                        (GstRTSPSessionMedia *media,
                                                         guint idx);

Get a previously created or create a new GstRTSPSessionStream at idx.

media :

a GstRTSPSessionMedia

idx :

the stream index

Returns :

a GstRTSPSessionStream that is valid until the session of media is unreffed.

gst_rtsp_session_media_alloc_channels ()

gboolean            gst_rtsp_session_media_alloc_channels
                                                        (GstRTSPSessionMedia *media,
                                                         GstRTSPRange *range);

gst_rtsp_session_stream_set_transport ()

GstRTSPTransport *  gst_rtsp_session_stream_set_transport
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPTransport *ct);

gst_rtsp_session_stream_set_callbacks ()

void                gst_rtsp_session_stream_set_callbacks
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPSendFunc send_rtp,
                                                         GstRTSPSendFunc send_rtcp,
                                                         GstRTSPSendListFunc send_rtp_list,
                                                         GstRTSPSendListFunc send_rtcp_list,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Install callbacks that will be called when data for a stream should be sent to a client. This is usually used when sending RTP/RTCP over TCP.

stream :

a GstRTSPSessionStream

send_rtp :

a callback called when RTP should be sent

send_rtcp :

a callback called when RTCP should be sent

send_rtp_list :

a callback called when RTP should be sent

send_rtcp_list :

a callback called when RTCP should be sent

user_data :

user data passed to callbacks

notify :

called with the user_data when no longer needed.

gst_rtsp_session_stream_set_keepalive ()

void                gst_rtsp_session_stream_set_keepalive
                                                        (GstRTSPSessionStream *stream,
                                                         GstRTSPKeepAliveFunc keep_alive,
                                                         gpointer user_data,
                                                         GDestroyNotify notify);

Install callbacks that will be called when RTCP packets are received from the receiver of stream.

stream :

a GstRTSPSessionStream

keep_alive :

a callback called when the receiver is active

user_data :

user data passed to callback

notify :

called with the user_data when no longer needed.

Property Details

The "sessionid" property

  "sessionid"                gchar*                : Read / Write / Construct Only

the session id.

Default value: NULL


The "timeout" property

  "timeout"                  guint                 : Read / Write

the timeout of the session (0 = never).

Default value: 60