2 * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 * Unless otherwise indicated, Source Code is licensed under MIT license.
21 * See further explanation attached in License Statement (distributed in the file
24 * Permission is hereby granted, free of charge, to any person obtaining a copy of
25 * this software and associated documentation files (the "Software"), to deal in
26 * the Software without restriction, including without limitation the rights to
27 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
28 * of the Software, and to permit persons to whom the Software is furnished to do
29 * so, subject to the following conditions:
31 * The above copyright notice and this permission notice shall be included in all
32 * copies or substantial portions of the Software.
34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
43 #ifndef __GST_RTSP_MESSAGE_H__
44 #define __GST_RTSP_MESSAGE_H__
48 #include <gst/rtsp/gstrtspdefs.h>
54 * @GST_RTSP_MESSAGE_INVALID: invalid message type
55 * @GST_RTSP_MESSAGE_REQUEST: RTSP request message
56 * @GST_RTSP_MESSAGE_RESPONSE: RTSP response message
57 * @GST_RTSP_MESSAGE_HTTP_REQUEST: HTTP request message. Since 0.10.25
58 * @GST_RTSP_MESSAGE_HTTP_RESPONSE: HTTP response message. Since 0.10.25
59 * @GST_RTSP_MESSAGE_DATA: data message
61 * The type of a message.
65 GST_RTSP_MESSAGE_INVALID,
66 GST_RTSP_MESSAGE_REQUEST,
67 GST_RTSP_MESSAGE_RESPONSE,
68 GST_RTSP_MESSAGE_HTTP_REQUEST,
69 GST_RTSP_MESSAGE_HTTP_RESPONSE,
73 typedef struct _GstRTSPMessage GstRTSPMessage;
77 * @type: the message type
79 * An RTSP message containing request, response or data messages. Depending on
80 * the @type, the appropriate structure may be accessed.
82 struct _GstRTSPMessage
90 GstRTSPVersion version;
93 GstRTSPStatusCode code;
95 GstRTSPVersion version;
109 /* memory management */
110 GstRTSPResult gst_rtsp_message_new (GstRTSPMessage **msg);
111 GstRTSPResult gst_rtsp_message_init (GstRTSPMessage *msg);
112 GstRTSPResult gst_rtsp_message_unset (GstRTSPMessage *msg);
113 GstRTSPResult gst_rtsp_message_free (GstRTSPMessage *msg);
115 GstRTSPMsgType gst_rtsp_message_get_type (GstRTSPMessage *msg);
118 GstRTSPResult gst_rtsp_message_new_request (GstRTSPMessage **msg,
119 GstRTSPMethod method,
121 GstRTSPResult gst_rtsp_message_init_request (GstRTSPMessage *msg,
122 GstRTSPMethod method,
124 GstRTSPResult gst_rtsp_message_parse_request (GstRTSPMessage *msg,
125 GstRTSPMethod *method,
127 GstRTSPVersion *version);
130 GstRTSPResult gst_rtsp_message_new_response (GstRTSPMessage **msg,
131 GstRTSPStatusCode code,
133 const GstRTSPMessage *request);
134 GstRTSPResult gst_rtsp_message_init_response (GstRTSPMessage *msg,
135 GstRTSPStatusCode code,
137 const GstRTSPMessage *request);
138 GstRTSPResult gst_rtsp_message_parse_response (GstRTSPMessage *msg,
139 GstRTSPStatusCode *code,
140 const gchar **reason,
141 GstRTSPVersion *version);
144 GstRTSPResult gst_rtsp_message_new_data (GstRTSPMessage **msg,
146 GstRTSPResult gst_rtsp_message_init_data (GstRTSPMessage *msg,
148 GstRTSPResult gst_rtsp_message_parse_data (GstRTSPMessage *msg,
152 GstRTSPResult gst_rtsp_message_add_header (GstRTSPMessage *msg,
153 GstRTSPHeaderField field,
155 GstRTSPResult gst_rtsp_message_take_header (GstRTSPMessage *msg,
156 GstRTSPHeaderField field,
158 GstRTSPResult gst_rtsp_message_remove_header (GstRTSPMessage *msg,
159 GstRTSPHeaderField field,
161 GstRTSPResult gst_rtsp_message_get_header (const GstRTSPMessage *msg,
162 GstRTSPHeaderField field,
165 GstRTSPResult gst_rtsp_message_append_headers (const GstRTSPMessage *msg,
168 /* handling the body */
169 GstRTSPResult gst_rtsp_message_set_body (GstRTSPMessage *msg,
172 GstRTSPResult gst_rtsp_message_take_body (GstRTSPMessage *msg,
175 GstRTSPResult gst_rtsp_message_get_body (const GstRTSPMessage *msg,
178 GstRTSPResult gst_rtsp_message_steal_body (GstRTSPMessage *msg,
183 GstRTSPResult gst_rtsp_message_dump (GstRTSPMessage *msg);
187 #endif /* __GST_RTSP_MESSAGE_H__ */