GNOME Bugzilla – Bug 728029
rtsp-media: Make media_prepare() virtual
Last modified: 2014-04-21 10:22:38 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.
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.
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.
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 ().
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