GNOME Bugzilla – Bug 739112
rtsp-client: Can not allocate ports for interleaved traffic in setup
Last modified: 2014-11-07 11:52:44 UTC
If "RTP/AVP/TCP" (without the interleaved flag given) is chosen as transport in RTSP SETUP the request will fail, because the default implementation for configure_client_transport() uses the session media to allocate ports. Since 5aec4af1b96ef5bddfc02a015e9cec3488c89f4a "client: manage media in session as a last step" the session media is no longer available when the client transport is configured.
This could be solved by moving configuration of client transport after we have managed the session media, but if the configuration is unsupported, we end up with an unprepared media (the one that is cached in rtsp-client). The media becomes unprepared when we remove the session (the setup, in which we created the session, failed), since the media was managed by this session in this case. One way to come around this is the stop caching the media (in rtsp-client) when a session starts to manage the media. I'm not sure if this is the correct approach to solve this issue.
Created attachment 289529 [details] [review] Stop cache media in rtsp-client when a session manages a media
Created attachment 289530 [details] [review] Configure client transport when we have the session media
Created attachment 289531 [details] [review] Unit test with tcp transport
Created attachment 289532 [details] [review] setup two sessions on one connection
Created attachment 289533 [details] [review] cleanup
Those patches where based on 1.4.3. There are a problem running the unit tests on master. I'll look in to it right away.
Created attachment 289594 [details] [review] Stop cache media in rtsp-client when a session manages a media Unprepare the media after setting it to state null.
Works on master with a modification in the first patch
commit 1a004c5d4650f79638112a1bf3203d54a2454b4d Author: Linus Svensson <linussn@axis.com> Date: Thu Oct 23 13:39:10 2014 +0200 tests: Remove FIXME The session leak is now fixed, lets remove those FIXME comments. commit d1ea01d4c6f5621c47ba3b4acc6b4e269b47b016 Author: Linus Svensson <linussn@axis.com> Date: Thu Oct 23 17:54:37 2014 +0200 tests: Test to setup two sessions on one connection https://bugzilla.gnome.org/show_bug.cgi?id=739112 commit df5850f9661a840b270feeb40c88bed244eb4225 Author: Linus Svensson <linussn@axis.com> Date: Fri Oct 24 12:05:27 2014 +0200 tests: Test setup with tcp transport https://bugzilla.gnome.org/show_bug.cgi?id=739112 commit 088eee65900cd53135be0ee7b41068f5b919ecbd Author: Linus Svensson <linussn@axis.com> Date: Fri Oct 24 12:04:54 2014 +0200 client: Configure transport after creating session media The default implementation of configure_client_transport() in rtsp-client uses the session media when it chooses channels for interleaved traffic. https://bugzilla.gnome.org/show_bug.cgi?id=739112 commit a455181aff9231c4a00777f456a80d6de1019f05 Author: Linus Svensson <linussn@axis.com> Date: Thu Oct 23 12:54:03 2014 +0200 client: Stop caching media in client when doing setup If the media has been managed by a session media, it should not be cached in the client any longer. The GstRTSPSessionMedia object is now responsible for unpreparing the GstRTSPMedia object using gst_rtsp_media_unprepare(). Unprepare the media when finalizing the session media. https://bugzilla.gnome.org/show_bug.cgi?id=739112