Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / gst-libs / gst / rtsp / gstrtspdefs.h
1 /* GStreamer
2  * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com>
3  *
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.
8  *
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.
13  *
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.
18  */
19 /*
20  * Unless otherwise indicated, Source Code is licensed under MIT license.
21  * See further explanation attached in License Statement (distributed in the file
22  * LICENSE).
23  *
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:
30  *
31  * The above copyright notice and this permission notice shall be included in all
32  * copies or substantial portions of the Software.
33  *
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
40  * SOFTWARE.
41  */
42
43 #ifndef __GST_RTSP_DEFS_H__
44 #define __GST_RTSP_DEFS_H__
45
46 #include <glib.h>
47 #include <glib-object.h>
48
49 G_BEGIN_DECLS
50
51 /**
52  * GST_RTSP_CHECK:
53  * @stmt: a statement
54  * @label: a label
55  *
56  * Macro that checks the return value of @stmt and jumps to @label when it does
57  * not equal #GST_RTSP_OK.
58  */
59 #define GST_RTSP_CHECK(stmt, label)  \
60 G_STMT_START { \
61   if (G_UNLIKELY ((res = (stmt)) != GST_RTSP_OK)) \
62     goto label; \
63 } G_STMT_END
64
65 /**
66  * GstRTSPResult:
67  * @GST_RTSP_OK: no error
68  * @GST_RTSP_ERROR: some unspecified error occured
69  * @GST_RTSP_EINVAL: invalid arguments were provided to a function
70  * @GST_RTSP_EINTR: an operation was canceled
71  * @GST_RTSP_ENOMEM: no memory was available for the operation
72  * @GST_RTSP_ERESOLV: a host resolve error occured
73  * @GST_RTSP_ENOTIMPL: function not implemented
74  * @GST_RTSP_ESYS: a system error occured, errno contains more details
75  * @GST_RTSP_EPARSE: a persing error occured
76  * @GST_RTSP_EWSASTART: windows networking could not start
77  * @GST_RTSP_EWSAVERSION: windows networking stack has wrong version
78  * @GST_RTSP_EEOF: end-of-file was reached
79  * @GST_RTSP_ENET: a network problem occured, h_errno contains more details
80  * @GST_RTSP_ENOTIP: the host is not an IP host
81  * @GST_RTSP_ETIMEOUT: a timeout occured
82  * @GST_RTSP_ETGET: the tunnel GET request has been performed
83  * @GST_RTSP_ETPOST: the tunnel POST request has been performed
84  * @GST_RTSP_ELAST: last error
85  *
86  * Result codes from the RTSP functions.
87  */
88 typedef enum {
89   GST_RTSP_OK          =  0,
90   /* errors */
91   GST_RTSP_ERROR       = -1,
92   GST_RTSP_EINVAL      = -2,
93   GST_RTSP_EINTR       = -3,
94   GST_RTSP_ENOMEM      = -4,
95   GST_RTSP_ERESOLV     = -5,
96   GST_RTSP_ENOTIMPL    = -6,
97   GST_RTSP_ESYS        = -7,
98   GST_RTSP_EPARSE      = -8,
99   GST_RTSP_EWSASTART   = -9,
100   GST_RTSP_EWSAVERSION = -10,
101   GST_RTSP_EEOF        = -11,
102   GST_RTSP_ENET        = -12,
103   GST_RTSP_ENOTIP      = -13,
104   GST_RTSP_ETIMEOUT    = -14,
105   GST_RTSP_ETGET       = -15,
106   GST_RTSP_ETPOST      = -16,
107
108   GST_RTSP_ELAST       = -17
109 } GstRTSPResult;
110
111 /**
112  * GstRTSPEvent:
113  * @GST_RTSP_EV_READ: connection is readable
114  * @GST_RTSP_EV_WRITE: connection is writable
115  *
116  * The possible events for the connection.
117  */
118 typedef enum {
119   GST_RTSP_EV_READ  = (1 << 0),
120   GST_RTSP_EV_WRITE = (1 << 1)
121 } GstRTSPEvent;
122
123 /**
124  * GstRTSPFamily:
125  * @GST_RTSP_FAM_NONE: unknown network family
126  * @GST_RTSP_FAM_INET: internet
127  * @GST_RTSP_FAM_INET6: internet V6
128  *
129  * The possible network families.
130  */
131 typedef enum {
132   GST_RTSP_FAM_NONE,
133   GST_RTSP_FAM_INET,
134   GST_RTSP_FAM_INET6
135 } GstRTSPFamily;
136
137 /**
138  * GstRTSPState:
139  * @GST_RTSP_STATE_INVALID: invalid state
140  * @GST_RTSP_STATE_INIT: initializing
141  * @GST_RTSP_STATE_READY: ready for operation
142  * @GST_RTSP_STATE_SEEKING: seeking in progress
143  * @GST_RTSP_STATE_PLAYING: playing
144  * @GST_RTSP_STATE_RECORDING: recording
145  *
146  * The different RTSP states.
147  */
148 typedef enum {
149   GST_RTSP_STATE_INVALID,
150   GST_RTSP_STATE_INIT,
151   GST_RTSP_STATE_READY,
152   GST_RTSP_STATE_SEEKING,
153   GST_RTSP_STATE_PLAYING,
154   GST_RTSP_STATE_RECORDING
155 } GstRTSPState;
156
157 /**
158  * GstRTSPVersion:
159  * @GST_RTSP_VERSION_INVALID: unknown/invalid version
160  * @GST_RTSP_VERSION_1_0: version 1.0
161  * @GST_RTSP_VERSION_1_1: version 1.1. Since 0.10.25
162  *
163  * The supported RTSP versions.
164  */
165 typedef enum {
166   GST_RTSP_VERSION_INVALID = 0x00,
167   GST_RTSP_VERSION_1_0     = 0x10,
168   GST_RTSP_VERSION_1_1     = 0x11
169 } GstRTSPVersion;
170
171 /**
172  * GstRTSPMethod:
173  * @GST_RTSP_INVALID: invalid method
174  * @GST_RTSP_DESCRIBE: the DESCRIBE method
175  * @GST_RTSP_ANNOUNCE: the ANNOUNCE method
176  * @GST_RTSP_GET_PARAMETER: the GET_PARAMETER method
177  * @GST_RTSP_OPTIONS: the OPTIONS method
178  * @GST_RTSP_PAUSE: the PAUSE method
179  * @GST_RTSP_PLAY: the PLAY method
180  * @GST_RTSP_RECORD: the RECORD method
181  * @GST_RTSP_REDIRECT: the REDIRECT method
182  * @GST_RTSP_SETUP: the SETUP method
183  * @GST_RTSP_SET_PARAMETER: the SET_PARAMETER method
184  * @GST_RTSP_TEARDOWN: the TEARDOWN method
185  * @GST_RTSP_GET: the GET method (HTTP). Since 0.10.25
186  * @GST_RTSP_POST: the POST method (HTTP). Since 0.10.25
187  *
188  * The different supported RTSP methods. 
189  */
190 typedef enum {
191   GST_RTSP_INVALID          = 0,
192   GST_RTSP_DESCRIBE         = (1 <<  0),
193   GST_RTSP_ANNOUNCE         = (1 <<  1),
194   GST_RTSP_GET_PARAMETER    = (1 <<  2),
195   GST_RTSP_OPTIONS          = (1 <<  3),
196   GST_RTSP_PAUSE            = (1 <<  4),
197   GST_RTSP_PLAY             = (1 <<  5),
198   GST_RTSP_RECORD           = (1 <<  6),
199   GST_RTSP_REDIRECT         = (1 <<  7),
200   GST_RTSP_SETUP            = (1 <<  8),
201   GST_RTSP_SET_PARAMETER    = (1 <<  9),
202   GST_RTSP_TEARDOWN         = (1 << 10),
203   GST_RTSP_GET              = (1 << 11),
204   GST_RTSP_POST             = (1 << 12)
205 } GstRTSPMethod;
206
207 /**
208  * GstRTSPAuthMethod:
209  * @GST_RTSP_AUTH_NONE: no authentication
210  * @GST_RTSP_AUTH_BASIC: basic authentication
211  * @GST_RTSP_AUTH_DIGEST: digest authentication
212  *
213  * Authentication methods, ordered by strength
214  */
215 typedef enum {
216   GST_RTSP_AUTH_NONE    = 0x00,
217   GST_RTSP_AUTH_BASIC   = 0x01,
218   GST_RTSP_AUTH_DIGEST  = 0x02
219 } GstRTSPAuthMethod;
220
221 /**
222  * GST_RTSP_AUTH_MAX:
223  *
224  * Strongest available authentication method 
225  */
226 #define GST_RTSP_AUTH_MAX GST_RTSP_AUTH_DIGEST
227
228 typedef enum {
229   GST_RTSP_HDR_INVALID,
230
231   /*
232    * R = Request
233    * r = response
234    * g = general
235    * e = entity
236    */
237   GST_RTSP_HDR_ACCEPT,              /* Accept               R      opt.      entity */
238   GST_RTSP_HDR_ACCEPT_ENCODING,     /* Accept-Encoding      R      opt.      entity */
239   GST_RTSP_HDR_ACCEPT_LANGUAGE,     /* Accept-Language      R      opt.      all */
240   GST_RTSP_HDR_ALLOW,               /* Allow                r      opt.      all */
241   GST_RTSP_HDR_AUTHORIZATION,       /* Authorization        R      opt.      all */
242   GST_RTSP_HDR_BANDWIDTH,           /* Bandwidth            R      opt.      all */
243   GST_RTSP_HDR_BLOCKSIZE,           /* Blocksize            R      opt.      all but OPTIONS, TEARDOWN */
244   GST_RTSP_HDR_CACHE_CONTROL,       /* Cache-Control        g      opt.      SETUP */
245   GST_RTSP_HDR_CONFERENCE,          /* Conference           R      opt.      SETUP */
246   GST_RTSP_HDR_CONNECTION,          /* Connection           g      req.      all */
247   GST_RTSP_HDR_CONTENT_BASE,        /* Content-Base         e      opt.      entity */
248   GST_RTSP_HDR_CONTENT_ENCODING,    /* Content-Encoding     e      req.      SET_PARAMETER, DESCRIBE, ANNOUNCE */
249   GST_RTSP_HDR_CONTENT_LANGUAGE,    /* Content-Language     e      req.      DESCRIBE, ANNOUNCE */
250   GST_RTSP_HDR_CONTENT_LENGTH,      /* Content-Length       e      req.      SET_PARAMETER, ANNOUNCE, entity */
251   GST_RTSP_HDR_CONTENT_LOCATION,    /* Content-Location     e      opt.      entity */
252   GST_RTSP_HDR_CONTENT_TYPE,        /* Content-Type         e      req.      SET_PARAMETER, ANNOUNCE, entity */
253   GST_RTSP_HDR_CSEQ,                /* CSeq                 g      req.      all */
254   GST_RTSP_HDR_DATE,                /* Date                 g      opt.      all */
255   GST_RTSP_HDR_EXPIRES,             /* Expires              e      opt.      DESCRIBE, ANNOUNCE */
256   GST_RTSP_HDR_FROM,                /* From                 R      opt.      all */
257   GST_RTSP_HDR_IF_MODIFIED_SINCE,   /* If-Modified-Since    R      opt.      DESCRIBE, SETUP */
258   GST_RTSP_HDR_LAST_MODIFIED,       /* Last-Modified        e      opt.      entity */
259   GST_RTSP_HDR_PROXY_AUTHENTICATE,  /* Proxy-Authenticate */
260   GST_RTSP_HDR_PROXY_REQUIRE,       /* Proxy-Require        R      req.      all */
261   GST_RTSP_HDR_PUBLIC,              /* Public               r      opt.      all */
262   GST_RTSP_HDR_RANGE,               /* Range                Rr     opt.      PLAY, PAUSE, RECORD */
263   GST_RTSP_HDR_REFERER,             /* Referer              R      opt.      all */
264   GST_RTSP_HDR_REQUIRE,             /* Require              R      req.      all */
265   GST_RTSP_HDR_RETRY_AFTER,         /* Retry-After          r      opt.      all */
266   GST_RTSP_HDR_RTP_INFO,            /* RTP-Info             r      req.      PLAY */
267   GST_RTSP_HDR_SCALE,               /* Scale                Rr     opt.      PLAY, RECORD */
268   GST_RTSP_HDR_SESSION,             /* Session              Rr     req.      all but SETUP, OPTIONS */
269   GST_RTSP_HDR_SERVER,              /* Server               r      opt.      all */
270   GST_RTSP_HDR_SPEED,               /* Speed                Rr     opt.      PLAY */
271   GST_RTSP_HDR_TRANSPORT,           /* Transport            Rr     req.      SETUP */
272   GST_RTSP_HDR_UNSUPPORTED,         /* Unsupported          r      req.      all */
273   GST_RTSP_HDR_USER_AGENT,          /* User-Agent           R      opt.      all */
274   GST_RTSP_HDR_VIA,                 /* Via                  g      opt.      all */
275   GST_RTSP_HDR_WWW_AUTHENTICATE,    /* WWW-Authenticate     r      opt.      all */
276
277   /* Real extensions */
278   GST_RTSP_HDR_CLIENT_CHALLENGE,    /* ClientChallenge */
279   GST_RTSP_HDR_REAL_CHALLENGE1,     /* RealChallenge1 */
280   GST_RTSP_HDR_REAL_CHALLENGE2,     /* RealChallenge2 */
281   GST_RTSP_HDR_REAL_CHALLENGE3,     /* RealChallenge3 */
282   GST_RTSP_HDR_SUBSCRIBE,           /* Subscribe */
283   GST_RTSP_HDR_ALERT,               /* Alert */
284   GST_RTSP_HDR_CLIENT_ID,           /* ClientID */
285   GST_RTSP_HDR_COMPANY_ID,          /* CompanyID */
286   GST_RTSP_HDR_GUID,                /* GUID */
287   GST_RTSP_HDR_REGION_DATA,         /* RegionData */
288   GST_RTSP_HDR_MAX_ASM_WIDTH,       /* SupportsMaximumASMBandwidth */
289   GST_RTSP_HDR_LANGUAGE,            /* Language */
290   GST_RTSP_HDR_PLAYER_START_TIME,   /* PlayerStarttime */
291
292   /* Since 0.10.16 */
293   GST_RTSP_HDR_LOCATION,            /* Location */
294
295   /* Since 0.10.23 */
296   GST_RTSP_HDR_ETAG,                /* ETag */
297   GST_RTSP_HDR_IF_MATCH,            /* If-Match */
298
299   /* WM extensions [MS-RTSP] Since 0.10.23 */
300   GST_RTSP_HDR_ACCEPT_CHARSET,      /* Accept-Charset */
301   GST_RTSP_HDR_SUPPORTED,           /* Supported */
302   GST_RTSP_HDR_VARY,                /* Vary */
303   GST_RTSP_HDR_X_ACCELERATE_STREAMING,    /* X-Accelerate-Streaming */
304   GST_RTSP_HDR_X_ACCEPT_AUTHENT,    /* X-Accept-Authentication */
305   GST_RTSP_HDR_X_ACCEPT_PROXY_AUTHENT,    /* X-Accept-Proxy-Authentication */
306   GST_RTSP_HDR_X_BROADCAST_ID,      /* X-Broadcast-Id */
307   GST_RTSP_HDR_X_BURST_STREAMING,   /* X-Burst-Streaming */
308   GST_RTSP_HDR_X_NOTICE,            /* X-Notice */
309   GST_RTSP_HDR_X_PLAYER_LAG_TIME,   /* X-Player-Lag-Time */
310   GST_RTSP_HDR_X_PLAYLIST,          /* X-Playlist */
311   GST_RTSP_HDR_X_PLAYLIST_CHANGE_NOTICE,  /* X-Playlist-Change-Notice */
312   GST_RTSP_HDR_X_PLAYLIST_GEN_ID,   /* X-Playlist-Gen-Id */
313   GST_RTSP_HDR_X_PLAYLIST_SEEK_ID,  /* X-Playlist-Seek-Id */
314   GST_RTSP_HDR_X_PROXY_CLIENT_AGENT,      /* X-Proxy-Client-Agent */
315   GST_RTSP_HDR_X_PROXY_CLIENT_VERB, /* X-Proxy-Client-Verb */
316   GST_RTSP_HDR_X_RECEDING_PLAYLISTCHANGE, /* X-Receding-PlaylistChange */
317   GST_RTSP_HDR_X_RTP_INFO,          /* X-RTP-Info */
318   GST_RTSP_HDR_X_STARTUPPROFILE,    /* X-StartupProfile */
319
320   /* Since 0.10.24 */
321   GST_RTSP_HDR_TIMESTAMP,           /* Timestamp */
322
323   /* Since 0.10.25 */
324   GST_RTSP_HDR_AUTHENTICATION_INFO, /* Authentication-Info */
325   GST_RTSP_HDR_HOST,                /* Host */
326   GST_RTSP_HDR_PRAGMA,              /* Pragma */
327   GST_RTSP_HDR_X_SERVER_IP_ADDRESS, /* X-Server-IP-Address */
328   GST_RTSP_HDR_X_SESSIONCOOKIE,     /* X-Sessioncookie */
329
330   GST_RTSP_HDR_LAST
331 } GstRTSPHeaderField;
332
333 typedef enum {
334   GST_RTSP_STS_INVALID                              = 0, 
335   GST_RTSP_STS_CONTINUE                             = 100, 
336   GST_RTSP_STS_OK                                   = 200, 
337   GST_RTSP_STS_CREATED                              = 201, 
338   GST_RTSP_STS_LOW_ON_STORAGE                       = 250, 
339   GST_RTSP_STS_MULTIPLE_CHOICES                     = 300, 
340   GST_RTSP_STS_MOVED_PERMANENTLY                    = 301, 
341   GST_RTSP_STS_MOVE_TEMPORARILY                     = 302, 
342   GST_RTSP_STS_SEE_OTHER                            = 303, 
343   GST_RTSP_STS_NOT_MODIFIED                         = 304, 
344   GST_RTSP_STS_USE_PROXY                            = 305, 
345   GST_RTSP_STS_BAD_REQUEST                          = 400, 
346   GST_RTSP_STS_UNAUTHORIZED                         = 401, 
347   GST_RTSP_STS_PAYMENT_REQUIRED                     = 402, 
348   GST_RTSP_STS_FORBIDDEN                            = 403, 
349   GST_RTSP_STS_NOT_FOUND                            = 404, 
350   GST_RTSP_STS_METHOD_NOT_ALLOWED                   = 405, 
351   GST_RTSP_STS_NOT_ACCEPTABLE                       = 406, 
352   GST_RTSP_STS_PROXY_AUTH_REQUIRED                  = 407, 
353   GST_RTSP_STS_REQUEST_TIMEOUT                      = 408, 
354   GST_RTSP_STS_GONE                                 = 410, 
355   GST_RTSP_STS_LENGTH_REQUIRED                      = 411, 
356   GST_RTSP_STS_PRECONDITION_FAILED                  = 412, 
357   GST_RTSP_STS_REQUEST_ENTITY_TOO_LARGE             = 413, 
358   GST_RTSP_STS_REQUEST_URI_TOO_LARGE                = 414, 
359   GST_RTSP_STS_UNSUPPORTED_MEDIA_TYPE               = 415, 
360   GST_RTSP_STS_PARAMETER_NOT_UNDERSTOOD             = 451, 
361   GST_RTSP_STS_CONFERENCE_NOT_FOUND                 = 452, 
362   GST_RTSP_STS_NOT_ENOUGH_BANDWIDTH                 = 453, 
363   GST_RTSP_STS_SESSION_NOT_FOUND                    = 454, 
364   GST_RTSP_STS_METHOD_NOT_VALID_IN_THIS_STATE       = 455, 
365   GST_RTSP_STS_HEADER_FIELD_NOT_VALID_FOR_RESOURCE  = 456, 
366   GST_RTSP_STS_INVALID_RANGE                        = 457, 
367   GST_RTSP_STS_PARAMETER_IS_READONLY                = 458, 
368   GST_RTSP_STS_AGGREGATE_OPERATION_NOT_ALLOWED      = 459, 
369   GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED     = 460, 
370   GST_RTSP_STS_UNSUPPORTED_TRANSPORT                = 461, 
371   GST_RTSP_STS_DESTINATION_UNREACHABLE              = 462, 
372   GST_RTSP_STS_INTERNAL_SERVER_ERROR                = 500, 
373   GST_RTSP_STS_NOT_IMPLEMENTED                      = 501, 
374   GST_RTSP_STS_BAD_GATEWAY                          = 502, 
375   GST_RTSP_STS_SERVICE_UNAVAILABLE                  = 503, 
376   GST_RTSP_STS_GATEWAY_TIMEOUT                      = 504, 
377   GST_RTSP_STS_RTSP_VERSION_NOT_SUPPORTED           = 505, 
378   GST_RTSP_STS_OPTION_NOT_SUPPORTED                 = 551
379 } GstRTSPStatusCode;
380
381 gchar*             gst_rtsp_strresult          (GstRTSPResult result);
382
383 const gchar*       gst_rtsp_method_as_text     (GstRTSPMethod method);
384 const gchar*       gst_rtsp_version_as_text    (GstRTSPVersion version);
385 const gchar*       gst_rtsp_header_as_text     (GstRTSPHeaderField field);
386 const gchar*       gst_rtsp_status_as_text     (GstRTSPStatusCode code);
387
388 gchar*             gst_rtsp_options_as_text    (GstRTSPMethod options);
389
390 GstRTSPHeaderField gst_rtsp_find_header_field  (const gchar *header);
391 GstRTSPMethod      gst_rtsp_find_method        (const gchar *method);
392
393 gboolean           gst_rtsp_header_allow_multiple (GstRTSPHeaderField field);
394
395 G_END_DECLS
396
397 #endif /* __GST_RTSP_DEFS_H__ */