Commit graph

165 commits

Author SHA1 Message Date
Ognyan Tonchev
7e9df0e112 rtsp-client: Make configure_client_transport virtual
This patch makes configure_client_transport virtual. The functionality is
needed to handle some weird clients sending multicast transport settings as url
options.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702173
2013-06-17 16:18:37 +02:00
Ognyan Tonchev
b5f8ff8232 rtsp-client: Make param_set and param_get virtual
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702072
2013-06-17 16:11:40 +02:00
David Svensson Fors
6151072a2e media: convert_range replaces get_range_times
get_range_times worked for handling UTC ranges for seeks, but we also
need to convert back from NPT to the requested unit in
get_range_string. convert_range is now used for both.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702084
2013-06-14 16:11:34 +02:00
Wim Taymans
3dbe0e17d4 sdp: cleanup sdp info
We don't need to pass the proto, we can more easily check a boolean.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702063
2013-06-14 16:06:46 +02:00
Alexander Schrab
275e2d52a4 use local address, not remote, in SDP
See https://bugzilla.gnome.org/show_bug.cgi?id=702063
2013-06-14 15:52:14 +02:00
Alexander Schrab
3e119be829 rtspstream: handle both ipv4 and ipv6 clients
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701129
2013-06-03 11:23:40 +02:00
Wim Taymans
7526178a09 client: improve debug 2013-05-30 10:52:46 +02:00
Wim Taymans
d638b03ff9 server: refactor connection setup
Let the server accept the socket connection and construct a GstRTSPConnection
from it. Remove the code from the client and let the client only deal with
a fully configure GstRTSPConnection object.

We will need this later when the server will configure the connection for
TLS.
2013-05-30 07:18:22 +02:00
Alexander Schrab
c75e1c6b47 rtsp-server: Do not crash on nmapping of server
* generate error when gst_rtsp_connection_accept fails
* do not stop accepting incoming connections because
  accepting a client fails

https://bugzilla.gnome.org/show_bug.cgi?id=701072
2013-05-27 13:20:36 +02:00
Alexander Schrab
e047c9fec1 rtsp-client: ipv4 adress should not be marked ipv6 even if socket is ipv6
https://bugzilla.gnome.org/show_bug.cgi?id=700953
2013-05-27 11:15:50 +02:00
David Svensson Fors
bba7c4042d client: send out teardown signal before tearing down
The advantage is that in the signal handler you get direct access to
information about what streams are about to get torn down (in the
GstRTSPClientState).

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697686
2013-04-15 12:21:54 +02:00
David Svensson Fors
825d6f0b51 client: expose connection
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=697546
2013-04-15 12:17:34 +02:00
Olivier Crête
c18eafbb24 rtsp-media/client: Reply to PLAY request with same type of Range
Remember the type of Range from the PLAY request and use the same type for
the reply.
2013-03-22 15:53:06 +01:00
Patricia Muscalu
8a08fddb41 rtsp-client: expose uri 2013-03-18 23:44:38 +00:00
Olivier Crête
b9d111372e Document locking and its order 2013-03-11 11:07:19 +01:00
Olivier Crête
773c48e22f client: Check client provided addresses against the address pool 2013-03-11 11:07:19 +01:00
Wim Taymans
6db0dbc76c client: make sure the watch exists while sending data
Protect the send_func with a lock. This allows us to wait for sending
to complete before changing the send_func and user_data. We add an
extra ref to the watch to make sure that it remains valid during
sending.
When closing the connection, set the send_func to NULL

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=692433
2013-01-28 11:11:46 +01:00
Wim Taymans
4100b20b0a rtsp-client: set the client backlog
Set the client backlog to a reasonable default
2012-12-14 11:58:29 +01:00
Wim Taymans
38addd7822 Revert "client: never call gst_rtsp_media_unprepare, let gst_rtsp_media_finalize do it"
This reverts commit ba5b78ff2f.

We can't use the refcount to trigger unprepare because it is the unprepare call
that removes the last refcount after all messages are consumed. What we should
probably do is make a prepared refcount and only unprepare when the refcount
reaches 0.
2012-11-30 14:36:30 +01:00
Alessandro Decina
ba5b78ff2f client: never call gst_rtsp_media_unprepare, let gst_rtsp_media_finalize do it
Calling gst_rtsp_media_unprepare breaks shared medias. Just unref
GstRTSPMedia instances and let gst_rtsp_media_finalize unprepare when a media
isn't being used anymore.
2012-11-30 07:06:17 +01:00
Wim Taymans
865c9a6b30 Revert "client: TEARDOWN brings that state to Init again"
This reverts commit 4b61fdad85.

