Commit graph

54 commits

Author SHA1 Message Date
Wim Taymans
88110ea67e rtsp: use fully qualified urls when using a proxy
Use a fully qualified url when specifying the url for tunneled requests through
a proxy.
See #573173
2009-04-02 22:28:55 +02:00
Wim Taymans
eed784b372 rtsp: fix little typo in the comments 2009-04-01 09:03:35 +02:00
Tim-Philipp Müller
fc8c5cba15 rtspconnection: make gst_rtsp_watch_queue_message() thread-safe
People might queue messages from a thread other than the thread in which
the main context which this watch is attached is iterated from, so use
a GAsyncQueue instead of a GList, so g_list_append() doesn't trample
over list nodes just freed in the other thread. This just fixes issues
I've had with gst-rtsp-server. We might need more locking in various
places here.
2009-03-31 18:30:57 +01:00
Tim-Philipp Müller
dfe96ce618 rtsp: clear the entire builder structure
And use structure instead of variable with sizeof when
clearing the rtsp message structure, for clarity.
2009-03-31 18:30:48 +01:00
Wim Taymans
8b37dc3eb8 rtsp: add support for proxies
Add suport for proxy servers. Currently only used for tunneled HTTP
connections without authentication.
2009-03-31 19:00:00 +02:00
Wim Taymans
0d3d3026d2 rtsp: start CSeq counting from 1 instead of 0
Start counting from 1 instead of 0 as this is what most other clients
seem to do.
2009-03-25 16:37:28 +01:00
Wim Taymans
f4b7cbbf16 rtsp: fix resolving of hostnames
We were returning a pointer to a stack variable with the resolved hostname,
which doesn't work.
return a copy of the resolved ip address instead.
Fixes #575256.
2009-03-13 16:19:41 +01:00
Wim Taymans
0e2157029e rtsp: fix parsing of the timeout parameter
--
2009-03-11 18:45:59 +01:00
Wim Taymans
16225d45be rtsp: keep track of amount of decoded bytes
Keep track of the actual amount of decoded bytes, which can be less than 3 when
we decode the last bits of a base64 message.
2009-03-11 14:09:54 +01:00
Wim Taymans
3a72044a22 rtsp: use glib base64 encoder
--
2009-03-09 13:51:48 +01:00
LRN
eb3ff95a3a rtsp: fix compilation on windows.
Remove unused variable when building for windows.
Fixes #574443.
2009-03-08 18:17:48 +01:00
Wim Taymans
2cc1a6808d rtsp: Add methods for getting the read/write fds
API:gst_rtsp_connection_get_readfd()
API:gst_rtsp_connection_get_writefd()
2009-03-06 18:54:57 +01:00
Julien Moutte
d45b27d92d Fix build on Mac OS X 2009-03-06 10:37:38 +01:00
Wim Taymans
bcaec3d907 rtsp: do some more cleanup in _close
Do som more cleanup in gst_rtsp_connection_close() so that it's back into the
unconnected state as it was allocated.
2009-03-04 16:24:01 +01:00
Wim Taymans
629f2dcee4 rtsp: fix the memory management of the url
Constify the url parameter in _create.
Make a copy of the url stored in the connection.
Free the url when the connection is freed.
2009-03-04 16:11:20 +01:00
Wim Taymans
b6d7a1dc03 RTSP: Add support for server tunneling
Save the tunnelid in the connection. Add a method to retrieve the tunnelid so
that a server can store and match the id against other tunnel requests.

Fix the URI in the tunnel requests so that they contain the absolute uri and the
query string if any instead of just the hostname.

Transparently base64 decode the input stream when tunneling.

Add method to set the connection ip address so that it can be included in the
tunnel response.

Add method to connect the two tunnel requests.

Add two callbacks for the async mode to notify a tunnel start and tunnel
complete event.

Add method to reset the watch after the connection has been tunneled.

Various little refactoring to make more stuff reusable.

API: RTSP::gst_rtsp_connection_set_ip()
API: RTSP::gst_rtsp_connection_get_tunnelid()
API: RTSP::gst_rtsp_connection_do_tunnel()
API: RTSP::gst_rtsp_watch_reset()
2009-03-04 12:21:29 +01:00
Wim Taymans
9045d210b2 rtsp: remove debugging g_message
--
2009-03-02 16:13:33 +01:00
Wim Taymans
fbc4f2d4fe RTSP: add support for Quicktime tunneled RTSP
Add support for tunneling RTSP over HTTP.
Fix documentation some more.
See also #573173.

