Commit graph

249 commits

Author SHA1 Message Date
Andy Wingo
dd699397c2 add gst_rtsp_url_decode_path_components
* gst-libs/gst/rtsp/gstrtspurl.h:
* gst-libs/gst/rtsp/gstrtspurl.c (gst_rtsp_url_decode_path_components):
  New public function, returns a strv of uri-decoded path components.

* tests/check/Makefile.am:
* tests/check/libs/rtsp.c: Add tests.
2010-12-15 17:51:36 +01:00
Edward Hervey
f9c7be9639 rtsp: Move around the typedefs to make GIR happy
Otherwise it will generate they symbols as _GstRTSP* (with the leading
underscore).
2010-12-07 17:35:56 +01:00
Edward Hervey
8743c88a33 libgstrtsp: Fix typo in .pc to use for GIR 2010-12-02 19:11:37 +01:00
Evan Nemerson
8fb2c27ed0 introspection: Add information on exported packages to GIRs
https://bugzilla.gnome.org/show_bug.cgi?id=635392
2010-11-21 00:44:37 +00:00
Wim Taymans
ac06dd5d0e rtspconnection: calculate better timeout value
We want to send the keealive message a little earlier than the timeout value
specifies. Scale this based on the value of the timeout instead of just assuming
5 seconds.
2010-10-29 14:22:39 +01:00
Thijs Vermeir
2e888cb784 rtsp: don't let the rtsp connection timeout
Because we should act before the rtsp server does a timeout, we
reduce the timeout-time with 5 seconds, this should be safe to always
keep te rtsp connection alive.

https://bugzilla.gnome.org/show_bug.cgi?id=633455
2010-10-29 14:22:39 +01:00
Tim-Philipp Müller
be36a64c57 libs: touch marshal.list files to force rebuild after Makefile.am changes
Force regeneration of marshal.[ch] files after prefix changes in
Makefile.am, to avoid build errors for those of us who don't
habitually make clean first.
2010-10-19 00:07:47 +01:00
Tim-Philipp Müller
f396a37fc5 rtsp: don't export marshaller function
Make sure the marshaller function isn't exported. As it was
never in a public header file, this should be fine.
2010-10-15 23:54:40 +01:00
Tim-Philipp Müller
6f87bc2307 rtsp: make public _get_type() functions thread-safe 2010-10-08 11:34:59 +01:00
Tim-Philipp Müller
d59558af87 rtspurl: minor clean-up
Merge and const-ify two arrays that should be one.
2010-10-08 11:34:59 +01:00
Tim-Philipp Müller
06afe5f049 rtsp: fix enum value name in enums that are public API
https://bugzilla.gnome.org/show_bug.cgi?id=629746
2010-10-08 11:34:58 +01:00
Tim-Philipp Müller
e776699036 build: use new AG_GST_PKG_CONFIG_PATH m4 macro from common
Sets up a GST_PKG_CONFIG_PATH variable for use in Makefile.am
(avoids trailing ':' in PKG_CONFIG_PATH used).
2010-08-14 19:12:37 +01:00
Tim-Philipp Müller
b61b83376a introspection: set PKG_CONFIG_PATH so that our in-tree libs come first when calling scanner
When calling gobject-introspection scanner, make sure our own
freshly-built libs within the source tree (well, build dir) come
first in the PKG_CONFIG_PATH. May or may not help to make sure
that it doesn't pick up older external plugins-base libs (or
.gir files) from outside the source tree / build directory as
dependencies of the introspected lib instead of using the
stuff we just built in a sibling directory.

https://bugzilla.gnome.org/show_bug.cgi?id=623698
2010-08-14 19:11:48 +01:00
Stefan Kost
18f07f03d1 docs: be more firendly to gtk-doc limitted parsing capabilities 2010-05-06 11:34:53 +03:00
Stefan Kost
639e1ab2b5 docs: fix wrong doc markup 2010-05-06 09:42:02 +03:00
Tim-Philipp Müller
7fee2c0fe7 rtsp: weekday and month names in RTSP date string should be in C locale
Create date string using C locale weekday and month names.

