2 * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
3 * <2006> Lutz Mueller <lutz at topfrose dot de>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
21 * Unless otherwise indicated, Source Code is licensed under MIT license.
22 * See further explanation attached in License Statement (distributed in the file
25 * Permission is hereby granted, free of charge, to any person obtaining a copy of
26 * this software and associated documentation files (the "Software"), to deal in
27 * the Software without restriction, including without limitation the rights to
28 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
29 * of the Software, and to permit persons to whom the Software is furnished to do
30 * so, subject to the following conditions:
32 * The above copyright notice and this permission notice shall be included in all
33 * copies or substantial portions of the Software.
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
38 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
40 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
45 * SECTION:gstrtspmessage
46 * @short_description: RTSP messages
47 * @see_also: gstrtspconnection
49 * Provides methods for creating and parsing request, response and data messages.
51 * Last reviewed on 2007-07-25 (0.10.14)
56 #include <gst/gstutils.h>
57 #include "gstrtspmessage.h"
59 typedef struct _RTSPKeyValue
61 GstRTSPHeaderField field;
66 key_value_foreach (GArray * array, GFunc func, gpointer user_data)
70 g_return_if_fail (array != NULL);
72 for (i = 0; i < array->len; i++) {
73 (*func) (&g_array_index (array, RTSPKeyValue, i), user_data);
78 * gst_rtsp_message_new:
79 * @msg: a location for the new #GstRTSPMessage
81 * Create a new initialized #GstRTSPMessage. Free with gst_rtsp_message_free().
83 * Returns: a #GstRTSPResult.
86 gst_rtsp_message_new (GstRTSPMessage ** msg)
88 GstRTSPMessage *newmsg;
90 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
92 newmsg = g_new0 (GstRTSPMessage, 1);
96 return gst_rtsp_message_init (newmsg);
100 * gst_rtsp_message_init:
101 * @msg: a #GstRTSPMessage
103 * Initialize @msg. This function is mostly used when @msg is allocated on the
104 * stack. The reverse operation of this is gst_rtsp_message_unset().
106 * Returns: a #GstRTSPResult.
109 gst_rtsp_message_init (GstRTSPMessage * msg)
111 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
113 gst_rtsp_message_unset (msg);
115 msg->type = GST_RTSP_MESSAGE_INVALID;
116 msg->hdr_fields = g_array_new (FALSE, FALSE, sizeof (RTSPKeyValue));
122 * gst_rtsp_message_get_type:
123 * @msg: a #GstRTSPMessage
125 * Get the message type of @msg.
127 * Returns: the message type.
130 gst_rtsp_message_get_type (GstRTSPMessage * msg)
132 g_return_val_if_fail (msg != NULL, GST_RTSP_MESSAGE_INVALID);
138 * gst_rtsp_message_new_request:
139 * @msg: a location for the new #GstRTSPMessage
140 * @method: the request method to use
141 * @uri: the uri of the request
143 * Create a new #GstRTSPMessage with @method and @uri and store the result
144 * request message in @msg. Free with gst_rtsp_message_free().
146 * Returns: a #GstRTSPResult.
149 gst_rtsp_message_new_request (GstRTSPMessage ** msg, GstRTSPMethod method,
152 GstRTSPMessage *newmsg;
154 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
155 g_return_val_if_fail (uri != NULL, GST_RTSP_EINVAL);
157 newmsg = g_new0 (GstRTSPMessage, 1);
161 return gst_rtsp_message_init_request (newmsg, method, uri);
165 * gst_rtsp_message_init_request:
166 * @msg: a #GstRTSPMessage
167 * @method: the request method to use
168 * @uri: the uri of the request
170 * Initialize @msg as a request message with @method and @uri. To clear @msg
171 * again, use gst_rtsp_message_unset().
173 * Returns: a #GstRTSPResult.
176 gst_rtsp_message_init_request (GstRTSPMessage * msg, GstRTSPMethod method,
179 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
180 g_return_val_if_fail (uri != NULL, GST_RTSP_EINVAL);
182 gst_rtsp_message_unset (msg);
184 msg->type = GST_RTSP_MESSAGE_REQUEST;
185 msg->type_data.request.method = method;
186 msg->type_data.request.uri = g_strdup (uri);
187 msg->type_data.request.version = GST_RTSP_VERSION_1_0;
188 msg->hdr_fields = g_array_new (FALSE, FALSE, sizeof (RTSPKeyValue));
194 * gst_rtsp_message_parse_request:
195 * @msg: a #GstRTSPMessage
196 * @method: location to hold the method
197 * @uri: location to hold the uri
198 * @version: location to hold the version
200 * Parse the request message @msg and store the values @method, @uri and
201 * @version. The result locations can be #NULL if one is not interested in its
204 * @uri remains valid for as long as @msg is valid and unchanged.
206 * Returns: a #GstRTSPResult.
209 gst_rtsp_message_parse_request (GstRTSPMessage * msg,
210 GstRTSPMethod * method, const gchar ** uri, GstRTSPVersion * version)
212 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
213 g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_REQUEST ||
214 msg->type == GST_RTSP_MESSAGE_HTTP_REQUEST, GST_RTSP_EINVAL);
217 *method = msg->type_data.request.method;
219 *uri = msg->type_data.request.uri;
221 *version = msg->type_data.request.version;
227 * gst_rtsp_message_new_response:
228 * @msg: a location for the new #GstRTSPMessage
229 * @code: the status code
230 * @reason: the status reason or #NULL
231 * @request: the request that triggered the response or #NULL
233 * Create a new response #GstRTSPMessage with @code and @reason and store the
234 * result message in @msg. Free with gst_rtsp_message_free().
236 * When @reason is #NULL, the default reason for @code will be used.
238 * When @request is not #NULL, the relevant headers will be copied to the new
241 * Returns: a #GstRTSPResult.
244 gst_rtsp_message_new_response (GstRTSPMessage ** msg, GstRTSPStatusCode code,
245 const gchar * reason, const GstRTSPMessage * request)
247 GstRTSPMessage *newmsg;
249 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
251 newmsg = g_new0 (GstRTSPMessage, 1);
255 return gst_rtsp_message_init_response (newmsg, code, reason, request);
259 * gst_rtsp_message_init_response:
260 * @msg: a #GstRTSPMessage
261 * @code: the status code
262 * @reason: the status reason or #NULL
263 * @request: the request that triggered the response or #NULL
265 * Initialize @msg with @code and @reason.
267 * When @reason is #NULL, the default reason for @code will be used.
269 * When @request is not #NULL, the relevant headers will be copied to the new
272 * Returns: a #GstRTSPResult.
275 gst_rtsp_message_init_response (GstRTSPMessage * msg, GstRTSPStatusCode code,
276 const gchar * reason, const GstRTSPMessage * request)
278 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
280 gst_rtsp_message_unset (msg);
283 reason = gst_rtsp_status_as_text (code);
285 msg->type = GST_RTSP_MESSAGE_RESPONSE;
286 msg->type_data.response.code = code;
287 msg->type_data.response.reason = g_strdup (reason);
288 msg->type_data.response.version = GST_RTSP_VERSION_1_0;
289 msg->hdr_fields = g_array_new (FALSE, FALSE, sizeof (RTSPKeyValue));
292 if (request->type == GST_RTSP_MESSAGE_HTTP_REQUEST) {
293 msg->type = GST_RTSP_MESSAGE_HTTP_RESPONSE;
294 if (request->type_data.request.version != GST_RTSP_VERSION_INVALID)
295 msg->type_data.response.version = request->type_data.request.version;
297 msg->type_data.response.version = GST_RTSP_VERSION_1_1;
302 if (gst_rtsp_message_get_header (request, GST_RTSP_HDR_CSEQ, &header,
304 gst_rtsp_message_add_header (msg, GST_RTSP_HDR_CSEQ, header);
307 /* copy session id */
308 if (gst_rtsp_message_get_header (request, GST_RTSP_HDR_SESSION, &header,
312 header = g_strdup (header);
313 if ((pos = strchr (header, ';'))) {
317 gst_rtsp_message_take_header (msg, GST_RTSP_HDR_SESSION, header);
320 /* FIXME copy more headers? */
328 * gst_rtsp_message_parse_response:
329 * @msg: a #GstRTSPMessage
330 * @code: location to hold the status code
331 * @reason: location to hold the status reason
332 * @version: location to hold the version
334 * Parse the response message @msg and store the values @code, @reason and
335 * @version. The result locations can be #NULL if one is not interested in its
338 * @reason remains valid for as long as @msg is valid and unchanged.
340 * Returns: a #GstRTSPResult.
343 gst_rtsp_message_parse_response (GstRTSPMessage * msg,
344 GstRTSPStatusCode * code, const gchar ** reason, GstRTSPVersion * version)
346 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
347 g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_RESPONSE ||
348 msg->type == GST_RTSP_MESSAGE_HTTP_RESPONSE, GST_RTSP_EINVAL);
351 *code = msg->type_data.response.code;
353 *reason = msg->type_data.response.reason;
355 *version = msg->type_data.response.version;
361 * gst_rtsp_message_new_data:
362 * @msg: a location for the new #GstRTSPMessage
363 * @channel: the channel
365 * Create a new data #GstRTSPMessage with @channel and store the
366 * result message in @msg. Free with gst_rtsp_message_free().
368 * Returns: a #GstRTSPResult.
371 gst_rtsp_message_new_data (GstRTSPMessage ** msg, guint8 channel)
373 GstRTSPMessage *newmsg;
375 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
377 newmsg = g_new0 (GstRTSPMessage, 1);
381 return gst_rtsp_message_init_data (newmsg, channel);
385 * gst_rtsp_message_init_data:
386 * @msg: a #GstRTSPMessage
387 * @channel: a channel
389 * Initialize a new data #GstRTSPMessage for @channel.
391 * Returns: a #GstRTSPResult.
394 gst_rtsp_message_init_data (GstRTSPMessage * msg, guint8 channel)
396 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
398 gst_rtsp_message_unset (msg);
400 msg->type = GST_RTSP_MESSAGE_DATA;
401 msg->type_data.data.channel = channel;
407 * gst_rtsp_message_parse_data:
408 * @msg: a #GstRTSPMessage
409 * @channel: location to hold the channel
411 * Parse the data message @msg and store the channel in @channel.
413 * Returns: a #GstRTSPResult.
416 gst_rtsp_message_parse_data (GstRTSPMessage * msg, guint8 * channel)
418 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
419 g_return_val_if_fail (msg->type == GST_RTSP_MESSAGE_DATA, GST_RTSP_EINVAL);
422 *channel = msg->type_data.data.channel;
428 * gst_rtsp_message_unset:
429 * @msg: a #GstRTSPMessage
431 * Unset the contents of @msg so that it becomes an uninitialized
432 * #GstRTSPMessage again. This function is mostly used in combination with
433 * gst_rtsp_message_init_request(), gst_rtsp_message_init_response() and
434 * gst_rtsp_message_init_data() on stack allocated #GstRTSPMessage structures.
436 * Returns: #GST_RTSP_OK.
439 gst_rtsp_message_unset (GstRTSPMessage * msg)
441 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
444 case GST_RTSP_MESSAGE_INVALID:
446 case GST_RTSP_MESSAGE_REQUEST:
447 case GST_RTSP_MESSAGE_HTTP_REQUEST:
448 g_free (msg->type_data.request.uri);
450 case GST_RTSP_MESSAGE_RESPONSE:
451 case GST_RTSP_MESSAGE_HTTP_RESPONSE:
452 g_free (msg->type_data.response.reason);
454 case GST_RTSP_MESSAGE_DATA:
457 g_return_val_if_reached (GST_RTSP_EINVAL);
460 if (msg->hdr_fields != NULL) {
463 for (i = 0; i < msg->hdr_fields->len; i++) {
464 RTSPKeyValue *keyval = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
466 g_free (keyval->value);
468 g_array_free (msg->hdr_fields, TRUE);
472 memset (msg, 0, sizeof (GstRTSPMessage));
478 * gst_rtsp_message_free:
479 * @msg: a #GstRTSPMessage
481 * Free the memory used by @msg.
483 * Returns: a #GstRTSPResult.
486 gst_rtsp_message_free (GstRTSPMessage * msg)
490 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
492 res = gst_rtsp_message_unset (msg);
493 if (res == GST_RTSP_OK)
500 * gst_rtsp_message_take_header:
501 * @msg: a #GstRTSPMessage
502 * @field: a #GstRTSPHeaderField
503 * @value: the value of the header
505 * Add a header with key @field and @value to @msg. This function takes
506 * ownership of @value.
508 * Returns: a #GstRTSPResult.
513 gst_rtsp_message_take_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
516 RTSPKeyValue key_value;
518 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
519 g_return_val_if_fail (value != NULL, GST_RTSP_EINVAL);
521 key_value.field = field;
522 key_value.value = value;
524 g_array_append_val (msg->hdr_fields, key_value);
530 * gst_rtsp_message_add_header:
531 * @msg: a #GstRTSPMessage
532 * @field: a #GstRTSPHeaderField
533 * @value: the value of the header
535 * Add a header with key @field and @value to @msg. This function takes a copy
538 * Returns: a #GstRTSPResult.
541 gst_rtsp_message_add_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
544 return gst_rtsp_message_take_header (msg, field, g_strdup (value));
548 * gst_rtsp_message_remove_header:
549 * @msg: a #GstRTSPMessage
550 * @field: a #GstRTSPHeaderField
551 * @indx: the index of the header
553 * Remove the @indx header with key @field from @msg. If @indx equals -1, all
554 * headers will be removed.
556 * Returns: a #GstRTSPResult.
559 gst_rtsp_message_remove_header (GstRTSPMessage * msg, GstRTSPHeaderField field,
562 GstRTSPResult res = GST_RTSP_ENOTIMPL;
566 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
568 while (i < msg->hdr_fields->len) {
569 RTSPKeyValue *key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
571 if (key_value->field == field && (indx == -1 || cnt++ == indx)) {
572 g_free (key_value->value);
573 g_array_remove_index (msg->hdr_fields, i);
585 * gst_rtsp_message_get_header:
586 * @msg: a #GstRTSPMessage
587 * @field: a #GstRTSPHeaderField
588 * @value: pointer to hold the result
589 * @indx: the index of the header
591 * Get the @indx header value with key @field from @msg. The result in @value
592 * stays valid as long as it remains present in @msg.
594 * Returns: #GST_RTSP_OK when @field was found, #GST_RTSP_ENOTIMPL if the key
598 gst_rtsp_message_get_header (const GstRTSPMessage * msg,
599 GstRTSPHeaderField field, gchar ** value, gint indx)
604 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
606 /* no header initialized, there are no headers */
607 if (msg->hdr_fields == NULL)
608 return GST_RTSP_ENOTIMPL;
610 for (i = 0; i < msg->hdr_fields->len; i++) {
611 RTSPKeyValue *key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
613 if (key_value->field == field && cnt++ == indx) {
615 *value = key_value->value;
620 return GST_RTSP_ENOTIMPL;
624 * gst_rtsp_message_append_headers:
625 * @msg: a #GstRTSPMessage
628 * Append the currently configured headers in @msg to the #GString @str suitable
631 * Returns: #GST_RTSP_OK.
634 gst_rtsp_message_append_headers (const GstRTSPMessage * msg, GString * str)
638 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
639 g_return_val_if_fail (str != NULL, GST_RTSP_EINVAL);
641 for (i = 0; i < msg->hdr_fields->len; i++) {
642 RTSPKeyValue *key_value;
645 key_value = &g_array_index (msg->hdr_fields, RTSPKeyValue, i);
646 keystr = gst_rtsp_header_as_text (key_value->field);
648 g_string_append_printf (str, "%s: %s\r\n", keystr, key_value->value);
654 * gst_rtsp_message_set_body:
655 * @msg: a #GstRTSPMessage
657 * @size: the size of @data
659 * Set the body of @msg to a copy of @data.
661 * Returns: #GST_RTSP_OK.
664 gst_rtsp_message_set_body (GstRTSPMessage * msg, const guint8 * data,
667 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
669 return gst_rtsp_message_take_body (msg, g_memdup (data, size), size);
673 * gst_rtsp_message_take_body:
674 * @msg: a #GstRTSPMessage
676 * @size: the size of @data
678 * Set the body of @msg to @data and @size. This method takes ownership of
681 * Returns: #GST_RTSP_OK.
684 gst_rtsp_message_take_body (GstRTSPMessage * msg, guint8 * data, guint size)
686 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
687 g_return_val_if_fail (data != NULL || size == 0, GST_RTSP_EINVAL);
693 msg->body_size = size;
699 * gst_rtsp_message_get_body:
700 * @msg: a #GstRTSPMessage
701 * @data: location for the data
702 * @size: location for the size of @data
704 * Get the body of @msg. @data remains valid for as long as @msg is valid and
707 * Returns: #GST_RTSP_OK.
710 gst_rtsp_message_get_body (const GstRTSPMessage * msg, guint8 ** data,
713 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
714 g_return_val_if_fail (data != NULL, GST_RTSP_EINVAL);
715 g_return_val_if_fail (size != NULL, GST_RTSP_EINVAL);
718 *size = msg->body_size;
724 * gst_rtsp_message_steal_body:
725 * @msg: a #GstRTSPMessage
726 * @data: location for the data
727 * @size: location for the size of @data
729 * Take the body of @msg and store it in @data and @size. After this method,
730 * the body and size of @msg will be set to #NULL and 0 respectively.
732 * Returns: #GST_RTSP_OK.
735 gst_rtsp_message_steal_body (GstRTSPMessage * msg, guint8 ** data, guint * size)
737 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
738 g_return_val_if_fail (data != NULL, GST_RTSP_EINVAL);
739 g_return_val_if_fail (size != NULL, GST_RTSP_EINVAL);
742 *size = msg->body_size;
751 dump_key_value (gpointer data, gpointer user_data G_GNUC_UNUSED)
753 RTSPKeyValue *key_value = (RTSPKeyValue *) data;
755 g_print (" key: '%s', value: '%s'\n",
756 gst_rtsp_header_as_text (key_value->field), key_value->value);
760 * gst_rtsp_message_dump:
761 * @msg: a #GstRTSPMessage
763 * Dump the contents of @msg to stdout.
765 * Returns: #GST_RTSP_OK.
768 gst_rtsp_message_dump (GstRTSPMessage * msg)
773 g_return_val_if_fail (msg != NULL, GST_RTSP_EINVAL);
776 case GST_RTSP_MESSAGE_REQUEST:
777 g_print ("RTSP request message %p\n", msg);
778 g_print (" request line:\n");
779 g_print (" method: '%s'\n",
780 gst_rtsp_method_as_text (msg->type_data.request.method));
781 g_print (" uri: '%s'\n", msg->type_data.request.uri);
782 g_print (" version: '%s'\n",
783 gst_rtsp_version_as_text (msg->type_data.request.version));
784 g_print (" headers:\n");
785 key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
786 g_print (" body:\n");
787 gst_rtsp_message_get_body (msg, &data, &size);
788 gst_util_dump_mem (data, size);
790 case GST_RTSP_MESSAGE_RESPONSE:
791 g_print ("RTSP response message %p\n", msg);
792 g_print (" status line:\n");
793 g_print (" code: '%d'\n", msg->type_data.response.code);
794 g_print (" reason: '%s'\n", msg->type_data.response.reason);
795 g_print (" version: '%s'\n",
796 gst_rtsp_version_as_text (msg->type_data.response.version));
797 g_print (" headers:\n");
798 key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
799 gst_rtsp_message_get_body (msg, &data, &size);
800 g_print (" body: length %d\n", size);
801 gst_util_dump_mem (data, size);
803 case GST_RTSP_MESSAGE_HTTP_REQUEST:
804 g_print ("HTTP request message %p\n", msg);
805 g_print (" request line:\n");
806 g_print (" method: '%s'\n",
807 gst_rtsp_method_as_text (msg->type_data.request.method));
808 g_print (" uri: '%s'\n", msg->type_data.request.uri);
809 g_print (" version: '%s'\n",
810 gst_rtsp_version_as_text (msg->type_data.request.version));
811 g_print (" headers:\n");
812 key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
813 g_print (" body:\n");
814 gst_rtsp_message_get_body (msg, &data, &size);
815 gst_util_dump_mem (data, size);
817 case GST_RTSP_MESSAGE_HTTP_RESPONSE:
818 g_print ("HTTP response message %p\n", msg);
819 g_print (" status line:\n");
820 g_print (" code: '%d'\n", msg->type_data.response.code);
821 g_print (" reason: '%s'\n", msg->type_data.response.reason);
822 g_print (" version: '%s'\n",
823 gst_rtsp_version_as_text (msg->type_data.response.version));
824 g_print (" headers:\n");
825 key_value_foreach (msg->hdr_fields, dump_key_value, NULL);
826 gst_rtsp_message_get_body (msg, &data, &size);
827 g_print (" body: length %d\n", size);
828 gst_util_dump_mem (data, size);
830 case GST_RTSP_MESSAGE_DATA:
831 g_print ("RTSP data message %p\n", msg);
832 g_print (" channel: '%d'\n", msg->type_data.data.channel);
833 g_print (" size: '%d'\n", msg->body_size);
834 gst_rtsp_message_get_body (msg, &data, &size);
835 gst_util_dump_mem (data, size);
838 g_print ("unsupported message type %d\n", msg->type);
839 return GST_RTSP_EINVAL;