Commit graph

369 commits

Author SHA1 Message Date
Aleix Conchillo Flaqué
0aad92531d rtsp-client: add stream transport to context
We add the stream transport to the context so we can get the configured
client stream transport in the setup request signal.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=738905
2014-10-21 11:44:40 +02:00
Aleix Conchillo Flaqué
6c0c90c9d2 client: set session media to NULL without the lock
We need to set session medias to NULL without the client lock otherwise
we can end up in a deadlock if another thread is waiting for the lock
and media unprepare is also waiting for that thread to end.

https://bugzilla.gnome.org/show_bug.cgi?id=737690
2014-10-01 10:31:04 +01:00
Sebastian Rasmussen
404a80e38a rtsp-client: Remove backlog limit while processings requests
If the backlog limit is kept two cases of deadlocks may be
encountered when streaming over TCP. Without the backlog
limit this deadlocks can not happen, at the expence of
memory usage.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=737631
2014-09-30 12:22:49 +02:00
Ognyan Tonchev
17f5785638 rtsp-client: do not free main context before rtsp watch
https://bugzilla.gnome.org/show_bug.cgi?id=737110
2014-09-24 10:42:16 +03:00
Branko Subasic
2218510cae rtsp-*: Treat sending packets to clients as keepalive
As long as gst-rtsp-server can successfully send RTP/RTCP data to
clients then the client must be reading. This change makes the server
timeout the connection if the client stops reading.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736647
2014-09-24 10:37:59 +03:00
Branko Subasic
733ef1162b rtsp-client: Allow backlog to grow while expiring session
Allow the send backlog in the RTSP watch to grow to unlimited size while
attempting to bring the media pipeline to NULL due to a session
expiring.  Without this change the appsink element cannot change state
because it is blocked while rendering data in the new_sample callback.
This callback will block until it has successfully put the data into the
send backlog. There is a chance that the send backlog is full at this
point which means that the callback may block for a long time, possibly
forever. Therefore the media pipeline may also be prevented from
changing state for a long time.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736647
2014-09-24 10:37:49 +03:00
Edward Hervey
980553547d rtsp-client: Make old compilers happy
rtsp-client.c:2553:50: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

Just in case that guint8 doesn't fit in a pointer. Just in case ...
2014-09-22 09:30:39 +02:00
Göran Jönsson
23b9d8fbb0 client: raise the backlog limits before pausing
We need to raise the backlog limits before pausing the pipeline or else
the appsink might be blocking in the render method in wait_backlog() and
we would deadlock waiting for paused.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=736322
2014-09-16 11:41:52 +02:00
Göran Jönsson
ebd9be59fe client: make define for the WATCH_BACKLOG
See https://bugzilla.gnome.org/show_bug.cgi?id=736322
2014-09-16 11:29:38 +02:00
Wim Taymans
0292be09ea client: simplify session transport handling
link/unlink of the transport in a session was done to keep track of all
TCP transports and to send RTP/RTCP data to the streams. We can simplify
that by putting all the TCP transports in a hashtable indexed with the
channel number.

We also don't need to link/unlink the transports when we pause/resume
the streams. The same effect is already achieved when we pause/play the
media. Indeed, when we pause the media, the transport is removed from
the media and the callbacks will not be called anymore.

See https://bugzilla.gnome.org/show_bug.cgi?id=736041
2014-09-16 10:46:13 +02:00
Göran Jönsson
09bf2025f8 rtsp-client: Protect saved clients watch with a mutex
Fixes a crash when close() is called while merging clients
in handle_tunnel(). In that case close() would destroy the
watch while it is still being used in handle_tunnel().

