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 728029 - rtsp-media: Make media_prepare() virtual
rtsp-media: Make media_prepare() virtual
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
git master
Other Linux
: Normal normal
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-04-11 10:41 UTC by Ognyan Tonchev (redstar_)
Modified: 2014-04-21 10:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
media: Make media_prepare() virtual (9.07 KB, patch)
2014-04-11 10:44 UTC, Ognyan Tonchev (redstar_)
committed Details | Review
media: Do not stop thread twice if default_prepare() fails (1.11 KB, patch)
2014-04-14 13:58 UTC, Ognyan Tonchev (redstar_)
committed Details | Review

Description Ognyan Tonchev (redstar_) 2014-04-11 10:41:00 UTC
What do you think about making media_prepare() virtual, as is already the case with media_unprepare()?

And the use case i am trying to solve - I need a mechanism for limiting the number of clients that can do media_prepare(). If that limit is reached STS_SERVICE_UNAVAILABLE should be returned to new client requests.
Comment 1 Ognyan Tonchev (redstar_) 2014-04-11 10:44:42 UTC
Created attachment 274074 [details] [review]
media: Make media_prepare() virtual

With this patch default_prepare() does exactly the reverse of what default_unprepare() does.

The patch can probably be split in 3 different patches since it also fixes some issues with the current implementation:

* Allow the #thread argument in media_prepare() to be NULL as stated in the documentation.
* Stop the thread in the error cases when it is not going to be used.
Comment 2 Wim Taymans 2014-04-12 04:04:44 UTC
commit 80474e9e5e0f17c44d553192a2281d17c4ff2015
Author: Ognyan Tonchev <ognyan@axis.com>
Date:   Wed Apr 9 16:44:21 2014 +0200

    media: make media_prepare virtual
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=728029

commit da19a3c21a5e063e0175a16d572382f88cf4714d
Author: Ognyan Tonchev <ognyan@axis.com>
Date:   Sat Apr 12 05:57:00 2014 +0200

    media: stop the thread in more error cases

commit de2a70bb10b1e0111b3cbfa5c45c374061223965
Author: Ognyan Tonchev <ognyan@axis.com>
Date:   Sat Apr 12 05:53:15 2014 +0200

    media: allow NULL as the thread
    
    Use the default context whan passing a NULL thread.
Comment 3 Ognyan Tonchev (redstar_) 2014-04-14 13:58:23 UTC
Created attachment 274273 [details] [review]
media: Do not stop thread twice if default_prepare() fails

With the latest version of the patch the thread is stopped one too many times if default_prepare fails(). So either this patch or removing the thread_stop() call from the 'prepare_failed' error case in gst_media_prepare ().
Comment 4 Wim Taymans 2014-04-21 10:22:20 UTC
ommit 7cce8e2dde79453eb4b0e30ff5b1157d75d57f62
Author: Ognyan Tonchev <ognyan@axis.com>
Date:   Mon Apr 14 15:17:14 2014 +0200

    media: Do not stop thread twice if default_prepare() fails