Commit graph

151 commits

Author SHA1 Message Date
Sebastian Dröge
ab17f5d3fa rtsp: Fix introspection build by ordering sources/headers in dependency order 2009-09-05 13:13:23 +02:00
Sebastian Dröge
7e90e0846c introspection: Strip Gst prefix from all types/functions 2009-09-05 12:31:47 +02:00
Sebastian Dröge
7794caf9f8 introspection: Fix build if gir-repository is not installed 2009-09-05 11:49:41 +02:00
Sebastian Dröge
e13a186b56 rtsp: Add gobject-introspection support 2009-09-05 11:28:59 +02:00
Peter Kjellerstedt
8ce3612b71 rtsp: Mark Transport as supporting multiple values. 2009-08-24 14:39:16 +02:00
Peter Kjellerstedt
2882c22d95 rtsp: Added missing Since tags. 2009-08-24 13:58:50 +02:00
Peter Kjellerstedt
066f9be5c9 rtsp: Added new API for sending using GstRTSPWatch.
The new API to send messages using GstRTSPWatch will first try to send the
message immediately. Then, if that failed (or the message was not sent
fully), it will queue the remaining message for later delivery. This avoids
unnecessary context switches, and makes it possible to keep track of
whether the connection is blocked (the unblocking of the connection is
indicated by the reception of the message_sent signal).

This also deprecates the old API (gst_rtsp_watch_queue_data() and
gst_rtsp_watch_queue_message().)

API: gst_rtsp_watch_write_data()
API: gst_rtsp_watch_send_message()
2009-08-24 13:19:46 +02:00
Peter Kjellerstedt
0af04aa4a8 rtsp: Made gst_rtsp_watch_queue_data() thread safe. 2009-08-24 13:19:46 +02:00
Peter Kjellerstedt
fb3b761af5 rtsp: Added gst_rtsp_connection_set_http_mode().
With gst_rtsp_connection_set_http_mode() it is possible to tell the
connection whether to allow HTTP messages to be supported. By enabling HTTP
support the automatic HTTP tunnel support will also be disabled.