API: RTSP:gst_rtsp_connection_is_tunneled()
API: RTSP:gst_rtsp_connection_set_tunneled()
2009-03-02 16:03:49 +01:00
Wim Taymans
4664fe40bc rtsp: add _get_url method and separate sockets
Add gst_rtsp_connection_get_url() method.

Reserve space for 2 sockets, one for reading and one for writing. Use socket
pointers to select the read and write sockets. This should allow us to implement
tunneling over HTTP soon.

API: RTSP::gst_rtsp_connection_get_url()
2009-03-02 10:58:49 +01:00
LRN
e5d2d32bba rtspconnection: Use correct types for some functions on Win32
Fixes bug #573529.
2009-02-28 19:35:33 +01:00
Edward Hervey
ed013753c0 rtspconnection: Fix warning about using unitialized value. 2009-02-28 13:11:59 +01:00
Peter Kjellerstedt
2fe8e4c1de Fixed a typo. 2009-02-25 16:25:33 +01:00
Peter Kjellerstedt
a038a8d46d rtsp, multifdsink: Unify the use of union gst_sockaddr. 2009-02-25 15:45:50 +01:00
Jan Schmidt
94791df88d rtsp: Fix a strict aliasing warning
Fix strict aliasing warnings from casting a sockaddr_storage and
using it as a sockaddr_in6. Use a union instead.
2009-02-24 16:49:40 +00:00
Wim Taymans
bb5e2d3f56 Match WSAStartup and WSACleanup correctly
Don't randomly call WSAStartup and WSACleanup but instead call the startup when
we create a connection and cleanup when we free it again. Because the internal
datastructure is refcounted, this should not cause any refcounting leaks when
the connection is managed correctly.
Fixes #562794.
2009-02-24 12:11:00 +01:00
Wim Taymans
bb4310203a Add trailing \0 to message length
We always put a trailing 0 at the end of the message body. Reflect this fact in
the length of the message.
2009-02-20 12:35:53 +01:00
Wim Taymans
0ffd5e703a Don't parse headers for data messages
Don't try to parse the headers on a data message because they don't have
headers.
2009-02-20 09:52:16 +01:00
Wim Taymans
f187ffddce Make RTSPConnection opaque and rename RTSPChannel
Make the RTSPConnection object opaque so that we can extend it in the future.

Rename GstRTSPChannel to GstRTSPWatch to avoid confusing with the RTSP channels.
2009-02-19 15:55:07 +01:00
Wim Taymans
a2f04c8f61 Add RTSP accept method
Add a method to accept a connection on a socket and create a GstRTSPConnection
for it.

API: gst_rtsp_connection_accept()
2009-02-18 18:46:35 +01:00
Wim Taymans
a6d75bd33c Add RTSP channel object for async io
Add a GstRTSPChannel object that wraps a GSource around the RTSP connection so
that the connection can be monitored from a maincontext. This allows us to
operate in ASYNC mode, which is handy when building a server.

Rework the old code to use the async code under the hood.

