79 "Windows sockets are not version 0x202", |
81 "Windows sockets are not version 0x202", |
80 "Received end-of-file", |
82 "Received end-of-file", |
81 "Network error: %s", |
83 "Network error: %s", |
82 "Host is not a valid IP address", |
84 "Host is not a valid IP address", |
83 "Timeout while waiting for server response", |
85 "Timeout while waiting for server response", |
|
86 "Tunnel GET request received", |
|
87 "Tunnel POST request received", |
84 "Unknown error (%d)", |
88 "Unknown error (%d)", |
85 NULL |
89 NULL |
86 }; |
90 }; |
87 |
91 |
88 static const gchar *rtsp_methods[] = { |
92 static const gchar *rtsp_methods[] = { |
155 "SupportsMaximumASMBandwidth", /* SupportsMaximumASMBandwidth */ |
159 "SupportsMaximumASMBandwidth", /* SupportsMaximumASMBandwidth */ |
156 "Language", /* Language */ |
160 "Language", /* Language */ |
157 "PlayerStarttime", /* PlayerStarttime */ |
161 "PlayerStarttime", /* PlayerStarttime */ |
158 |
162 |
159 "Location", /* Location */ |
163 "Location", /* Location */ |
|
164 "ETag", /* ETag */ |
|
165 "If-Match", /* If-Match */ |
|
166 |
|
167 /* WM extensions [MS-RTSP] */ |
|
168 "Accept-Charset", /* Accept-Charset */ |
|
169 "Supported", /* Supported */ |
|
170 "Vary", /* Vary */ |
|
171 "X-Accelerate-Streaming", /* X-Accelerate-Streaming */ |
|
172 "X-Accept-Authentication", /* X-Accept-Authentication */ |
|
173 "X-Accept-Proxy-Authentication", /* X-Accept-Proxy-Authentication */ |
|
174 "X-Broadcast-Id", /* X-Broadcast-Id */ |
|
175 "X-Burst-Streaming", /* X-Burst-Streaming */ |
|
176 "X-Notice", /* X-Notice */ |
|
177 "X-Player-Lag-Time", /* X-Player-Lag-Time */ |
|
178 "X-Playlist", /* X-Playlist */ |
|
179 "X-Playlist-Change-Notice", /* X-Playlist-Change-Notice */ |
|
180 "X-Playlist-Gen-Id", /* X-Playlist-Gen-Id */ |
|
181 "X-Playlist-Seek-Id", /* X-Playlist-Seek-Id */ |
|
182 "X-Proxy-Client-Agent", /* X-Proxy-Client-Agent */ |
|
183 "X-Proxy-Client-Verb", /* X-Proxy-Client-Verb */ |
|
184 "X-Receding-PlaylistChange", /* X-Receding-PlaylistChange */ |
|
185 "X-RTP-Info", /* X-RTP-Info */ |
|
186 "X-StartupProfile", /* X-StartupProfile */ |
|
187 "Timestamp", /* Timestamp */ |
160 |
188 |
161 NULL |
189 NULL |
162 }; |
190 }; |
163 |
191 |
164 #define DEF_STATUS(c, t) \ |
192 #define DEF_STATUS(c, t) \ |
241 |
269 |
242 idx = ABS (result); |
270 idx = ABS (result); |
243 idx = CLAMP (idx, 0, -GST_RTSP_ELAST); |
271 idx = CLAMP (idx, 0, -GST_RTSP_ELAST); |
244 |
272 |
245 switch (idx) { |
273 switch (idx) { |
|
274 #ifdef G_OS_WIN32 |
|
275 case -GST_RTSP_ESYS: |
|
276 case -GST_RTSP_ENET: |
|
277 { |
|
278 gchar *msg = g_win32_error_message (WSAGetLastError ()); |
|
279 res = g_strdup_printf (rtsp_results[idx], msg); |
|
280 g_free (msg); |
|
281 break; |
|
282 } |
|
283 #else |
246 case -GST_RTSP_ESYS: |
284 case -GST_RTSP_ESYS: |
247 res = g_strdup_printf (rtsp_results[idx], g_strerror (errno)); |
285 res = g_strdup_printf (rtsp_results[idx], g_strerror (errno)); |
248 break; |
286 break; |
249 case -GST_RTSP_ENET: |
287 case -GST_RTSP_ENET: |
250 #ifndef G_OS_WIN32 |
|
251 res = g_strdup_printf (rtsp_results[idx], hstrerror (h_errno)); |
288 res = g_strdup_printf (rtsp_results[idx], hstrerror (h_errno)); |
252 #else |
|
253 res = |
|
254 g_strdup |
|
255 ("not supported on win32, implement me in a different way ??"); |
|
256 #endif |
289 #endif |
257 break; |
290 break; |
258 case -GST_RTSP_ELAST: |
291 case -GST_RTSP_ELAST: |
259 res = g_strdup_printf (rtsp_results[idx], result); |
292 res = g_strdup_printf (rtsp_results[idx], result); |
260 break; |
293 break; |
386 return (1 << idx); |
419 return (1 << idx); |
387 } |
420 } |
388 } |
421 } |
389 return GST_RTSP_INVALID; |
422 return GST_RTSP_INVALID; |
390 } |
423 } |
|
424 |
|
425 /** |
|
426 * gst_rtsp_options_as_text: |
|
427 * @options: one or more #GstRTSPMethod |
|
428 * |
|
429 * Convert @options to a string. |
|
430 * |
|
431 * Returns: a new string of @options. g_free() after usage. |
|
432 * |
|
433 * Since: 0.10.23 |
|
434 */ |
|
435 gchar * |
|
436 gst_rtsp_options_as_text (GstRTSPMethod options) |
|
437 { |
|
438 GString *str; |
|
439 |
|
440 str = g_string_new (""); |
|
441 |
|
442 if (options & GST_RTSP_OPTIONS) |
|
443 g_string_append (str, "OPTIONS, "); |
|
444 if (options & GST_RTSP_DESCRIBE) |
|
445 g_string_append (str, "DESCRIBE, "); |
|
446 if (options & GST_RTSP_ANNOUNCE) |
|
447 g_string_append (str, "ANNOUNCE, "); |
|
448 if (options & GST_RTSP_GET_PARAMETER) |
|
449 g_string_append (str, "GET_PARAMETER, "); |
|
450 if (options & GST_RTSP_PAUSE) |
|
451 g_string_append (str, "PAUSE, "); |
|
452 if (options & GST_RTSP_PLAY) |
|
453 g_string_append (str, "PLAY, "); |
|
454 if (options & GST_RTSP_RECORD) |
|
455 g_string_append (str, "RECORD, "); |
|
456 if (options & GST_RTSP_REDIRECT) |
|
457 g_string_append (str, "REDIRECT, "); |
|
458 if (options & GST_RTSP_SETUP) |
|
459 g_string_append (str, "SETUP, "); |
|
460 if (options & GST_RTSP_SET_PARAMETER) |
|
461 g_string_append (str, "SET_PARAMETER, "); |
|
462 if (options & GST_RTSP_TEARDOWN) |
|
463 g_string_append (str, "TEARDOWN, "); |
|
464 |
|
465 /* remove trailing ", " if there is one */ |
|
466 if (str->len > 2) |
|
467 str = g_string_truncate (str, str->len - 2); |
|
468 |
|
469 return g_string_free (str, FALSE); |
|
470 } |