API: gst_rtsp_connection_set_http_mode()
2009-08-24 13:19:46 +02:00
Peter Kjellerstedt
d5b4b5d8af rtsp: Allow gst_rtsp_connection_do_tunnel() to just setup decoding context.
If the second connection passed to gst_rtsp_connection_do_tunnel() is NULL
then just setup the base64 decoding context for the first connection.
2009-08-24 13:19:46 +02:00
Peter Kjellerstedt
01d98fdb5d rtsp: Write as much as possible in gst_rtsp_source_dispatch().
Try to write as much as possible if there are multiple messages queued.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
e5ec74c7a9 rtsp: Add error_full callback to GstRTSPWatchFuncs.
The error_full callback is similar to the error callback, but allows for
better error handling. For read errors a partial message is provided to
help an RTSP server generate a more correct error response, and for write
errors the write queue id of the failed message is returned.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
ab8bea4555 rtsp: Made read_line() support LWS.
Rewrote read_line() to support LWS (Line White Space), the method used by
RTSP (and HTTP) to break long lines. Also added support for \r and \n as
line endings (in addition to the official \r\n).
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
607209f121 rtsp: Do not split headers which should not be split.
From RFC 2068 section 4.2: "Multiple message-header fields with the same
field-name may be present in a message if and only if the entire
field-value for that header field is defined as a comma-separated list
[i.e., #(values)]." This means that we should not split other headers which
may contain a comma, e.g., Range and Date.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
08d3fe8561 rtsp: Parse WWW-Authenticate headers correctly.
Due to the odd syntax for WWW-Authenticate (and Proxy-Authenticate) which
allows commas both to separate between multiple challenges, and within the
challenges themself, we need to take some extra care to split these headers
correctly.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
efc8901a39 rtsp: Improve parse_line().
Make parse_line() handle keys with multiple values on one line correctly.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
db66ff4a62 rtsp: Rewrote setup_tunneling().
Rewrote setup_tunneling() to use normal GstRTSPMessages instead of hard
coded strings and duplicates of the message parsing code.
2009-08-24 13:19:45 +02:00
Peter Kjellerstedt
c18e2eec88 rtsp: Rewrote gen_tunnel_reply().
Rewrote gen_tunnel_reply() to generate a normal GstRTSPMessage rather
than a hard coded string.
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
e1b3393d6b rtsp: Ignore the Content-Length for POST requests.
The Content-Length for POST requests with an x-sessioncookie header should
be ignored as the length is bogus and only there to fool proxies.
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
11c8b811f3 rtsp: Normalize lines (remove extra whitespace) before parsing. 2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
5716cd102a rtsp: Made parse_string() return a result.
This will catch parsing errors when a too long string is received.
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
fdd5a65632 rtsp: Improved parsing of messages.
Do not abort message parsing as soon as there is an error. Instead parse
as much as possible to allow a server to return as meaningful an error as
possible.
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
ca154010fe rtsp: Added support for HTTP messages 2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
dd7d0cfc45 rtsp: Added gst_rtsp_connection_create_from_fd().
API: gst_rtsp_connection_create_from_fd()
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
814eaa728a rtsp: Add initial buffer support.
The initial buffer contains data for a connection which should be used
before starting to actually read anything from the socket.
2009-08-24 13:19:44 +02:00
Peter Kjellerstedt
41f1d9a7d9 rtsp: Add support for the Authentication-Info header.
The Authentication-Info header is defined in RFC 2617 (Digest Access
Authentication).
2009-08-24 11:24:27 +02:00
Peter Kjellerstedt
3c4fa9274f rtsp: Avoid duplicated headers.
Remove any existing Session and Date headers before adding new ones
when sending a request. This may happen if the user of this code reuses
a request (rtspsrc does this when resending after authorization fails).
2009-08-19 09:31:51 +02:00
Peter Kjellerstedt
3b888cfe2a rtsp: Corrected the HTTP digest authorization computation.
Do not use sizeof() on an array passed as an argument to a function and
expect to get anything but the size of a pointer. As a result only the
first 4 (or 8) bytes of the response buffer were initialized to 0 in
auth_digest_compute_response() which caused it to return a string which
was not NUL-terminated...
2009-08-18 16:50:58 +02:00
Tim-Philipp Müller
cb19626c8c rtspconnection: don't use GLib-2.18 function
g_checksum_reset() was added only in GLib 2.18, but we still require
only 2.16, so work around that if we only have 2.16. Fixes #591357.
2009-08-10 20:18:24 +01:00
Sebastian Dröge
79ade6ad68 rtsp: Use GLib's GChecksum instead of our own MD5 implementation 2009-08-10 10:19:01 +02:00
Wim Taymans
f5962f0a4f rtsp: include in.h for FreeBSD compat
Fixes #586920
2009-06-29 12:20:52 +02:00
Peter Kjellerstedt
c398f2f376 rtsp: Moved a comment. 2009-06-29 09:31:40 +02:00
Руслан Ижбулатов
07c237ad19 Define WINVER before including any win headers
Fixes bug #587080.
2009-06-27 14:02:50 +02:00
Peter Kjellerstedt
4fd61fbaa4 rtsp: Made the parsing of the RTSP URL scheme more generic. 2009-06-17 18:34:57 +02:00
Peter Kjellerstedt
726a47f777 rtsp: Added gst_rtsp_watch_queue_data().
gst_rtsp_watch_queue_data() is similar to gst_rtsp_watch_queue_message()
but allows for queuing any data block for writing (much like
gst_rtsp_connection_write() vs. gst_rtsp_connection_send().)

API: gst_rtsp_watch_queue_data()
2009-06-17 18:34:33 +02:00
Peter Kjellerstedt
595f8b6d00 rtsp: Only extract the session ID from RTSP responses. 2009-06-17 18:02:18 +02:00
Peter Kjellerstedt
ddbeb44f14 rtsp: Added support for parsing IPv6 addresses in RTSP URLs. 2009-06-17 18:00:17 +02:00
Peter Kjellerstedt
95a606a0bb rtsp: Use getaddrinfo() to support both IPv4 and IPv6. 2009-06-17 17:59:47 +02:00
Peter Kjellerstedt
e1a4c8871a rtsp: Improved base64 decoding in fill_bytes().
The base64 decoding in fill_bytes() expected the size of the read data to
be evenly divisible by four (which is true for the base64 encoded data
itself). This did not, however, take whitespace (especially line breaks)
into account and would fail the decoding if any whitespace was present.
2009-06-17 17:53:54 +02:00
Wim Taymans
33837d420c rtsp: add Timestamp header field
fixes #585994
2009-06-16 18:57:20 +02:00
Peter Kjellerstedt
73dd8236ce rtsp: Use a more consistent naming of GstRTSPRec variables. 2009-06-15 09:28:34 +02:00
Peter Kjellerstedt
ff38999c8b rtsp: Call message_sent() callback for all sent messages.
Previously the messages_sent() callback was only called for messages
which had a CSeq, which excluded all data messages. Instead of using the
CSeq as ID, use a simple index counter.
2009-06-15 09:28:13 +02:00
Wim Taymans
e01fab3ace rtsp: add some more docs 2009-06-09 22:00:53 +02:00
Peter Kjellerstedt
263c5b227b rtsp: Avoid a compiler warning. 2009-06-09 18:24:55 +02:00
Peter Kjellerstedt
dfc57e3f8a rtsp: Updated documentation for GstRTSPResult.
Moved GST_RTSP_ELAST to be last in the documentation to match the actual
enum values.
2009-06-09 18:23:28 +02:00
Peter Kjellerstedt
9c40eeeb4c rtsp: Plug a memory leak.
Free memory related to any partially read and/or written RTSP messages.
2009-06-09 16:28:20 +02:00
Peter Kjellerstedt
2dbd8702dd rtsp: Fixed a typo. 2009-06-05 14:06:17 +02:00
Peter Kjellerstedt
de18ad458f rtsp: Remove an unused variable. 2009-06-05 14:05:54 +02:00
Peter Kjellerstedt
b0a9848524 rtsp: Removed duplicate initialization of conn->writefd. 2009-06-05 13:59:14 +02:00
Peter Kjellerstedt
0167e3589d rtsp: Use #defined status codes. 2009-06-05 13:55:08 +02:00