Fixes #617636.
2010-05-05 13:04:25 +01:00
Tim-Philipp Müller
00f7fbe750 rtsp: deprecate remaining base64 function now that we depend on GLib 2.20
API: deprecate gst_rtsp_base64_decode_ip(), use g_base64_decode_inplace() instead
2010-04-30 20:01:55 +01:00
Wim Taymans
318fbf3310 rtspconnection: Handle closed POST socket in tunneling
Catch more socket errors.
Rework how sockets are managed in the GSource, wake up the maincontext instead
of adding/removing the sockets from the source.
Add callback for when the tunnel connection is lost. Some clients (Quicktime
Player) close the POST connection in tunneled mode and reopen the socket when
needed.

See #612915
2010-04-06 10:59:39 +02:00
Vincent Untz
764c899215 libs: point gobject-introspection scanner to .la files
Point g-ir-scanner to the .la file of our library, which hopefully
makes it find the right dependencies in all cases (ie. our locally
built libgstreamer and not the system-installed one). This is also
how it's done in Gtk+ and how it's documented in the wiki, see
http://live.gnome.org/GObjectIntrospection/AutotoolsIntegration

Fixes #603710.
2010-04-03 14:03:45 +01:00
Tim-Philipp Müller
b37c993e4e gst-libs: more gobject-introspection fixes
Use right .pc file variable for compiler includes this time:
g-ir-compiler wants the girdirs not the typelibdirs as includes.
2010-03-30 23:46:10 +01:00
Tim-Philipp Müller
64cfa6bf73 gst-libs: fix up gobject-introspection some more
Use new girdir and typlibdir from core .pc files, so we can figure
out the right includes to pass to the gobject-introspection tools,
whether core is installed in the same prefix as gobject-introspection
or in a different prefix or uninstalled. This also keeps us from adding
bogus paths to the includes that only work if core is uninstalled.

Also add some missing includes/pkgs where needed.
2010-03-30 19:56:56 +01:00
Wim Taymans
4ff230e71b rtsptransport: ignore unparsable ranges
Ignore unparsable port ranges instead of erroring out.

Fixes #613591
2010-03-24 12:10:38 +01:00
Wim Taymans
6e8ed14a9d rtsp: add GType for transport flags
Make a method to register the transport flags as a GType.
2010-03-19 15:00:01 +01:00
Peter Kjellerstedt
f21e123bcc rtsp: Further clean up of gst_rtsp_strresult()
Since we no longer use an array of error messages, there is no reason
to clamp the error code, which allows us to simplify the code some more
and also to actually report the correct error code for unknown errors.
2010-03-17 16:39:13 +01:00
Benjamin Otte
20c9b8eae3 rtsp: Refactor gst_rtsp_strresult
2 goals in the refactoring:
- Put the error messages closer to their enum values, so that it's easy
  to see which error belongs to which value.
- Make gcc not complain with -Wformat-nonliteral
2010-03-17 12:09:25 +01:00
Benjamin Otte
3bd4aa26ff Add -Wwrite-strings to configure
Fixes for the code included
2010-03-16 17:41:51 +01:00
Wim Taymans
999cc34c83 rtspconnection: allow for more ipv6 addresses
Use hints in getaddrinfo() so that we can also resolve ipv6 addresses.
2010-03-16 16:24:21 +01:00
Tim-Philipp Müller
e836151009 docs: more helper libraries docs fixes
Quieten gtk-doc a bit more.
2010-03-16 00:44:50 +00:00
Tim-Philipp Müller
4b06fad321 docs: add GstRTSPExtension to docs
Add minimal docs for GstRTSPExtension so people know it exists.
2010-03-16 00:04:41 +00:00
Wim Taymans
2221e404de rtsp: make timeout usec more accurate
Adjust the returned usec from the elapsed time so it represents the remaining
timeout.
2010-03-15 11:36:22 +01:00
Benjamin Otte
43b1683421 Add -Wmissing-declarations -Wmissing-prototypes to warning flags
Includes all the fixes necessary to make stuff compile again.
2010-03-11 13:50:31 +01:00
Sebastian Dröge
d5a4ca9962 build: Make some more rules silent if requested 2010-03-09 21:01:38 +00:00
Dake Gu
f37b42b40d rtspconnection: fix handling of x-server-ip-address
Fix handling of x-server-ip-address.
2010-03-08 11:20:51 +01:00
Patrick Radizi
a8f51d61f7 rtspconnection: make sure not to dereference NULL username or password
Fixes #610268.
2010-02-18 18:00:38 +00:00
Wim Taymans
30fd219e63 rtsp: ignore \n and \r as the first line
Be more forgiving for bad servers and ignore \r and \n when we are looking for
the response/request line.

