After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739112 - rtsp-client: Can not allocate ports for interleaved traffic in setup
rtsp-client: Can not allocate ports for interleaved traffic in setup
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.4.3
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-24 09:36 UTC by Linus Svensson
Modified: 2014-11-07 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Stop cache media in rtsp-client when a session manages a media (1.76 KB, patch)
2014-10-28 16:01 UTC, Linus Svensson
none Details | Review
Configure client transport when we have the session media (1.52 KB, patch)
2014-10-28 16:02 UTC, Linus Svensson
committed Details | Review
Unit test with tcp transport (6.83 KB, patch)
2014-10-28 16:03 UTC, Linus Svensson
committed Details | Review
setup two sessions on one connection (3.59 KB, patch)
2014-10-28 16:03 UTC, Linus Svensson
committed Details | Review
cleanup (1.54 KB, patch)
2014-10-28 16:04 UTC, Linus Svensson
committed Details | Review
Stop cache media in rtsp-client when a session manages a media (1.74 KB, patch)
2014-10-29 14:49 UTC, Linus Svensson
committed Details | Review

Description Linus Svensson 2014-10-24 09:36:35 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.
Comment 1 Linus Svensson 2014-10-24 10:44:15 UTC
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.
Comment 2 Linus Svensson 2014-10-28 16:01:11 UTC
Created attachment 289529 [details] [review]
Stop cache media in rtsp-client when a session manages a media
Comment 3 Linus Svensson 2014-10-28 16:02:27 UTC
Created attachment 289530 [details] [review]
Configure client transport when we have the session media
Comment 4 Linus Svensson 2014-10-28 16:03:06 UTC
Created attachment 289531 [details] [review]
Unit test with tcp transport
Comment 5 Linus Svensson 2014-10-28 16:03:39 UTC
Created attachment 289532 [details] [review]
setup two sessions on one connection
Comment 6 Linus Svensson 2014-10-28 16:04:00 UTC
Created attachment 289533 [details] [review]
cleanup
Comment 7 Linus Svensson 2014-10-29 10:59:58 UTC
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.
Comment 8 Linus Svensson 2014-10-29 14:49:46 UTC
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.
Comment 9 Linus Svensson 2014-10-29 14:51:14 UTC
Works on master with a modification in the first patch
Comment 10 Wim Taymans 2014-11-07 11:51:20 UTC
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