https://bugzilla.gnome.org/show_bug.cgi?id=735570
2014-09-04 10:35:56 +03:00
Wim Taymans
ced406cc28 client: expose _close() method
Expose a previously internal close method to close the client
connection.
2014-07-10 17:05:13 +02:00
Wim Taymans
945c93fde0 filter: Release lock in filter functions
Release the object lock before calling the filter functions. We need to
keep a cookie to detect when the list changed during the filter
callback. We also keep a hashtable to make sure we only call the filter
function once for each object in case of concurrent modification.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732950
2014-07-10 11:36:55 +02:00
Ognyan Tonchev
6543082d2b client: check if watch is set in handle_teardown()
The unit tests run without a watch
2014-07-09 16:17:00 +02:00
Ognyan Tonchev
e0bc97e40c client: keep ref to client for the session removed handler
This extra ref will be dropped when all client sessions have been
removed. A session is removed when a client sends teardown, closes its
endpoint of the TCP connection or the sessions expires.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-09 16:16:50 +02:00
Wim Taymans
5aec4af1b9 client: manage media in session as a last step
Once we manage a media in a session, we can't unmanage it anymore
without destroying it. Therefore, first check everything before we
manage the media, otherwise if something is wrong we have no way to
unmanage the media.
If we created a new session and something went wrong, remove the session
again. Fixes a leak in the unit test.
2014-07-08 14:46:13 +02:00
Wim Taymans
99f670d8bc rtsp: fix for MIKEY api change 2014-07-02 16:04:53 +02:00
Wim Taymans
72a57e792f client: free watch context only once
The watch context is freed when the source is destroyed. Avoids
a CRITICAL when we try to unref the context twice.
2014-07-01 16:12:13 +02:00
Wim Taymans
517bb78ae3 client: fix build 2014-07-01 15:02:15 +02:00
Wim Taymans
5e2afcefdd client: protect sessions with lock
Protect the list of sessions with the lock.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-01 14:41:14 +02:00
Wim Taymans
fe081e7301 Client: keep a ref to the session
Don't just keep a weak ref to the session objects but use a hard ref. We
will be notified when a session is removed from the pool (expired) with
the new session-removed signal.
Don't automatically close the RTSP connection when all the sessions of
a client are removed, a client can continue to operate and it can create
a new session if it wants. If you want to remove the client from the
server, you have to use gst_rtsp_server_client_filter() now.

Based on patch from Ognyan Tonchev <ognyan.tonchev at axis.com>

See https://bugzilla.gnome.org/show_bug.cgi?id=732226
2014-07-01 12:28:41 +02:00
Evan Nemerson
cecc2cb4ff introspection: add missing allow-none annotations
https://bugzilla.gnome.org/show_bug.cgi?id=730952
2014-06-26 19:08:56 +02:00
Evan Nemerson
d08b46f4b7 gi: improve annotations
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730953
2014-06-24 09:48:45 +02:00
Wim Taymans
661f4d928f signals: use generic marshal function
Use the generic C marshal function.
Use more explicit type instead of G_TYPE_POINTER
2014-06-24 09:43:44 +02:00
Wim Taymans
d676c56888 sdp: hide key length defines
They don't have a namespace.
2014-06-24 09:34:50 +02:00
Aleix Conchillo Flaqué
32432b5c61 mikey: add different key length parameters
Add encryption and authentication key length parameters to MIKEY. For
the encoders, the key lengths are obtained from the cipher and auth
algorithms set in the caps. For the decoders, they are obtained while
parsing the key management from the client.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=730472
2014-06-19 16:06:27 +02:00
Ognyan Tonchev
f2b1aa8c81 client: ref the context until rtsp watch is alive
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=731569
2014-06-18 15:23:15 +02:00
Ognyan Tonchev
9715252588 client: Destroy the rtsp watch after connection close 2014-06-18 15:21:23 +02:00
Wim Taymans
5aa06b8058 client: store TCP ports in transport
Store the TCP ports in the transport when we are doing RTSP over TCP.
This way, we can easily get to the ports from the transport.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=729776
2014-05-20 15:57:30 +02:00
Aleix Conchillo Flaqué
d01beef7c5 client: fix send-message signal marshaller
Use generic marshalling for the send-message signal. It has
two POINTER arguments, not just one.

https://bugzilla.gnome.org/show_bug.cgi?id=729900
2014-05-10 12:23:16 +01:00
Tim-Philipp Müller
efd079546a rtsp-client: handle Require headers and respond with OPTION_NOT_SUPPORTED
Servers must handle Require headers and must report a failure
if they don't handle any of the Required options, see RFC 2326,
section 12.32: https://tools.ietf.org/html/rfc2326#page-54

