| GStreamer RTSP Server Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Properties | ||||
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);
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.
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 |
the media transport |
GstRTSPMediaStream * |
the controlled media stream |
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.
GstRTSPSession * gst_rtsp_session_new (const gchar *sessionid);
Create a new GstRTSPSession instance.
|
|
Returns : |
const gchar * gst_rtsp_session_get_sessionid (GstRTSPSession *session);
Get the sessionid of session.
|
a GstRTSPSession |
Returns : |
the sessionid of session. The value remains valid as long as
session is alive.
|
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.
|
a GstRTSPSession |
|
the new timeout |
guint gst_rtsp_session_get_timeout (GstRTSPSession *session);
Get the timeout value of session.
|
a GstRTSPSession |
Returns : |
the timeout of session in seconds.
|
void gst_rtsp_session_touch (GstRTSPSession *session);
Update the last_access time of the session to the current time.
|
a GstRTSPSession |
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);
Get the amount of milliseconds till the session will expire.
|
a GstRTSPSession |
|
the current system time |
Returns : |
the amount of milliseconds since the session will time out. |
gboolean gst_rtsp_session_is_expired (GstRTSPSession *session,GTimeVal *now);
Check if session timeout out.
|
a GstRTSPSession |
|
the current system time |
Returns : |
TRUE if session timed out
|
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.
|
a GstRTSPSession |
|
the uri for the media |
|
a GstRTSPMedia |
Returns : |
a new GstRTSPSessionMedia object.
|
gboolean gst_rtsp_session_release_media (GstRTSPSession *sess,GstRTSPSessionMedia *media);
Release the managed media in sess, freeing the memory allocated by it.
|
a GstRTSPSession |
|
a GstRTSPMedia |
Returns : |
TRUE if there are more media session left in sess.
|
GstRTSPSessionMedia * gst_rtsp_session_get_media (GstRTSPSession *sess,const GstRTSPUrl *url);
Get the session media of the url.
|
a GstRTSPSession |
|
the url for the media |
Returns : |
the configuration for url in sess.
|
gboolean gst_rtsp_session_media_set_state (GstRTSPSessionMedia *media,GstState state);
Tell the media object media to change to state.
|
a GstRTSPSessionMedia |
|
the new state |
Returns : |
TRUE on success.
|
GstRTSPSessionStream * gst_rtsp_session_media_get_stream (GstRTSPSessionMedia *media,guint idx);
Get a previously created or create a new GstRTSPSessionStream at idx.
|
a GstRTSPSessionMedia |
|
the stream index |
Returns : |
a GstRTSPSessionStream that is valid until the session of media
is unreffed.
|
gboolean gst_rtsp_session_media_alloc_channels (GstRTSPSessionMedia *media,GstRTSPRange *range);
|
|
|
|
Returns : |
GstRTSPTransport * gst_rtsp_session_stream_set_transport (GstRTSPSessionStream *stream,GstRTSPTransport *ct);
|
|
|
|
Returns : |
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.
|
a GstRTSPSessionStream |
|
a callback called when RTP should be sent |
|
a callback called when RTCP should be sent |
|
user data passed to callbacks |
|
called with the user_data when no longer needed. |
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.
|
a GstRTSPSessionStream |
|
a callback called when the receiver is active |
|
user data passed to callback |
|
called with the user_data when no longer needed. |