Top | ![]() |
![]() |
![]() |
![]() |
gboolean | drop-backlog | Read / Write |
GstRTSPMountPoints * | mount-points | Read / Write |
GstRTSPSessionPool * | session-pool | Read / Write |
void | closed | Run Last |
void | describe-request | Run Last |
void | get-parameter-request | Run Last |
void | handle-response | Run Last |
void | new-session | Run Last |
void | options-request | Run Last |
void | pause-request | Run Last |
void | play-request | Run Last |
void | send-message | Run Last |
void | set-parameter-request | Run Last |
void | setup-request | Run Last |
void | teardown-request | Run Last |
The client object handles the connection with a client for as long as a TCP connection is open.
A GstRTSPClient is created by GstRTSPServer when a new connection is accepted and it inherits the GstRTSPMountPoints, GstRTSPSessionPool, GstRTSPAuth and GstRTSPThreadPool from the server.
The client connection should be configured with the GstRTSPConnection using
gst_rtsp_client_set_connection()
before it can be attached to a GMainContext
using gst_rtsp_client_attach()
. From then on the client will handle requests
on the connection.
Use gst_rtsp_client_session_filter()
to iterate or modify all the
GstRTSPSession objects managed by the client object.
Last reviewed on 2013-07-11 (1.0.0)
GstRTSPClient *
gst_rtsp_client_new (void
);
Create a new GstRTSPClient instance.
void
gst_rtsp_client_close (GstRTSPClient *client
);
Close the connection of client
and remove all media it was managing.
Since 1.4
GstRTSPSessionPool *
gst_rtsp_client_get_session_pool (GstRTSPClient *client
);
Get the GstRTSPSessionPool object that client
uses to manage its sessions.
void gst_rtsp_client_set_session_pool (GstRTSPClient *client
,GstRTSPSessionPool *pool
);
Set pool
as the sessionpool for client
which it will use to find
or allocate sessions. the sessionpool is usually inherited from the server
that created the client but can be overridden later.
GstRTSPMountPoints *
gst_rtsp_client_get_mount_points (GstRTSPClient *client
);
Get the GstRTSPMountPoints object that client
uses to manage its sessions.
void gst_rtsp_client_set_mount_points (GstRTSPClient *client
,GstRTSPMountPoints *mounts
);
Set mounts
as the mount points for client
which it will use to map urls
to media streams. These mount points are usually inherited from the server that
created the client but can be overriden later.
GstRTSPAuth *
gst_rtsp_client_get_auth (GstRTSPClient *client
);
Get the GstRTSPAuth used as the authentication manager of client
.
void gst_rtsp_client_set_auth (GstRTSPClient *client
,GstRTSPAuth *auth
);
configure auth
to be used as the authentication manager of client
.
GstRTSPThreadPool *
gst_rtsp_client_get_thread_pool (GstRTSPClient *client
);
Get the GstRTSPThreadPool used as the thread pool of client
.
void gst_rtsp_client_set_thread_pool (GstRTSPClient *client
,GstRTSPThreadPool *pool
);
configure pool
to be used as the thread pool of client
.
GstRTSPConnection *
gst_rtsp_client_get_connection (GstRTSPClient *client
);
Get the GstRTSPConnection of client
.
the GstRTSPConnection of client
.
The connection object returned remains valid until the client is freed.
[transfer none]
gboolean gst_rtsp_client_set_connection (GstRTSPClient *client
,GstRTSPConnection *conn
);
Set the GstRTSPConnection of client
. This function takes ownership of
conn
.
guint gst_rtsp_client_attach (GstRTSPClient *client
,GMainContext *context
);
Attaches client
to context
. When the mainloop for context
is run, the
client will be dispatched. When context
is NULL
, the default context will be
used).
This function should be called when the client properties and urls are fully configured and the client is ready to start.
gboolean (*GstRTSPClientSendFunc) (GstRTSPClient *client
,GstRTSPMessage *message
,gboolean close
,gpointer user_data
);
This callback is called when client
wants to send message
. When close
is
TRUE
, the connection should be closed when the message has been sent.
void gst_rtsp_client_set_send_func (GstRTSPClient *client
,GstRTSPClientSendFunc func
,gpointer user_data
,GDestroyNotify notify
);
Set func
as the callback that will be called when a new message needs to be
sent to the client. user_data
is passed to func
and notify
is called when
user_data
is no longer in use.
By default, the client will send the messages on the GstRTSPConnection that
was configured with gst_rtsp_client_attach()
was called.
GstRTSPResult gst_rtsp_client_handle_message (GstRTSPClient *client
,GstRTSPMessage *message
);
Let the client handle message
.
GstRTSPResult gst_rtsp_client_send_message (GstRTSPClient *client
,GstRTSPSession *session
,GstRTSPMessage *message
);
Send a message message to the remote end. message
must be a
GST_RTSP_MESSAGE_REQUEST or a GST_RTSP_MESSAGE_RESPONSE.
client |
||
session |
a GstRTSPSession to send
the message to or |
[allow-none][transfer none] |
message |
The GstRTSPMessage to send. |
[transfer none] |
GstRTSPFilterResult (*GstRTSPClientSessionFilterFunc) (GstRTSPClient *client
,GstRTSPSession *sess
,gpointer user_data
);
This function will be called by the gst_rtsp_client_session_filter()
. An
implementation should return a value of GstRTSPFilterResult.
When this function returns GST_RTSP_FILTER_REMOVE, sess
will be removed
from client
.
A return value of GST_RTSP_FILTER_KEEP will leave sess
untouched in
client
.
A value of GST_RTSP_FILTER_REF will add sess
to the result GList of
gst_rtsp_client_session_filter()
.
client |
a GstRTSPClient object |
|
sess |
a GstRTSPSession in |
|
user_data |
user data that has been given to |
GList * gst_rtsp_client_session_filter (GstRTSPClient *client
,GstRTSPClientSessionFilterFunc func
,gpointer user_data
);
Call func
for each session managed by client
. The result value of func
determines what happens to the session. func
will be called with client
locked so no further actions on client
can be performed from func
.
If func
returns GST_RTSP_FILTER_REMOVE, the session will be removed from
client
.
If func
returns GST_RTSP_FILTER_KEEP, the session will remain in client
.
If func
returns GST_RTSP_FILTER_REF, the session will remain in client
but
will also be added with an additional ref to the result GList of this
function..
When func
is NULL
, GST_RTSP_FILTER_REF will be assumed for each session.
a GList with all
sessions for which func
returned GST_RTSP_FILTER_REF. After usage, each
element in the GList should be unreffed before the list is freed.
[element-type GstRTSPSession][transfer full]
struct GstRTSPClient;
The client object represents the connection and its state with a client.
struct GstRTSPClientClass { GObjectClass parent_class; GstSDPMessage * (*create_sdp) (GstRTSPClient *client, GstRTSPMedia *media); gboolean (*configure_client_media) (GstRTSPClient * client, GstRTSPMedia * media, GstRTSPStream * stream, GstRTSPContext * ctx); gboolean (*configure_client_transport) (GstRTSPClient * client, GstRTSPContext * ctx, GstRTSPTransport * ct); GstRTSPResult (*params_set) (GstRTSPClient *client, GstRTSPContext *ctx); GstRTSPResult (*params_get) (GstRTSPClient *client, GstRTSPContext *ctx); gchar * (*make_path_from_uri) (GstRTSPClient *client, const GstRTSPUrl *uri); /* signals */ void (*closed) (GstRTSPClient *client); void (*new_session) (GstRTSPClient *client, GstRTSPSession *session); void (*options_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*describe_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*setup_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*play_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*pause_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*teardown_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*set_parameter_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*get_parameter_request) (GstRTSPClient *client, GstRTSPContext *ctx); void (*handle_response) (GstRTSPClient *client, GstRTSPContext *ctx); void (*tunnel_http_response) (GstRTSPClient * client, GstRTSPMessage * request, GstRTSPMessage * response); };
The client class structure.
GObjectClass |
||
called when the SDP needs to be created for media. |
||
called when the stream in media needs to be configured. The default implementation will configure the blocksize on the payloader when spcified in the request headers. |
||
called when the client transport needs to be configured. |
||
set parameters. This function should also initialize the
RTSP response(ctx->response) via a call to |
||
get parameters. This function should also initialize the
RTSP response(ctx->response) via a call to |
||
called when a response to the GET request is about to be sent for a tunneled connection. The response can be modified. Since 1.4 |
“drop-backlog”
property“drop-backlog” gboolean
Drop data when the backlog queue is full.
Flags: Read / Write
Default value: TRUE
“mount-points”
property“mount-points” GstRTSPMountPoints *
The mount points to use for client session.
Flags: Read / Write
“session-pool”
property“session-pool” GstRTSPSessionPool *
The session pool to use for client session.
Flags: Read / Write
“closed”
signalvoid user_function (GstRTSPClient *gstrtspclient, gpointer user_data)
Flags: Run Last
“describe-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“get-parameter-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“handle-response”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“new-session”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPSession *arg1, gpointer user_data)
Flags: Run Last
“options-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“pause-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“play-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“send-message”
signalvoid user_function (GstRTSPClient *client, GstRTSPContext *session, gpointer message, gpointer user_data)
client |
The RTSP client |
|
session |
The session. |
[type GstRtspServer.RTSPSession] |
message |
The message. |
[type GstRtsp.RTSPMessage] |
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“set-parameter-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“setup-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last
“teardown-request”
signalvoid user_function (GstRTSPClient *gstrtspclient, GstRTSPContext *arg1, gpointer user_data)
Flags: Run Last