https://bugzilla.gnome.org/show_bug.cgi?id=729426
2014-05-09 13:55:21 +01:00
Wim Taymans
ea4543efc8 client: emit a signal before sending a message
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728970
2014-05-01 06:17:06 +02:00
Wim Taymans
4c42aec6dd client: pass context to send_message
Pass the current context to send_message, we will need it later.
2014-05-01 06:07:08 +02:00
Wim Taymans
a646e278d3 client: fix typo in comment 2014-05-01 05:29:54 +02:00
Wim Taymans
e69241ac97 client: set the watch to flushing before going to NULL
First set the watch to flushing so that we unblock any current and
future attempt to send data on the watch, Then set the pipeline to
NULL.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728153
2014-04-15 16:51:17 +02:00
Vincent Penquerc'h
adc3e8907e rtsp-client: indent cleanup
Coverity was moaning about unreachable code, and I think it was just
confused by { being before the label. We'll see if it pops up again.

Coverity 1197705
2014-04-10 16:39:11 +01:00
Göran Jönsson
11369d38ef client: Add drop-backlog property
When we have too many messages queued for a client (currently hardcoded
to 100) we overflow and drop the messages. Add a drop-backlog property
to control this behaviour. Setting this property to FALSE will retry
to send the messages to the client by waiting for more room in the
backlog.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725898
2014-04-10 16:08:06 +02:00
Ognyan Tonchev
0493a63a65 client: support for POST before GET when setting up a tunnel 2014-04-08 16:20:44 +02:00
Ognyan Tonchev
132f77751d client: remove watch of the second client after http tunnel setup
The second client will be freed after the HTTP tunnel has been set up.
Make sure it's RTSP watch is never dispatched again.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=727488
2014-04-08 16:17:30 +02:00
Wim Taymans
248db04720 rtsp: update for MIKEY API changes 2014-04-04 17:39:36 +02:00
Wim Taymans
0d22b798ae client: parse the mikey response from the client
Parse the mikey response from the client and update the policy for
each SSRC.
2014-04-03 17:42:25 +02:00
Wim Taymans
f8a6a5668d client: cleanup error paths 2014-04-03 12:57:13 +02:00
Sebastian Rasmussen
b1b5301577 gobject-introspection: Add annotations to support language bindings
In addition a few cosmetic changes:

 * Adjust the order of arguments
 * Fix typo: occured -> occurred
 * Fix indentation after Return:-clauses

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=726941
2014-03-24 00:36:42 +00:00
David Svensson Fors
faf0b31cbb rtsp-client: vmethod for modifying tunnel GET response
Add a vmethod tunnel_http_response where the response to the HTTP GET
for tunneled connections can be modified.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725879
2014-03-11 11:17:04 +01:00
Sebastian Dröge
957a4a65c6 rtsp-server: Fix lots of compiler warnings with clang 2014-02-09 10:45:28 +01:00
Wim Taymans
78c6648c96 client: let stream check supported transport
Delegate the check if a transport is allowed to the stream.

See https://bugzilla.gnome.org/show_bug.cgi?id=720696
2014-01-07 12:39:57 +01:00
Wim Taymans
4ca0b23a3f session-media: let the session-media make the RTPInfo
Add method to create the RTPInfo for a stream-transport.
Add method to create the RTPInfo for all stream-transports in a
session-media.
Use the session-media RTPInfo code in client. This allows us to refactor
another method to link the TCP callbacks.
2013-12-26 16:29:38 +01:00
Aleix Conchillo Flaqué
3fdae13fb7 media: add setup_sdp vmethod
gst/rtsp-server/rtsp-media.[ch]: added setup_sdp vmethod and public
gst_rtsp_media_setup_sdp.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720155
2013-12-19 15:10:30 +01:00
Edward Hervey
d3237dc9dc rtsp-client: Fix iteration
Wouldn't even enter the code block otherwise (i++ was used as the check
and not the postfix).
2013-12-19 14:24:54 +01:00
Wim Taymans
7a947e8dfe client: add vmethod to configure media and streams
Implement a vmethod that can be used to configure the media and the
streams based on the current context. Handle the blocksize handling in
the default handler.

See https://bugzilla.gnome.org/show_bug.cgi?id=720667
2013-12-18 15:57:03 +01:00
Wim Taymans
53859ac34b media: also handle prepare and range in suspended state
When we are suspended, we are already prepared.
We can get the range in the suspended state.
2013-11-29 10:53:08 +01:00
Wim Taymans
421499c102 client: store setup uri and use in PLAY response
Store the uri used when doing the setup and use that in the PLAY
response.

fixes https://bugzilla.gnome.org/show_bug.cgi?id=715168
2013-11-28 17:47:18 +01:00
Wim Taymans
b1e8172ef3 client: suspend after SDP and unsuspend before PLAYING
Based on patches by Ognyan Tonchev <ognyan@axis.com>

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711257
2013-11-28 16:18:40 +01:00
Sebastian Rasmussen
08160e0913 rtsp-*: Refer to NULL as a constant in comments
Plus one typo fix.

