Top |
Functions
Types and Values
enum | GstRTSPMsgType |
struct | GstRTSPMessage |
struct | GstRTSPAuthCredential |
struct | GstRTSPAuthParam |
Functions
gst_rtsp_message_new ()
GstRTSPResult
gst_rtsp_message_new (GstRTSPMessage **msg
);
Create a new initialized GstRTSPMessage. Free with gst_rtsp_message_free()
.
gst_rtsp_message_init ()
GstRTSPResult
gst_rtsp_message_init (GstRTSPMessage *msg
);
Initialize msg
. This function is mostly used when msg
is allocated on the
stack. The reverse operation of this is gst_rtsp_message_unset()
.
gst_rtsp_message_unset ()
GstRTSPResult
gst_rtsp_message_unset (GstRTSPMessage *msg
);
Unset the contents of msg
so that it becomes an uninitialized
GstRTSPMessage again. This function is mostly used in combination with
gst_rtsp_message_init_request()
, gst_rtsp_message_init_response()
and
gst_rtsp_message_init_data()
on stack allocated GstRTSPMessage structures.
gst_rtsp_message_free ()
GstRTSPResult
gst_rtsp_message_free (GstRTSPMessage *msg
);
Free the memory used by msg
.
gst_rtsp_message_get_type ()
GstRTSPMsgType
gst_rtsp_message_get_type (GstRTSPMessage *msg
);
Get the message type of msg
.
gst_rtsp_message_new_request ()
GstRTSPResult gst_rtsp_message_new_request (GstRTSPMessage **msg
,GstRTSPMethod method
,const gchar *uri
);
Create a new GstRTSPMessage with method
and uri
and store the result
request message in msg
. Free with gst_rtsp_message_free()
.
Parameters
msg |
a location for the new GstRTSPMessage. |
[out][transfer full] |
method |
the request method to use |
|
uri |
the uri of the request. |
[transfer none] |
gst_rtsp_message_init_request ()
GstRTSPResult gst_rtsp_message_init_request (GstRTSPMessage *msg
,GstRTSPMethod method
,const gchar *uri
);
Initialize msg
as a request message with method
and uri
. To clear msg
again, use gst_rtsp_message_unset()
.
gst_rtsp_message_parse_request ()
GstRTSPResult gst_rtsp_message_parse_request (GstRTSPMessage *msg
,GstRTSPMethod *method
,const gchar **uri
,GstRTSPVersion *version
);
Parse the request message msg
and store the values method
, uri
and
version
. The result locations can be NULL
if one is not interested in its
value.
uri
remains valid for as long as msg
is valid and unchanged.
gst_rtsp_message_new_response ()
GstRTSPResult gst_rtsp_message_new_response (GstRTSPMessage **msg
,GstRTSPStatusCode code
,const gchar *reason
,const GstRTSPMessage *request
);
Create a new response GstRTSPMessage with code
and reason
and store the
result message in msg
. Free with gst_rtsp_message_free()
.
When reason
is NULL
, the default reason for code
will be used.
When request
is not NULL
, the relevant headers will be copied to the new
response message.
Parameters
msg |
a location for the new GstRTSPMessage. |
[out][transfer full] |
code |
the status code |
|
reason |
the status reason or |
[transfer none][allow-none] |
request |
the request that triggered the response or |
[transfer none][allow-none] |
gst_rtsp_message_init_response ()
GstRTSPResult gst_rtsp_message_init_response (GstRTSPMessage *msg
,GstRTSPStatusCode code
,const gchar *reason
,const GstRTSPMessage *request
);
Initialize msg
with code
and reason
.
When reason
is NULL
, the default reason for code
will be used.
When request
is not NULL
, the relevant headers will be copied to the new
response message.
gst_rtsp_message_parse_response ()
GstRTSPResult gst_rtsp_message_parse_response (GstRTSPMessage *msg
,GstRTSPStatusCode *code
,const gchar **reason
,GstRTSPVersion *version
);
Parse the response message msg
and store the values code
, reason
and
version
. The result locations can be NULL
if one is not interested in its
value.
reason
remains valid for as long as msg
is valid and unchanged.
gst_rtsp_message_new_data ()
GstRTSPResult gst_rtsp_message_new_data (GstRTSPMessage **msg
,guint8 channel
);
Create a new data GstRTSPMessage with channel
and store the
result message in msg
. Free with gst_rtsp_message_free()
.
gst_rtsp_message_init_data ()
GstRTSPResult gst_rtsp_message_init_data (GstRTSPMessage *msg
,guint8 channel
);
Initialize a new data GstRTSPMessage for channel
.
gst_rtsp_message_parse_data ()
GstRTSPResult gst_rtsp_message_parse_data (GstRTSPMessage *msg
,guint8 *channel
);
Parse the data message msg
and store the channel in channel
.
gst_rtsp_message_add_header ()
GstRTSPResult gst_rtsp_message_add_header (GstRTSPMessage *msg
,GstRTSPHeaderField field
,const gchar *value
);
Add a header with key field
and value
to msg
. This function takes a copy
of value
.
gst_rtsp_message_take_header ()
GstRTSPResult gst_rtsp_message_take_header (GstRTSPMessage *msg
,GstRTSPHeaderField field
,gchar *value
);
Add a header with key field
and value
to msg
. This function takes
ownership of value
.
gst_rtsp_message_remove_header ()
GstRTSPResult gst_rtsp_message_remove_header (GstRTSPMessage *msg
,GstRTSPHeaderField field
,gint indx
);
Remove the indx
header with key field
from msg
. If indx
equals -1, all
headers will be removed.
gst_rtsp_message_get_header ()
GstRTSPResult gst_rtsp_message_get_header (const GstRTSPMessage *msg
,GstRTSPHeaderField field
,gchar **value
,gint indx
);
Get the indx
header value with key field
from msg
. The result in value
stays valid as long as it remains present in msg
.
gst_rtsp_message_add_header_by_name ()
GstRTSPResult gst_rtsp_message_add_header_by_name (GstRTSPMessage *msg
,const gchar *header
,const gchar *value
);
Add a header with key header
and value
to msg
. This function takes a copy
of value
.
Since: 1.6
gst_rtsp_message_take_header_by_name ()
GstRTSPResult gst_rtsp_message_take_header_by_name (GstRTSPMessage *msg
,const gchar *header
,gchar *value
);
Add a header with key header
and value
to msg
. This function takes
ownership of value
, but not of header
.
Parameters
msg |
||
header |
a header string. |
[transfer none] |
value |
the value of the header. |
[transfer full] |
Since: 1.6
gst_rtsp_message_remove_header_by_name ()
GstRTSPResult gst_rtsp_message_remove_header_by_name (GstRTSPMessage *msg
,const gchar *header
,gint index
);
Remove the index
header with key header
from msg
. If index
equals -1,
all matching headers will be removed.
Since: 1.6
gst_rtsp_message_get_header_by_name ()
GstRTSPResult gst_rtsp_message_get_header_by_name (GstRTSPMessage *msg
,const gchar *header
,gchar **value
,gint index
);
Get the index
header value with key header
from msg
. The result in value
stays valid as long as it remains present in msg
.
Parameters
msg |
||
header |
||
value |
pointer to hold the result. |
[out][transfer none] |
index |
the index of the header |
Since: 1.6
gst_rtsp_message_append_headers ()
GstRTSPResult gst_rtsp_message_append_headers (const GstRTSPMessage *msg
,GString *str
);
Append the currently configured headers in msg
to the GString str
suitable
for transmission.
gst_rtsp_message_set_body ()
GstRTSPResult gst_rtsp_message_set_body (GstRTSPMessage *msg
,const guint8 *data
,guint size
);
Set the body of msg
to a copy of data
.
gst_rtsp_message_take_body ()
GstRTSPResult gst_rtsp_message_take_body (GstRTSPMessage *msg
,guint8 *data
,guint size
);
Set the body of msg
to data
and size
. This method takes ownership of
data
.
gst_rtsp_message_get_body ()
GstRTSPResult gst_rtsp_message_get_body (const GstRTSPMessage *msg
,guint8 **data
,guint *size
);
Get the body of msg
. data
remains valid for as long as msg
is valid and
unchanged.
gst_rtsp_message_steal_body ()
GstRTSPResult gst_rtsp_message_steal_body (GstRTSPMessage *msg
,guint8 **data
,guint *size
);
Take the body of msg
and store it in data
and size
. After this method,
the body and size of msg
will be set to NULL
and 0 respectively.
gst_rtsp_message_parse_auth_credentials ()
GstRTSPAuthCredential ** gst_rtsp_message_parse_auth_credentials (GstRTSPMessage *msg
,GstRTSPHeaderField field
);
Parses the credentials given in a WWW-Authenticate or Authorization header.
Since: 1.12
gst_rtsp_auth_credentials_free ()
void
gst_rtsp_auth_credentials_free (GstRTSPAuthCredential **credentials
);
Free a NULL
-terminated array of credentials returned from
gst_rtsp_message_parse_auth_credentials()
.
Since: 1.12
gst_rtsp_message_dump ()
GstRTSPResult
gst_rtsp_message_dump (GstRTSPMessage *msg
);
Dump the contents of msg
to stdout.
Types and Values
struct GstRTSPMessage
struct GstRTSPMessage { GstRTSPMsgType type; union { struct { GstRTSPMethod method; gchar *uri; GstRTSPVersion version; } request; struct { GstRTSPStatusCode code; gchar *reason; GstRTSPVersion version; } response; struct { guint8 channel; } data; } type_data; };
An RTSP message containing request, response or data messages. Depending on
the type
, the appropriate structure may be accessed.
struct GstRTSPAuthCredential
struct GstRTSPAuthCredential { GstRTSPAuthMethod scheme; /* For Basic/Digest WWW-Authenticate and Digest * Authorization */ GstRTSPAuthParam **params; /* NULL terminated */ /* For Basic Authorization */ gchar *authorization; };