summaryrefslogtreecommitdiffstats
path: root/gst/rtsp/rtspmessage.c
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-09-20 16:06:27 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-09-20 16:06:27 +0000
commita365a29c77d2ca41fcd3e15f22d24e7fe8f05e02 (patch)
treebcb6509cd572d4e74269f9de7afebd1220de55fc /gst/rtsp/rtspmessage.c
parenta7d7309e18dca433661058e54651c2d1b78edc6a (diff)
gst/rtsp/URLS: Added some test URLS.
Original commit message from CVS: * gst/rtsp/URLS: Added some test URLS. * gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_create_stream), (gst_rtspsrc_loop), (gst_rtspsrc_open): * gst/rtsp/gstrtspsrc.h: When creating streams, give access to the complete SDP. Fix some leaks. Collect and merge global stream properties in stream caps. Preliminary support for WMServer. * gst/rtsp/rtspconnection.c: (rtsp_connection_create), (rtsp_connection_connect), (rtsp_connection_read), (read_body), (rtsp_connection_receive): * gst/rtsp/rtspconnection.h: Make connection interruptable. Refactor to make it reconnectable. Don't fail on short reads when reading data packets. * gst/rtsp/rtspurl.c: (rtsp_url_parse), (rtsp_url_set_port), (rtsp_url_get_port): * gst/rtsp/rtspurl.h: Add methods for getting/setting the port. * gst/rtsp/sdpmessage.c: (sdp_message_get_attribute_val_n), (sdp_message_get_attribute_val), (sdp_media_get_attribute), (sdp_media_get_attribute_val_n), (sdp_media_get_attribute_val), (sdp_media_get_format), (sdp_parse_line), (sdp_message_parse_buffer): Fix headers. Add methods for getting multiple attributes with the same name. Increase buffer size when parsing. Fix parsing of a=foo fields. * gst/rtsp/test.c: (main): Update to new connection API. * gst/rtsp/rtspmessage.c: (rtsp_message_new_response), (rtsp_message_init_response), (rtsp_message_init_data), (rtsp_message_unset), (rtsp_message_free), (rtsp_message_dump): * gst/rtsp/rtspmessage.h: * gst/rtsp/rtsptransport.c: (rtsp_transport_free): * gst/rtsp/rtsptransport.h: * gst/rtsp/sdp.h: * gst/rtsp/sdpmessage.h: * gst/rtsp/gstrtsp.c: * gst/rtsp/gstrtsp.h: * gst/rtsp/gstrtpdec.c: * gst/rtsp/gstrtpdec.h: * gst/rtsp/rtsp.h: * gst/rtsp/rtspdefs.c: * gst/rtsp/rtspdefs.h: Dual licensed under MIT and LGPL now.
Diffstat (limited to 'gst/rtsp/rtspmessage.c')
-rw-r--r--gst/rtsp/rtspmessage.c90
1 files changed, 59 insertions, 31 deletions
diff --git a/gst/rtsp/rtspmessage.c b/gst/rtsp/rtspmessage.c
index bd1473bb..333661d0 100644
--- a/gst/rtsp/rtspmessage.c
+++ b/gst/rtsp/rtspmessage.c
@@ -1,5 +1,6 @@
/* GStreamer
- * Copyright (C) <2005> Wim Taymans <wim@fluendo.com>
+ * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
+ * <2006> Lutz Mueller <lutz at topfrose dot de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -16,6 +17,29 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+/*
+ * Unless otherwise indicated, Source Code is licensed under MIT license.
+ * See further explanation attached in License Statement (distributed in the file
+ * LICENSE).
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
#include "rtspmessage.h"
@@ -282,36 +306,40 @@ rtsp_message_dump (RTSPMessage * msg)
g_return_val_if_fail (msg != NULL, RTSP_EINVAL);
- if (msg->type == RTSP_MESSAGE_REQUEST) {
- g_print ("request message %p\n", msg);
- g_print (" request line:\n");
- g_print (" method: '%s'\n",
- rtsp_method_as_text (msg->type_data.request.method));
- g_print (" uri: '%s'\n", msg->type_data.request.uri);
- g_print (" headers:\n");
- g_hash_table_foreach (msg->hdr_fields, dump_key_value, NULL);
- g_print (" body:\n");
- rtsp_message_get_body (msg, &data, &size);
- dump_mem (data, size);
- } else if (msg->type == RTSP_MESSAGE_RESPONSE) {
- g_print ("response message %p\n", msg);
- g_print (" status line:\n");
- g_print (" code: '%d'\n", msg->type_data.response.code);
- g_print (" reason: '%s'\n", msg->type_data.response.reason);
- g_print (" headers:\n");
- g_hash_table_foreach (msg->hdr_fields, dump_key_value, NULL);
- rtsp_message_get_body (msg, &data, &size);
- g_print (" body: length %d\n", size);
- dump_mem (data, size);
- } else if (msg->type == RTSP_MESSAGE_DATA) {
- g_print ("data message %p\n", msg);
- g_print (" channel: '%d'\n", msg->type_data.data.channel);
- g_print (" size: '%d'\n", msg->body_size);
- rtsp_message_get_body (msg, &data, &size);
- dump_mem (data, size);
- } else {
- g_print ("unsupported packet type %d\n", msg->type);
- return RTSP_EINVAL;
+ switch (msg->type) {
+ case RTSP_MESSAGE_REQUEST:
+ g_print ("request message %p\n", msg);
+ g_print (" request line:\n");
+ g_print (" method: '%s'\n",
+ rtsp_method_as_text (msg->type_data.request.method));
+ g_print (" uri: '%s'\n", msg->type_data.request.uri);
+ g_print (" headers:\n");
+ g_hash_table_foreach (msg->hdr_fields, dump_key_value, NULL);
+ g_print (" body:\n");
+ rtsp_message_get_body (msg, &data, &size);
+ dump_mem (data, size);
+ break;
+ case RTSP_MESSAGE_RESPONSE:
+ g_print ("response message %p\n", msg);
+ g_print (" status line:\n");
+ g_print (" code: '%d'\n", msg->type_data.response.code);
+ g_print (" reason: '%s'\n", msg->type_data.response.reason);
+ g_print (" headers:\n");
+ g_hash_table_foreach (msg->hdr_fields, dump_key_value, NULL);
+ rtsp_message_get_body (msg, &data, &size);
+ g_print (" body: length %d\n", size);
+ dump_mem (data, size);
+ break;
+ case RTSP_MESSAGE_DATA:
+ g_print ("data message %p\n", msg);
+ g_print (" channel: '%d'\n", msg->type_data.data.channel);
+ g_print (" size: '%d'\n", msg->body_size);
+ rtsp_message_get_body (msg, &data, &size);
+ dump_mem (data, size);
+ break;
+ default:
+ g_print ("unsupported message type %d\n", msg->type);
+ return RTSP_EINVAL;
}
return RTSP_OK;
}