https://bugzilla.gnome.org/show_bug.cgi?id=714988
2013-11-22 09:13:14 +00:00
Tim-Philipp Müller
33c4bdfa01 rtsp-server: sprinkle some allow-none annotations for g-i 2013-11-18 10:47:04 +00:00
Wim Taymans
b0f609ce7f rtsp: allow NULL func in filters
Passing a null function make the filters return a list of
refcounted objects.
2013-11-15 16:35:05 +01:00
Patricia Muscalu
adc02db975 client: allow absolute path in requests
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711689
2013-11-12 12:21:50 +01:00
Patricia Muscalu
8ce453d97d client: make make_path_from_uri a vmethod 2013-11-12 12:08:06 +01:00
Wim Taymans
d4b8a8249c client: append query string in PAUSE/PLAY/TEARDOWN as well 2013-10-04 06:29:30 +02:00
Jonas Holmberg
1742399e23 client: Add query to control path
If the SETUP url contains a query it must be appended to the control
path so that it matches any already created stream in the media. The
query will also be appended to the session media path.
2013-10-04 06:14:32 +02:00
Jonas Holmberg
0cd24e2257 client: Reply 400 if media cannot be constructed
Reply 400 Bad Request instead of 503 Service Unavailable if media
cannot be constructed in SETUP.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708821
2013-09-26 14:32:43 +02:00
Jonas Holmberg
74b8da9396 client: Send setup reply once only
If find_media() failed in handle_setup_request() two replies was sent.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=708819
2013-09-26 14:25:36 +02:00
Jonas Holmberg
e88b71aee4 client: Do not read beyond end of path string
If the setup was done without a control url, make sure we don't try to read the
non-existing control string and crash.
2013-09-19 15:44:26 +02:00
Wim Taymans
b41422bad7 client: Fix RTPInfo header
Refactor the method to make the content_base.
Use the content-base and the control url to construct the RTPInfo
url.
2013-09-17 14:39:44 +02:00
Wim Taymans
4d6c038fc7 client: map url to path only in describe
Only map the request url to a path in the DESCRIBE method. The SDP then
contains the base and control urls that should be used to SETUP/PAUSE/
PLAY/TEARDOWN the media.
2013-09-17 12:21:02 +02:00
Wim Taymans
fe3f63de7c Revert "client: map URL to path in requests"
This reverts commit e3fded2cec.

This is not correct, we only remap the URL to a path in DESCRIBE, the SDP then
contains the base and control urls which are used in the SETUP, PLAY,
PAUSE and TEARDOWN requests.
2013-09-17 11:41:57 +02:00
Wim Taymans
e3fded2cec client: map URL to path in requests 2013-09-16 17:17:35 +02:00
Wim Taymans
952aa309dc mount-points: make vmethod to make path from uri
Make a vmethod to transform an url into a path. The path is then used to lookup
the factory. This makes it possible to also use other bits of the url, such as
the query parameters, to locate the factory.
2013-09-16 17:17:34 +02:00
Jonas Holmberg
23b3f21595 client: free threadpool
https://bugzilla.gnome.org/show_bug.cgi?id=707638
2013-09-06 20:44:10 +01:00
Patricia Muscalu
ff10d24130 rtsp-client: remove query part from content-base string
Make sure that after the control url has been resolved, it's
not a part of the query-string.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706568
2013-08-23 12:23:06 +02:00
Wim Taymans
1287b5f772 client: don't check url in response
There is no url or method in the response to check
2013-08-23 10:38:43 +02:00
Youness Alaoui
1f84618725 Add handle-response signal for when we receive a GET_PARAMETER response 2013-08-23 10:32:33 +02:00
Wim Taymans
1a838d6179 client: use protocols supported by stream 2013-08-16 16:20:00 +02:00
Wim Taymans
f124d11298 server: add method to iterate clients of server 2013-08-02 17:19:42 +02:00
Youness Alaoui
7618800088 Do not take range header if range is invalid 2013-08-02 16:58:20 +02:00
Wim Taymans
f78a65379c ClientState -> Context
Rename the clientstate to context and put the code in a separate file.
2013-07-22 14:25:04 +02:00
Wim Taymans
38d91a2bf8 client: support pushed context in handle_request
If we already have a pushed state, reuse it and add our own things. This makes
it easier to write tests.
2013-07-15 11:57:49 +02:00
Wim Taymans
9fe107a96a auth: let the auth module check client_settings
Let the auth module decide if client settings are allowed for the
current client.
2013-07-12 17:07:53 +02:00
Wim Taymans
5cf75e64af auth: handle unauthorized response
Move handling of the unauthorized response to the auth module, it can add
the appropriate headers to request authorization for the required method
much better than the client.
2013-07-12 15:19:29 +02:00
Wim Taymans
7532de687a client: allow for sending any message, not only requests
Change the _send_request() method to _send_message() so that we
can both send requests and replies.
2013-07-12 15:13:48 +02:00
Wim Taymans
a1e96c2269 client: add state push/pop 2013-07-12 12:38:54 +02:00
Wim Taymans
e1628a0515 client: add connection to state 2013-07-12 12:37:25 +02:00
Wim Taymans
0b3644a21b docs: improve docs 2013-07-11 16:57:14 +02:00
Wim Taymans
4e9c4d8bb7 client: pass thread from pool to media _prepare
Get a thread from the configured threadpool and pass it to the prepare method of
the media.
2013-07-10 17:09:27 +02:00
Wim Taymans
00997d956f client: add method to configure thread pool 2013-07-10 17:06:36 +02:00
Wim Taymans
d7dec33328 auth: simplify auth checks
Remove client from methods, it's now in the state
Perform the check specified by the string, use the information from the
thread local context.
2013-07-09 16:04:35 +02:00
Wim Taymans
c9d6455ad3 client: add state to current thread
Add the client to the ClientState object.
Place the ClientState on the current thread.
2013-07-09 16:01:29 +02:00
Wim Taymans
a63f4a2a4c auth: add auth checks
Add an enum with auth checks and implement the checks in the auth object.
Perform the checks from the client.
2013-07-08 16:29:01 +02:00
Wim Taymans
12583e819c media: add optional context for bus messages
Add an optional mainloop to _prepare that will handle the bus messages instead
of always using the shared mainloop.
2013-07-08 11:10:20 +02:00
Wim Taymans
19cffc7999 auth: remove auth from media and factory
Remove the auth object from media and factory. We want to have the RTSPClient
authenticate and authorize resources, there is no need to place another auth
manager on the media/factory.
2013-07-05 20:53:19 +02:00
Wim Taymans
a1e5bde58d client: error out on non-aggregate control
We require aggregate control (for now) for PLAY, PAUSE and TEARDOWN.
2013-07-03 16:15:04 +02:00
Wim Taymans
9182263532 client: rework setup request a little
Cache the media in DESCRIBE based on the longest matching path with the uri
that we can find in the mount points.