API: gst_rtsp_channel_new()
API: gst_rtsp_channel_unref()
API: gst_rtsp_channel_attach()
API: gst_rtsp_channel_queue_message()
2009-02-18 17:42:59 +01:00
Wim Taymans
ad1dea3122 Add more g_return_if_fail() calls
Check that we have a valid file descriptor before entering certain functions in
order to avoid undesirable situations.
Add some more debugging in the connect method.
2009-02-04 11:18:31 +01:00
Wim Taymans
484a025f6d Add new RTSP message method to set header
Add gst_rtsp_message_take_header() that takes ownership of the passed header
value. This allows us to avoid an allocations and memory copy in some
situations.
API: GstRTSPMessage::gst_rtsp_message_take_header()
2009-01-29 11:55:10 +01:00
이문형
d80a5c9dbc gst-libs/gst/rtsp/gstrtspconnection.c: A successful gst_poll_wait() doesn't always mean successful connect() on
Original commit message from CVS:
Patch by: 이문형 <iwings at gmail dot com>
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_connect):
A successful gst_poll_wait() doesn't always mean successful connect() on
Windows.  We should check errors by calling gst_poll_fd_has_error().
See #561924.
2008-11-27 11:16:44 +00:00
Damien Lespiau
81724500ec gst-libs/gst/rtsp/gstrtspconnection.c: Make the next call to poll not depend on previous calls to poll with or withou...
Original commit message from CVS:
Patch by: Damien Lespiau  <damien.lespiau gmail com>
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_write):
Make the next call to poll not depend on previous calls to poll with or
without reading from the active descriptor. Fixes #544293.
2008-11-03 10:49:24 +00:00
David Schleef
526b2e63a2 gst-libs/gst/rtsp/gstrtspconnection.c: Fix build on win32.
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
Fix build on win32.
Patch By: David Schleef <ds@schleef.org>
Fixes: #536874
2008-06-11 20:13:00 +00:00
Peter Kjellerstedt
26cd5ea1c8 gst-libs/gst/rtsp/gstrtspconnection.*: Add a couple of missing argument guards.
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_set_auth), (gst_rtsp_connection_set_auth_param),
(gst_rtsp_connection_clear_auth_params),
(gst_rtsp_connection_set_qos_dscp), (gst_rtsp_connection_get_ip):
* gst-libs/gst/rtsp/gstrtspconnection.h:
Add a couple of missing argument guards.
Add a way of setting the DSCP for an RTSP connection.
Add an accessor method for the ip member of GstRTSPConnection as all
members are supposed to be private.
2008-06-04 11:53:53 +00:00
Wouter Cloetens
a8a2b9c717 gst-libs/gst/rtsp/: Add Digest authorization support for RTSP connections. See #532065.
Original commit message from CVS:
Patch by: Wouter Cloetens <zombie at e2big dot org>
* gst-libs/gst/rtsp/Makefile.am:
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_create), (md5_digest_to_hex_string),
(auth_digest_compute_hex_urp), (auth_digest_compute_response),
(add_auth_header), (gst_rtsp_connection_free),
(gst_rtsp_connection_set_auth), (str_case_hash), (str_case_equal),
(gst_rtsp_connection_set_auth_param),
(gst_rtsp_connection_clear_auth_params):
* gst-libs/gst/rtsp/gstrtspconnection.h:
Add Digest authorization support for RTSP connections. See #532065.
* gst-libs/gst/rtsp/md5.c:
* gst-libs/gst/rtsp/md5.h:
Yeap, another md5 implementation until we can depend on a glib that has
support for it.
2008-05-08 14:46:27 +00:00
Wim Taymans
fc97139103 gst-libs/gst/rtsp/gstrtspconnection.c: Don't error when poll_wait returns EAGAIN.
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_connect), (gst_rtsp_connection_write),
(gst_rtsp_connection_read_internal), (gst_rtsp_connection_poll):
Don't error when poll_wait returns EAGAIN.
2008-03-24 16:40:08 +00:00
Ole André Vadla Ravnås
aca58fb8ac gst-libs/gst/rtsp/gstrtspconnection.c: Generic Windows fixes that makes libgstrtsp work on Windows when coupled with ...
Original commit message from CVS:
Patch by: Ole André Vadla Ravnås  <ole.andre.ravnas@tandberg.com>
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_connect), (gst_rtsp_connection_write),
(read_line), (gst_rtsp_connection_read_internal):
Generic Windows fixes that makes libgstrtsp work on Windows when
coupled with the new GstPoll API. See #520808.
2008-03-18 11:10:12 +00:00
Wim Taymans
8a822e70be gst/: Remove GstPollMode from gstpoll constructor.
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_create):
* gst/tcp/gstmultifdsink.c: (gst_fdset_mode_get_type),
(gst_multi_fd_sink_class_init), (gst_multi_fd_sink_start):
* gst/tcp/gstmultifdsink.h:
* gst/tcp/gsttcpclientsrc.c: (gst_tcp_client_src_start):
* gst/tcp/gsttcpserversrc.c: (gst_tcp_server_src_start):
Remove GstPollMode from gstpoll constructor.
2008-03-07 15:48:51 +00:00
Tim-Philipp Müller
d85688b8a2 gst-libs/gst/rtsp/gstrtspconnection.c: Don't include unix headers unconditionally (fixes #518037).
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
Don't include unix headers unconditionally (fixes #518037).
2008-03-02 18:32:36 +00:00
Wim Taymans
0667334b2d gst-libs/gst/rtsp/gstrtspconnection.*: Use GstPoll for the rtsp connection.
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_create), (gst_rtsp_connection_connect),
(gst_rtsp_connection_write), (gst_rtsp_connection_read_internal),
(gst_rtsp_connection_receive), (gst_rtsp_connection_close),
(gst_rtsp_connection_free), (gst_rtsp_connection_poll),
(gst_rtsp_connection_flush):
* gst-libs/gst/rtsp/gstrtspconnection.h:
Use GstPoll for the rtsp connection.
2008-02-28 09:50:52 +00:00
Sebastian Dröge
8b970c5581 Use gmtime_r if available as gmtime is not MT-safe.
Original commit message from CVS:
* configure.ac:
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
Use gmtime_r if available as gmtime is not MT-safe.
Fixes bug #511810.
2008-02-02 07:13:15 +00:00
Sebastian Dröge
044f629784 gst-libs/gst/rtsp/gstrtspconnection.c: Cast glong to time_t as time_t might have a different type on other platforms,...
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
Cast glong to time_t as time_t might have a different type on
other platforms, like FreeBSD, and we get a compiler warning
otherwise. Fixes bug #511825.
2008-02-02 06:52:41 +00:00
Jan Schmidt
2531fca577 gst-libs/gst/rtsp/gstrtspconnection.c: Revert patch to gstrtspconnection.c for brown paper bag release of -base. Re-o...
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c:
Revert patch to gstrtspconnection.c for brown paper bag
release of -base. Re-opens: #511825
2008-01-30 12:28:59 +00:00
Sebastian Dröge
bd4bb423e9 gst-libs/gst/rtsp/gstrtspconnection.c: Cast glong to time_t as time_t might have a different type on other platforms,...
Original commit message from CVS:
* gst-libs/gst/rtsp/gstrtspconnection.c: (add_date_header):
Cast glong to time_t as time_t might have a different type on
other platforms, like FreeBSD, and we get a compiler warning
otherwise. Fixes bug #511825.
2008-01-29 09:59:03 +00:00
Tim-Philipp Müller
aa47d077c1 gst-libs/gst/: Turn a few g_assert_not_reached() into g_return_val_if_reached() to avoid compiler warnings (#503930).
Original commit message from CVS:
* gst-libs/gst/cdda/gstcddabasesrc.c: (gst_cdda_base_src_do_seek),
(gst_cdda_base_src_handle_track_seek), (gst_cdda_base_src_create):
* gst-libs/gst/pbutils/install-plugins.c:
(gst_install_plugins_spawn_child), (gst_install_plugins_supported):
* gst-libs/gst/pbutils/missing-plugins.c:
(gst_missing_plugin_message_get_installer_detail),
(gst_missing_encoder_installer_detail_new):
* gst-libs/gst/rtsp/gstrtspconnection.c: (gst_rtsp_connection_send):
* gst-libs/gst/rtsp/gstrtspmessage.c: (gst_rtsp_message_unset):
Turn a few g_assert_not_reached() into g_return_val_if_reached() to
avoid compiler warnings (#503930).
2007-12-16 23:52:58 +00:00
Peter Kjellerstedt
ba4bb0fa8c gst-libs/gst/rtsp/gstrtspconnection.c: Close control sockets. Fixes #503440.
Original commit message from CVS:
Patch by: Peter Kjellerstedt  <pkj at axis com>
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_free):
Close control sockets. Fixes #503440.
2007-12-13 15:54:00 +00:00
Vincent Torri
be04e7c294 gst-libs/gst/fft/: Include our own _stdint.h instead of sys/types.h, makes MingW happy (#492306).
Original commit message from CVS:
Patch by: Vincent Torri <vtorri at univ-evry dot fr>
* gst-libs/gst/fft/kiss_fft_s16.h: (KISS_FFT_S16_MALLOC):
* gst-libs/gst/fft/kiss_fft_s32.h: (KISS_FFT_S32_MALLOC):
Include our own _stdint.h instead of sys/types.h, makes MingW happy
(#492306).
* gst-libs/gst/rtsp/gstrtspconnection.c: (gst_rtsp_connection_create):
Use _pipe directly, GLib doesn't have a pipe() macro any longer
(it disappeared in GLib 2.14.0) (#492306).
* gst-libs/gst/sdp/Makefile.am:
* gst-libs/gst/sdp/gstsdpmessage.c:
Fix includes and LIBS for win32/Mingw (#492306).
* tests/examples/dynamic/addstream.c (pause_play_stream):
Use more portable g_usleep() instead of sleep() (#492306).
2007-11-01 13:28:59 +00:00
Tommi Myöhänen
840c5cd805 gst-libs/gst/rtsp/gstrtspconnection.c: Make sure we can not cancel in the middle of receiving a message.
Original commit message from CVS:
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
* gst-libs/gst/rtsp/gstrtspconnection.c:
(gst_rtsp_connection_read_internal), (gst_rtsp_connection_read),
(read_body), (gst_rtsp_connection_receive):
Make sure we can not cancel in the middle of receiving a message.
Fixes #475731.
2007-09-11 19:07:57 +00:00