The object is already disposed, there is no point in setting the state.
2012-11-29 17:07:30 +01:00
Wim Taymans
4b61fdad85 client: TEARDOWN brings that state to Init again 2012-11-29 12:30:20 +01:00
Wim Taymans
ad00c5e792 rtsp: make object details private
Make all object details private
Add methods to access private bits
2012-11-29 11:11:05 +01:00
Wim Taymans
e5ba372808 client: fix factory leak
Keep the factory in the state object only for authorization checks and make
sure we unref it on failure. Also don't keep invalid objects in the state
object.
2012-11-28 11:05:08 +01:00
Wim Taymans
b3fe3357ab client: improve debug 2012-11-27 12:33:02 +01:00
Wim Taymans
d5389c940d client: improve debug and fix leaks
Cleanup the uri and session when there is a bad request.
2012-11-27 12:24:21 +01:00
Wim Taymans
a26e9b621e client: use 454 when session can't be found
We should use 454 when a session can't be found because there was no session
pool configured in the server. This is not a server configuration problem
because the server on which the request is done might not be the same one that
will keep the sessions for us and so it does not need to support sessions.
2012-11-27 12:11:41 +01:00
Wim Taymans
4782d08bdc client: only free connection when there is one
It's possible that the client doesn't have a connection when we try to free it.
2012-11-27 11:17:45 +01:00
Wim Taymans
18bb9ffa6b client: small cleanup 2012-11-26 17:35:51 +01:00
Wim Taymans
9f8e8bc02d client: fix compilation 2012-11-26 17:34:24 +01:00
Wim Taymans
eb88fa9e76 client: call destroy without the lock 2012-11-26 17:28:29 +01:00
Wim Taymans
33da3af265 client: make the client usable without a socket
Make a method to let the client handle a message and a callback when the client
wants us to send a response message back. This makes it possible to also use the
client object without the sockets, which should make it easier to test.
2012-11-26 17:20:39 +01:00
Wim Taymans
26a4b98ab0 client: small cleanup 2012-11-26 16:45:04 +01:00
Wim Taymans
8da4171055 client: remove reference to server
We don't need to keep a ref to the server
2012-11-26 16:39:26 +01:00
Wim Taymans
4fa7502fd9 client: add locking
Also add some g_return_if()
2012-11-26 16:31:43 +01:00
Wim Taymans
b21b46ec4d client: log more errors 2012-11-26 13:37:20 +01:00
Wim Taymans
f460e7360e client: fix compilation 2012-11-26 13:36:19 +01:00
Wim Taymans
84e72262d0 client: add generic close-after-send support
Add a property to send_response() to close the connection after the response has
been sent to the client.
2012-11-26 13:19:06 +01:00
Wim Taymans
1d53c46d23 MediaMapping -> MountPoints
Describes better what the object manages.
2012-11-26 12:37:55 +01:00
David Svensson Fors
01973c924d rtsp-media: remove bus watch before finalizing
* A GDestroyNotify function is set for the bus watch in gst_rtsp_media_prepare.
* An extra media ref is added for the bus watch. This extra ref is unreffed by
the GDestroyNotify function.
* gst_rtsp_media_unprepare destroys the source so the bus watch is removed.
* GstRTSPClient, which calls gst_rtsp_media_prepare, also calls
gst_rtsp_media_unprepare before unreffing the media.

This way, the bus watch will be removed before the media is finalized.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688707
2012-11-20 09:46:00 +01:00
Alessandro Decina
65042a9551 client: wait until the TEARDOWN response is sent to close the connection
Responses can be sent async so we need to wait until the TEARDOWN response has
been written before we close the connection to the client. This avoids the risk
of writing/polling closed sockets.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=688535
2012-11-20 09:32:19 +01:00
Tim-Philipp Müller
290968eb8c rtsp-client: fix unused-but-set-variable compiler warning
rtsp-client.c:1260:21: error: variable 'protocols' set but not used
2012-11-17 00:03:42 +00:00
Wim Taymans
26ff5fc073 rtsp: cleanups 2012-11-15 17:11:16 +01:00
Wim Taymans
e4ea72ccdf stream: use the address managed by the stream
Use the address managed by the stream for multicast. This allows us to have 1
multicast address for each stream.
Because the address is now managed by the stream we don't have to pass it around
anymore.
Set the address pool on the streams.
2012-11-15 16:18:29 +01:00
Wim Taymans
ba21661ce4 rtsp: improve debug 2012-11-15 16:15:20 +01:00
Wim Taymans
2160d6dbd3 client: set blocksize only on stream
Set the blocksize only on the current stream.
2012-11-15 15:29:35 +01:00
Wim Taymans
45b6693b39 rtsp: make address-pool return an address object
Return a boxed GstRTSPAddress from the GstRTSPAddressPool. This allows us to
store more info in the structure and allows us to more easily return the address
to the right pool when no longer needed.
Pass the address to the StreamTransport so that we can return it to the pool
when the stream transport is freed or changed.
2012-11-15 13:25:14 +01:00
Wim Taymans
f15ffb521c rtsp: use AddressPool
Remove the multicast_group property.
Use the configured addresspool to allocate multicast addresses.
2012-11-14 17:23:59 +01:00
Wim Taymans
c431592976 client: rename method
gst_rtsp_client_create_from_socket -> gst_rtsp_client_use_socket: we
don't really create the client from the socket, we use the socket for the
client.
2012-11-12 15:01:13 +01:00
Wim Taymans
a58d404e1f server: rework maincontext handling in clients
Make a separate method to attach a client to a MainContext.

Let the server decide in what GMainContext the client will operate and give this
context to the client in attach. Then the server can later decide to use a
separate thread for each client or just use the mainthread.
2012-11-12 15:01:09 +01:00