See #608417
2010-02-12 11:43:59 +01:00
Wim Taymans
be037e0dc8 rtsp: fail gracefully on bad Content-Length headers
Be careful when allocating the amount of bytes specified in the Content-Length
because it can be an insanely huge value. Try to allocate the memory but fail
gracefully with a nice error when the allocation failed.
2010-02-12 11:43:59 +01:00
Benjamin Otte
0994a5bff3 rtsp: Don't define h_error ourselves
It's included from netdb.h and that header might define it differently,
which can lead to build failures.
2010-01-13 23:06:40 +01:00
Sreerenj B
f3b3dd33f3 rtsp: avoid crashing on SIGPIPE
Use send() instead of write() so that we can pass the MSG_NOSIGNAL flags to
avoid crashing with SIGPIPE when the remote end is not listening to us anymore.

Fixes #601772
2009-11-13 11:18:46 +01:00
Tim-Philipp Müller
65765dffbf .gitignore: update after files got renamed 2009-10-17 21:11:10 +01:00
Stefan Kost
f1c32d0fbb build: fix previous commit to fully accomodate the glib-gen.mak changes
I also renamed glib_enum_prefix to glib_gen_prefix as we also use that for the
marshallers. Also rename the rtsp-marshal.list to work with the unified prefix.
2009-10-16 10:56:56 +03:00
Stefan Kost
a89c1de0ea build: use gst-glib-gen.mak to fix the glib build rules. Fixes #598114
The build rules in glib-gen.mak were using pattern rules in a non save way.
2009-10-16 10:23:09 +03:00
Patrick Radizi
48a44f470b rtsp: handle socket errors
gstrtspconnection.c:gst_rtsp_connection_receive() can hang when an error occured
on a socekt. Fix this problem by checking for error on 'other' socket after poll
return.

Fixes #596159
2009-10-12 15:48:46 +02:00
Tim-Philipp Müller
92465ba8ac rtspconnection: we can use GLib 2.18 API unconditionally now 2009-10-07 10:32:17 +01:00
Wim Taymans
730eead9a9 rtsp: use CLOSE_SOCKET() instead of close()
Use CLOSE_SOCKET instead of directly calling close() because it does the right
thing for windows.

Fixes #597539
2009-10-06 22:37:00 +02:00
Sebastian Dröge
df9b8b57b3 introspection: Build pkgconfig before all libraries and set PKG_CONFIG_PATH
This way g-ir-scanner can find the gstreamer-*-0.10 pkg-config files.
2009-09-13 11:19:50 +02:00
Wim Taymans
8d2f20d1cb rtsp: properly fix the HTTP manual mode
When we're not parsing HTTP, return EPARSE when we get an HTTP
message.
2009-09-11 12:20:10 +02:00
Wim Taymans
ca3b91b2d0 rtsp: don't return EPARSE
Don't blindly return EPARSE when http mode is disabled.
Restore old http mode after temporarily setting it to TRUE.
2009-09-10 14:04:53 +02:00
Sebastian Dröge
40aba9e0dc introduction: Fix out-of-tree build 2009-09-05 13:46:58 +02:00
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
Peter Kjellerstedt
c1a6644a18 rtsp: Correct gen_tunnel_reply().
Prevent gen_tunnel_reply() from generating an incomplete response
in case an error response code is given.
2009-06-05 13:53:29 +02:00
Wim Taymans
59d9833924 rtsp: add G_LIKELY because we can 2009-06-02 12:10:39 +02:00