From 3dff14d6b1854964d15a6099643b9ff1e7282fe2 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 24 Jul 2007 19:19:33 +0000 Subject: [PATCH] Added beginnings of RTSP documentation. Original commit message from CVS: * docs/libs/gst-plugins-base-libs-docs.sgml: * docs/libs/gst-plugins-base-libs-sections.txt: * gst-libs/gst/rtsp/gstrtspbase64.c: (gst_rtsp_base64_encode): * gst-libs/gst/rtsp/gstrtspbase64.h: * gst-libs/gst/rtsp/gstrtspconnection.c: (gst_rtsp_connection_connect), (add_auth_header), (gst_rtsp_connection_write), (gst_rtsp_connection_send), (read_body), (gst_rtsp_connection_receive), (gst_rtsp_connection_next_timeout), (gst_rtsp_connection_reset_timeout), (gst_rtsp_connection_set_auth): * gst-libs/gst/rtsp/gstrtspconnection.h: * gst-libs/gst/rtsp/gstrtspdefs.c: (rtsp_init_status): * gst-libs/gst/rtsp/gstrtspdefs.h: * gst-libs/gst/rtsp/gstrtspmessage.h: * gst-libs/gst/rtsp/gstrtsprange.c: (parse_npt_time), (parse_npt_range), (parse_clock_range), (parse_smpte_range), (gst_rtsp_range_parse): * gst-libs/gst/rtsp/gstrtspurl.h: Added beginnings of RTSP documentation. --- ChangeLog | 23 ++++ docs/libs/gst-plugins-base-libs-docs.sgml | 27 ++++- docs/libs/gst-plugins-base-libs-sections.txt | 115 +++++++++++++++++- gst-libs/gst/rtsp/gstrtspbase64.c | 19 ++- gst-libs/gst/rtsp/gstrtspbase64.h | 2 +- gst-libs/gst/rtsp/gstrtspconnection.c | 174 +++++++++++++++++++++++++-- gst-libs/gst/rtsp/gstrtspconnection.h | 44 ++++--- gst-libs/gst/rtsp/gstrtspdefs.c | 72 +++++++++++ gst-libs/gst/rtsp/gstrtspdefs.h | 8 ++ gst-libs/gst/rtsp/gstrtspmessage.h | 16 +++ gst-libs/gst/rtsp/gstrtsprange.c | 8 +- gst-libs/gst/rtsp/gstrtspurl.h | 18 +++ 12 files changed, 488 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a094e0..0bc0d83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,28 @@ 2007-07-24 Wim Taymans + * docs/libs/gst-plugins-base-libs-docs.sgml: + * docs/libs/gst-plugins-base-libs-sections.txt: + * gst-libs/gst/rtsp/gstrtspbase64.c: (gst_rtsp_base64_encode): + * gst-libs/gst/rtsp/gstrtspbase64.h: + * gst-libs/gst/rtsp/gstrtspconnection.c: + (gst_rtsp_connection_connect), (add_auth_header), + (gst_rtsp_connection_write), (gst_rtsp_connection_send), + (read_body), (gst_rtsp_connection_receive), + (gst_rtsp_connection_next_timeout), + (gst_rtsp_connection_reset_timeout), + (gst_rtsp_connection_set_auth): + * gst-libs/gst/rtsp/gstrtspconnection.h: + * gst-libs/gst/rtsp/gstrtspdefs.c: (rtsp_init_status): + * gst-libs/gst/rtsp/gstrtspdefs.h: + * gst-libs/gst/rtsp/gstrtspmessage.h: + * gst-libs/gst/rtsp/gstrtsprange.c: (parse_npt_time), + (parse_npt_range), (parse_clock_range), (parse_smpte_range), + (gst_rtsp_range_parse): + * gst-libs/gst/rtsp/gstrtspurl.h: + Added beginnings of RTSP documentation. + +2007-07-24 Wim Taymans + * docs/libs/Makefile.am: * docs/libs/gst-plugins-base-libs-docs.sgml: * docs/libs/gst-plugins-base-libs-sections.txt: diff --git a/docs/libs/gst-plugins-base-libs-docs.sgml b/docs/libs/gst-plugins-base-libs-docs.sgml index b2e9170..e190d5a 100644 --- a/docs/libs/gst-plugins-base-libs-docs.sgml +++ b/docs/libs/gst-plugins-base-libs-docs.sgml @@ -42,6 +42,14 @@ + + + + + + + + @@ -171,14 +179,29 @@ &GstRtcpBuffer; - + + RTSP Library + + This library should be linked to by getting cflags and libs from + gstreamer-plugins-base-&GST_MAJORMINOR;.pc and adding + -lgstrtsp-&GST_MAJORMINOR; to the library flags. + + &GstRTSPBase64; + &GstRTSPConnection; + &GstRTSPDefs; + &GstRTSPMessage; + &GstRTSPRange; + &GstRTSPTransport; + &GstRTSPUrl; + + + SDP Library This library should be linked to by getting cflags and libs from gstreamer-plugins-base-&GST_MAJORMINOR;.pc and adding -lgstsdp-&GST_MAJORMINOR; to the library flags. - &GstSDP; &GstSDPMessage; diff --git a/docs/libs/gst-plugins-base-libs-sections.txt b/docs/libs/gst-plugins-base-libs-sections.txt index 0733d9d..a4aadb5 100644 --- a/docs/libs/gst-plugins-base-libs-sections.txt +++ b/docs/libs/gst-plugins-base-libs-sections.txt @@ -964,16 +964,121 @@ GST_RTP_PAYLOAD_TS41 GST_RTP_PAYLOAD_TS48 -# sdp +# rtsp
-gstsdp -gst/sdp/sdp.h -GstSDPResult +gstrtspdefs +gst/rtsp/gstrtspdefs.h +GST_RTSP_CHECK +GstRTSPResult +GstRTSPFamily +GstRTSPState +GstRTSPVersion +GstRTSPMethod +GstRTSPAuthMethod +GST_RTSP_AUTH_MAX +GstRTSPHeaderField +GstRTSPStatusCode +gst_rtsp_strresult +gst_rtsp_method_as_text +gst_rtsp_version_as_text +gst_rtsp_header_as_text +gst_rtsp_status_as_text +gst_rtsp_find_header_field +gst_rtsp_find_method +
+ +
+gstrtsptransport +gst/rtsp/gstrtsptransport.h +GstRTSPTransMode +GstRTSPProfile +GstRTSPLowerTrans +GstRTSPTransport +gst_rtsp_transport_new +gst_rtsp_transport_init +gst_rtsp_transport_parse +gst_rtsp_transport_as_text +gst_rtsp_transport_get_mime +gst_rtsp_transport_get_manager +gst_rtsp_transport_free +
+ +
+gstrtspbase64 +gst/rtsp/gstrtspbase64.h +gst_rtsp_base64_encode +
+ +
+gstrtspconnection +gst/rtsp/gstrtspconnection.h +GstRTSPConnection +gst_rtsp_connection_create +gst_rtsp_connection_connect +gst_rtsp_connection_close +gst_rtsp_connection_free +gst_rtsp_connection_read +gst_rtsp_connection_write +gst_rtsp_connection_send +gst_rtsp_connection_receive +gst_rtsp_connection_next_timeout +gst_rtsp_connection_reset_timeout +gst_rtsp_connection_flush +gst_rtsp_connection_set_auth
+gstrtspmessage +gst/rtsp/gstrtspmessage.h +GstRTSPMsgType +gst_rtsp_message_new +gst_rtsp_message_init +gst_rtsp_message_new_request +gst_rtsp_message_init_request +gst_rtsp_message_new_response +gst_rtsp_message_init_response +gst_rtsp_message_init_data +gst_rtsp_message_unset +gst_rtsp_message_free +gst_rtsp_message_add_header +gst_rtsp_message_remove_header +gst_rtsp_message_get_header +gst_rtsp_message_append_headers +gst_rtsp_message_set_body +gst_rtsp_message_take_body +gst_rtsp_message_get_body +gst_rtsp_message_steal_body +gst_rtsp_message_dump +
+ +
+gstrtspurl +gst/rtsp/gstrtspurl.h +GST_RTSP_DEFAULT_PORT +GstRTSPUrl +gst_rtsp_url_parse +gst_rtsp_url_free +gst_rtsp_url_get_request_uri +gst_rtsp_url_set_port +gst_rtsp_url_get_port +
+ +
+gstrtsprange +gst/rtsp/gstrtsrange.h +GstRTSPRangeUnit +GstRTSPTimeRange +GstRTSPTime +GstRTSPTimeType +gst_rtsp_range_parse +gst_rtsp_range_free +
+ +# sdp +
gstsdpmessage -gst/sdp/sdpmessage.h +gst/sdp/gstsdpmessage.h +GstSDPResult GstSDPOrigin GstSDPConnection GST_SDP_BWTYPE_CT diff --git a/gst-libs/gst/rtsp/gstrtspbase64.c b/gst-libs/gst/rtsp/gstrtspbase64.c index 253004a..42f3f67 100644 --- a/gst-libs/gst/rtsp/gstrtspbase64.c +++ b/gst-libs/gst/rtsp/gstrtspbase64.c @@ -17,6 +17,13 @@ * Boston, MA 02111-1307, USA. */ +/** + * SECTION:gstrtspbase64 + * @short_description: Helper function to encode into Base64 + * + * Last reviewed on 2007-07-24 (0.10.14) + */ + #ifdef HAVE_CONFIG_H #include "config.h" #endif @@ -33,9 +40,19 @@ static char base64table[64] = { 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' }; +/** + * gst_rtsp_base64_encode: + * @data: the binary data to encode + * @len: the length of @data + * + * Encode a sequence of binary data into its Base-64 stringified representation. + * + * Returns: a newly allocated, zero-terminated Base-64 encoded string + * representing @data. + */ /* This isn't efficient, but it doesn't need to be */ gchar * -gst_rtsp_base64_encode (gchar * data, gint len) +gst_rtsp_base64_encode (const gchar * data, gsize len) { gchar *out = g_malloc (len * 4 / 3 + 4); gchar *result = out; diff --git a/gst-libs/gst/rtsp/gstrtspbase64.h b/gst-libs/gst/rtsp/gstrtspbase64.h index 24183b0..29804ea 100644 --- a/gst-libs/gst/rtsp/gstrtspbase64.h +++ b/gst-libs/gst/rtsp/gstrtspbase64.h @@ -24,7 +24,7 @@ G_BEGIN_DECLS -gchar *gst_rtsp_base64_encode(gchar *data, gint len); +gchar *gst_rtsp_base64_encode(const gchar *data, gsize len); G_END_DECLS diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 629932b..89a07a6 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -40,6 +40,21 @@ * SOFTWARE. */ +/** + * SECTION:gstrtspconnection + * @short_description: manage RTSP connections + * @see_also: gstrtspurl + * + * + * + * This object manages the RTSP connection to the server. It provides function + * to receive and send bytes and messages. + * + * + * + * Last reviewed on 2007-07-24 (0.10.14) + */ + #ifdef HAVE_CONFIG_H # include #endif @@ -117,6 +132,17 @@ inet_aton (const char *c, struct in_addr *paddr) } #endif +/** + * gst_rtsp_connection_create: + * @url: a #GstRTSPUrl + * @conn: a #GstRTSPConnection + * + * Create a newly allocated #GstRTSPConnection from @url and store it in @conn. + * The connection will not yet attempt to connect to @url, use + * gst_rtsp_connection_connect(). + * + * Returns: #GST_RTSP_OK when @conn contains a valid connection. + */ GstRTSPResult gst_rtsp_connection_create (GstRTSPUrl * url, GstRTSPConnection ** conn) { @@ -168,6 +194,18 @@ no_socket_pair: } } +/** + * gst_rtsp_connection_connect: + * @conn: a #GstRTSPConnection + * @timeout: a #GTimeVal timeout + * + * Attempt to connect to the url of @conn made with + * gst_rtsp_connection_create(). If @timeout is #NULL this function can block + * forever. If @timeout contains a valid timeout, this function will return + * #GST_RTSP_ETIMEOUT after the timeout expired. + * + * Returns: #GST_RTSP_OK when a connection could be made. + */ GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection * conn, GTimeVal * timeout) { @@ -328,6 +366,21 @@ add_date_header (GstRTSPMessage * message) gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string); } +/** + * gst_rtsp_connection_write: + * @conn: a #GstRTSPConnection + * @data: the data to write + * @size: the size of @data + * @timeout: a timeout value or #NULL + * + * Attempt to write @size bytes of @data to the connected @conn, blocking up to + * the specified @timeout. @timeout can be #NULL, in which case this function + * might block forever. + * + * This function can be canceled with gst_rtsp_connection_flush(). + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data, guint size, GTimeVal * timeout) @@ -418,6 +471,20 @@ write_error: } } +/** + * gst_rtsp_connection_send: + * @conn: a #GstRTSPConnection + * @message: the message to send + * @timeout: a timeout value or #NULL + * + * Attempt to send @message to the connected @conn, blocking up to + * the specified @timeout. @timeout can be #NULL, in which case this function + * might block forever. + * + * This function can be canceled with gst_rtsp_connection_flush(). + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection * conn, GstRTSPMessage * message, GTimeVal * timeout) @@ -719,6 +786,21 @@ no_column: } } +/** + * gst_rtsp_connection_read: + * @conn: a #GstRTSPConnection + * @data: the data to read + * @size: the size of @data + * @timeout: a timeout value or #NULL + * + * Attempt to read @size bytes into @data from the connected @conn, blocking up to + * the specified @timeout. @timeout can be #NULL, in which case this function + * might block forever. + * + * This function can be canceled with gst_rtsp_connection_flush(). + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, guint size, GTimeVal * timeout) @@ -863,8 +945,22 @@ read_error: } } +/** + * gst_rtsp_connection_receive: + * @conn: a #GstRTSPConnection + * @message: the message to read + * @timeout: a timeout value or #NULL + * + * Attempt to read into @message from the connected @conn, blocking up to + * the specified @timeout. @timeout can be #NULL, in which case this function + * might block forever. + * + * This function can be canceled with gst_rtsp_connection_flush(). + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult -gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, +gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * message, GTimeVal * timeout) { gchar buffer[4096]; @@ -874,7 +970,7 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, gboolean need_body; g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL); - g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL); + g_return_val_if_fail (message != NULL, GST_RTSP_EINVAL); line = 0; @@ -900,7 +996,7 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, read_error); /* now we create a data message */ - gst_rtsp_message_init_data (msg, c); + gst_rtsp_message_init_data (message, c); /* next two bytes are the length of the data */ GST_RTSP_CHECK (gst_rtsp_connection_read (conn, (guint8 *) & size, 2, @@ -909,7 +1005,7 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, size = GUINT16_FROM_BE (size); /* and read the body */ - res = read_body (conn, size, msg, timeout); + res = read_body (conn, size, message, timeout); need_body = FALSE; break; } else { @@ -934,13 +1030,13 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, if (line == 0) { /* first line, check for response status */ if (g_str_has_prefix (buffer, "RTSP")) { - res = parse_response_status (buffer, msg); + res = parse_response_status (buffer, message); } else { - res = parse_request_line (buffer, msg); + res = parse_request_line (buffer, message); } } else { /* else just parse the line */ - parse_line (buffer, msg); + parse_line (buffer, message); } } line++; @@ -952,16 +1048,16 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * msg, gchar *hdrval; /* see if there is a Content-Length header */ - if (gst_rtsp_message_get_header (msg, GST_RTSP_HDR_CONTENT_LENGTH, + if (gst_rtsp_message_get_header (message, GST_RTSP_HDR_CONTENT_LENGTH, &hdrval, 0) == GST_RTSP_OK) { /* there is, read the body */ content_length = atol (hdrval); - GST_RTSP_CHECK (read_body (conn, content_length, msg, timeout), + GST_RTSP_CHECK (read_body (conn, content_length, message, timeout), read_error); } /* save session id in the connection for further use */ - if (gst_rtsp_message_get_header (msg, GST_RTSP_HDR_SESSION, + if (gst_rtsp_message_get_header (message, GST_RTSP_HDR_SESSION, &session_id, 0) == GST_RTSP_OK) { gint maxlen, i; @@ -1002,6 +1098,14 @@ read_error: } } +/** + * gst_rtsp_connection_close: + * @conn: a #GstRTSPConnection + * + * Close the connected @conn. + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection * conn) { @@ -1030,6 +1134,14 @@ sys_error: } } +/** + * gst_rtsp_connection_free: + * @conn: a #GstRTSPConnection + * + * Close and free @conn. + * + * Returns: #GST_RTSP_OK on success. + */ GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection * conn) { @@ -1049,6 +1161,15 @@ gst_rtsp_connection_free (GstRTSPConnection * conn) return res; } +/** + * gst_rtsp_connection_next_timeout: + * @conn: a #GstRTSPConnection + * @timeout: a timeout + * + * Calculate the next timeout for @conn, storing the result in @timeout. + * + * Returns: #GST_RTSP_OK. + */ GstRTSPResult gst_rtsp_connection_next_timeout (GstRTSPConnection * conn, GTimeVal * timeout) { @@ -1073,6 +1194,14 @@ gst_rtsp_connection_next_timeout (GstRTSPConnection * conn, GTimeVal * timeout) return GST_RTSP_OK; } +/** + * gst_rtsp_connection_reset_timeout: + * @conn: a #GstRTSPConnection + * + * Reset the timeout of @conn. + * + * Returns: #GST_RTSP_OK. + */ GstRTSPResult gst_rtsp_connection_reset_timeout (GstRTSPConnection * conn) { @@ -1083,6 +1212,17 @@ gst_rtsp_connection_reset_timeout (GstRTSPConnection * conn) return GST_RTSP_OK; } +/** + * gst_rtsp_connection_flush: + * @conn: a #GstRTSPConnection + * @flush: start or stop the flush + * + * Start or stop the flushing action on @conn. When flushing, all current + * and future actions on @conn will return #GST_RTSP_EINTR until the connection + * is set to non-flushing mode again. + * + * Returns: #GST_RTSP_OK. + */ GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection * conn, gboolean flush) { @@ -1105,9 +1245,21 @@ gst_rtsp_connection_flush (GstRTSPConnection * conn, gboolean flush) return GST_RTSP_OK; } +/** + * gst_rtsp_connection_set_auth: + * @conn: a #GstRTSPConnection + * @method: authentication method + * @user: the user + * @pass: the password + * + * Configure @conn for authentication mode @method with @user and @pass as the + * user and password respectively. + * + * Returns: #GST_RTSP_OK. + */ GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection * conn, - GstRTSPAuthMethod method, gchar * user, gchar * pass) + GstRTSPAuthMethod method, const gchar * user, const gchar * pass) { /* Digest isn't implemented yet */ if (method == GST_RTSP_AUTH_DIGEST) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.h b/gst-libs/gst/rtsp/gstrtspconnection.h index 7702b2e..e6112ab 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.h +++ b/gst-libs/gst/rtsp/gstrtspconnection.h @@ -51,8 +51,16 @@ G_BEGIN_DECLS -typedef struct _GstRTSPConnection +typedef struct _GstRTSPConnection GstRTSPConnection; + +/** + * GstRTSPConnection: + * + * Opaque RTSP connection object. + */ +struct _GstRTSPConnection { + /*< private >*/ /* URL for the connection */ GstRTSPUrl *url; @@ -71,34 +79,36 @@ typedef struct _GstRTSPConnection GstRTSPAuthMethod auth_method; gchar *username; gchar *passwd; -} GstRTSPConnection; +}; /* opening/closing a connection */ -GstRTSPResult gst_rtsp_connection_create (GstRTSPUrl *url, GstRTSPConnection **conn); -GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout); -GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn); -GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn); +GstRTSPResult gst_rtsp_connection_create (GstRTSPUrl *url, GstRTSPConnection **conn); +GstRTSPResult gst_rtsp_connection_connect (GstRTSPConnection *conn, GTimeVal *timeout); +GstRTSPResult gst_rtsp_connection_close (GstRTSPConnection *conn); +GstRTSPResult gst_rtsp_connection_free (GstRTSPConnection *conn); /* sending/receiving raw bytes */ -GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, - guint size, GTimeVal * timeout); -GstRTSPResult gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data, - guint size, GTimeVal * timeout); +GstRTSPResult gst_rtsp_connection_read (GstRTSPConnection * conn, guint8 * data, + guint size, GTimeVal * timeout); +GstRTSPResult gst_rtsp_connection_write (GstRTSPConnection * conn, const guint8 * data, + guint size, GTimeVal * timeout); /* sending/receiving messages */ -GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection *conn, GstRTSPMessage *message, GTimeVal *timeout); -GstRTSPResult gst_rtsp_connection_receive (GstRTSPConnection *conn, GstRTSPMessage *message, GTimeVal *timeout); +GstRTSPResult gst_rtsp_connection_send (GstRTSPConnection *conn, GstRTSPMessage *message, + GTimeVal *timeout); +GstRTSPResult gst_rtsp_connection_receive (GstRTSPConnection *conn, GstRTSPMessage *message, + GTimeVal *timeout); /* reset the timeout */ -GstRTSPResult gst_rtsp_connection_next_timeout (GstRTSPConnection *conn, GTimeVal *timeout); -GstRTSPResult gst_rtsp_connection_reset_timeout (GstRTSPConnection *conn); +GstRTSPResult gst_rtsp_connection_next_timeout (GstRTSPConnection *conn, GTimeVal *timeout); +GstRTSPResult gst_rtsp_connection_reset_timeout (GstRTSPConnection *conn); /* flushing state */ -GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection *conn, gboolean flush); +GstRTSPResult gst_rtsp_connection_flush (GstRTSPConnection *conn, gboolean flush); /* Configure Authentication data */ -GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection *conn, GstRTSPAuthMethod method, - gchar *user, gchar *pass); +GstRTSPResult gst_rtsp_connection_set_auth (GstRTSPConnection *conn, GstRTSPAuthMethod method, + const gchar *user, const gchar *pass); G_END_DECLS diff --git a/gst-libs/gst/rtsp/gstrtspdefs.c b/gst-libs/gst/rtsp/gstrtspdefs.c index 921692a..834bd60 100644 --- a/gst-libs/gst/rtsp/gstrtspdefs.c +++ b/gst-libs/gst/rtsp/gstrtspdefs.c @@ -40,6 +40,20 @@ * SOFTWARE. */ +/** + * SECTION:gstrtspdefs + * @short_description: common RTSP defines + * @see_also: gstrtspurl, gstrtspconnection + * + * + * + * Provides common defines for the RTSP library. + * + * + * + * Last reviewed on 2007-07-24 (0.10.14) + */ + #include extern int h_errno; @@ -209,6 +223,14 @@ rtsp_init_status (void) return statuses; } +/** + * gst_rtsp_strresult: + * @result: a #GstRTSPResult + * + * Convert @result in a human readable string. + * + * Returns: a newly allocated string. g_free() after usage. + */ gchar * gst_rtsp_strresult (GstRTSPResult result) { @@ -241,6 +263,14 @@ gst_rtsp_strresult (GstRTSPResult result) return res; } +/** + * gst_rtsp_method_as_text: + * @method: a #GstRTSPMethod + * + * Convert @method to a string. + * + * Returns: a string representation of @method. + */ const gchar * gst_rtsp_method_as_text (GstRTSPMethod method) { @@ -257,6 +287,14 @@ gst_rtsp_method_as_text (GstRTSPMethod method) return rtsp_methods[i]; } +/** + * gst_rtsp_version_as_text: + * @version: a #GstRTSPVersion + * + * Convert @version to a string. + * + * Returns: a string representation of @version. + */ const gchar * gst_rtsp_version_as_text (GstRTSPVersion version) { @@ -269,6 +307,14 @@ gst_rtsp_version_as_text (GstRTSPVersion version) } } +/** + * gst_rtsp_header_as_text: + * @field: a #GstRTSPHeaderField + * + * Convert @field to a string. + * + * Returns: a string representation of @field. + */ const gchar * gst_rtsp_header_as_text (GstRTSPHeaderField field) { @@ -278,6 +324,14 @@ gst_rtsp_header_as_text (GstRTSPHeaderField field) return rtsp_headers[field - 1]; } +/** + * gst_rtsp_status_as_text: + * @code: a #GstRTSPStatusCode + * + * Convert @code to a string. + * + * Returns: a string representation of @code. + */ const gchar * gst_rtsp_status_as_text (GstRTSPStatusCode code) { @@ -289,6 +343,15 @@ gst_rtsp_status_as_text (GstRTSPStatusCode code) return g_hash_table_lookup (statuses, GUINT_TO_POINTER (code)); } +/** + * gst_rtsp_find_header_field: + * @header: a header string + * + * Convert @header to a #GstRTSPHeaderField. + * + * Returns: a #GstRTSPHeaderField for @header or #GST_RTSP_HDR_INVALID if the + * header field is unknown. + */ GstRTSPHeaderField gst_rtsp_find_header_field (const gchar * header) { @@ -302,6 +365,15 @@ gst_rtsp_find_header_field (const gchar * header) return GST_RTSP_HDR_INVALID; } +/** + * gst_rtsp_find_method: + * @method: a method + * + * Convert @method to a #GstRTSPMethod. + * + * Returns: a #GstRTSPMethod for @method or #GST_RTSP_INVALID if the + * method is unknown. + */ GstRTSPMethod gst_rtsp_find_method (const gchar * method) { diff --git a/gst-libs/gst/rtsp/gstrtspdefs.h b/gst-libs/gst/rtsp/gstrtspdefs.h index 28a1c06..2e79028 100644 --- a/gst-libs/gst/rtsp/gstrtspdefs.h +++ b/gst-libs/gst/rtsp/gstrtspdefs.h @@ -47,6 +47,14 @@ G_BEGIN_DECLS +/** + * GST_RTSP_CHECK: + * @stmt: a statement + * @label: a label + * + * Macro that checks the return value of @stmt and jumps to @label when it does + * not equal #GST_RTSP_OK. + */ #define GST_RTSP_CHECK(stmt, label) \ G_STMT_START { \ if (G_UNLIKELY ((res = (stmt)) != GST_RTSP_OK)) \ diff --git a/gst-libs/gst/rtsp/gstrtspmessage.h b/gst-libs/gst/rtsp/gstrtspmessage.h index ee65422..d78c7a0 100644 --- a/gst-libs/gst/rtsp/gstrtspmessage.h +++ b/gst-libs/gst/rtsp/gstrtspmessage.h @@ -49,6 +49,15 @@ G_BEGIN_DECLS +/** + * GstRTSPMsgType: + * @GST_RTSP_MESSAGE_INVALID: invalid message type + * @GST_RTSP_MESSAGE_REQUEST: request message + * @GST_RTSP_MESSAGE_RESPONSE: response message + * @GST_RTSP_MESSAGE_DATA: data message + * + * The type of a message. + */ typedef enum { GST_RTSP_MESSAGE_INVALID, @@ -57,6 +66,12 @@ typedef enum GST_RTSP_MESSAGE_DATA, } GstRTSPMsgType; +/** + * GstRTSPMessage: + * @type: the message type + * + * An RTSP message containing request, response or data messages. + */ typedef struct _GstRTSPMessage { GstRTSPMsgType type; @@ -77,6 +92,7 @@ typedef struct _GstRTSPMessage } data; } type_data; + /*< private >*/ GArray *hdr_fields; guint8 *body; diff --git a/gst-libs/gst/rtsp/gstrtsprange.c b/gst-libs/gst/rtsp/gstrtsprange.c index 7ba8449..daa914e 100644 --- a/gst-libs/gst/rtsp/gstrtsprange.c +++ b/gst-libs/gst/rtsp/gstrtsprange.c @@ -115,7 +115,7 @@ parse_smpte_range (const gchar * str, GstRTSPTimeRange * range) } /** - * rtsp_range_parse: + * gst_rtsp_range_parse: * @rangestr: a range string to parse * @range: location to hold the #GstRTSPTimeRange result * @@ -166,6 +166,12 @@ invalid: } } +/** + * gst_rtsp_range_free: + * @range: a #GstRTSPTimeRange + * + * Free the memory alocated by @range. + */ void gst_rtsp_range_free (GstRTSPTimeRange * range) { diff --git a/gst-libs/gst/rtsp/gstrtspurl.h b/gst-libs/gst/rtsp/gstrtspurl.h index cbe6cca..39ad316 100644 --- a/gst-libs/gst/rtsp/gstrtspurl.h +++ b/gst-libs/gst/rtsp/gstrtspurl.h @@ -50,10 +50,28 @@ G_BEGIN_DECLS +/** + * GST_RTSP_DEFAULT_PORT: + * + * The default RTSP port to connect to. + */ #define GST_RTSP_DEFAULT_PORT 554 typedef struct _GstRTSPUrl GstRTSPUrl; +/** + * GstRTSPUrl: + * @transports: the transports allowed + * @family: the family + * @user: the user + * @passwd: the password + * @host: the host + * @port: the port + * @abspath: the absolute path + * @query: additional query parameters + * + * This structure contains the result of a parsed RTSP URL + */ struct _GstRTSPUrl { GstRTSPLowerTrans transports; GstRTSPFamily family; -- 2.7.4