Rework the setup request a little to get the media from the session or from
the longest matching path, this way we can derive the control string as
everything after the path instead of hardcoding it.

Find the stream based on the control string and only open a session when all
this can be done.
2013-07-03 15:55:38 +02:00
Wim Taymans
5a833f503e session: use path matching for session media
Use a path string instead of a uri to lookup session media in the sessions. Also
use path matching to find the largest possible path that matches.
2013-07-03 12:37:48 +02:00
Wim Taymans
8f79daef5e mount-points: remove useless vmethod
Making lookups in the mount points should not be done with a URL, if there is a
mapping to be done from URL to mount points, we'll need to do it somewhere
else.
2013-07-03 11:10:27 +02:00
Wim Taymans
0248775c74 client: cleanups
Rename variables for clarity
Keep media in state when we can
2013-07-02 11:58:02 +02:00
Wim Taymans
a7fe63298c stream: add more support for IPv6
Rename _get_address to _get_multicast_address in GstRTSPStream to
make it clear that this function only deals with multicast.
Make it possible to have both an IPv4 and IPv6 multicast address on
a stream. Give the client an IPv4 or IPv6 address depending on the
address it used to connect to the server.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=702002
2013-07-01 16:46:39 +02:00
Wim Taymans
13016309b1 client: fix comment 2013-07-01 15:18:43 +02:00
Wim Taymans
ffd4b1aaf1 client: add method to filter managed sessions
Add a method to filter the sessions managed by this client connection.

See https://bugzilla.gnome.org/show_bug.cgi?id=703016
2013-06-26 17:19:11 +02:00
Wim Taymans
27a786aa4a client: remove _get_uri() method
Remove the get_uri() method on the client. A client has no uri, the uri
property is an internal property to manage the last cached media for
the client.
2013-06-26 16:32:06 +02:00
Wim Taymans
55214d0d52 client: clean some variables
Clean some variables and add some guards to _send_request()
2013-06-25 15:09:13 +02:00
Youness Alaoui
d2dab47085 Add gst_rtsp_client_send_request API
This makes it possible to send arbitrary messages to a client, such as
SET_PARAMETER or GET_PARAMETER
2013-06-25 14:58:17 +02:00
Wim Taymans
fa1d3354c0 client: also watch newly created session
When we newly created a session, start watching it immediately instead of
on the next request.
2013-06-20 12:20:21 +02:00
Wim Taymans
949f11c643 client: emit new-session when new session is created
Only emit new-session when we created a new session for a client, not when a
client picked up a previous session.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701587
2013-06-20 12:16:07 +02:00
Alexander Schrab
a5490e323b client: handle asterisk as path in requests
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=701266
2013-06-20 11:17:29 +02:00
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