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
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.
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.
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.
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.
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.
* 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
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
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.
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.
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.
Make GObjects from the remaining simple structures.
Remove GstRTSPSessionStream, it's not needed.
Rename GstRTSPMediaStream -> GstRTSPStream: It is shorter
Rename GstRTSPMediaTrans -> GstRTSPStreamTransport: It describes how
a GstRTSPStream should be transported to a client.
Rename GstRTSPMediaFactory::get_element -> create_element because that
more accurately describes what it does.
Make nice methods instead of poking in the structures.
Move some methods inside the relevant object source code.
Use GPtrArray to store objects instead of plain arrays, it is more
natural and allows us to more easily clean up.
Move the allocation of udp ports to the Stream object. The Stream object
contains the elements needed to stream the media to a client.
Improve the prepare and unprepare methods. Unprepare should now undo
everything prepare did. Improve also async unprepare when doing EOS on
shutdown. Make sure we always unprepare correctly.
This patch makes it possible for the client to send transport settings for
multicast (destination && ttl). Client settings must be explicitly allowed or
the server will use its own settings.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685561
Don't destroy the client watch while dispatching. The rtsp watch is
automatically destroyed after the rtsp watch function closed() has
been called.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=685220
In client_unlink_session: now don't iterate in session->medias
list where items are removed by gst_rtsp_session_release_media.
Instead, repeatedly remove the first item.
The problem occurs when the client abruptly closes the connection without
issuing a TEARDOWN. The TEARDOWN handler in the rtsp-client.c file of the RTSP
server is where the pipeline gets torn down. Since this handler is not called,
the pipeline remains and is up and running. Subsequent clients get their own
pipelines and if the do not issue TEARDOWNs then those pipelines will also
remain up and running. This is a resource leak.
Allow for adding a GstRTSPAuth on the factory and media level and check
permissions when accessing the factory.
Add hints to the auth methods for future more fine grained authorisation.
Add example application for per factory authentication.
Pass the collected information for the ongoing request in a GstRTSPClientState
structure that we can then pass around to simplify the method arguments. This
will also be handy when we implement logging functionality.
Make sure the session does not timeout when using TCP. We need to do this
because quicktime player does not send RTCP for some reason in tunneled
mode.
Refactor some cleanup code.
Fixes#612915
Handle lost_tunnel callbacks and use it to store the tunnelid back into the
hashtable so that we can reuse it for when the client reopens the POST
socket.
Close the connection after a TEARDOWN.
Make sure or watchid is cleared when the watch is removed.
Fixes#612915