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 779484 - rtsp: Allow pipelines to be shared between media
rtsp: Allow pipelines to be shared between media
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.11.1
Other Mac OS
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-03-02 17:35 UTC by Nick Kallen
Modified: 2018-11-03 15:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Allow override of preroll (4.90 KB, patch)
2017-03-02 17:42 UTC, Nick Kallen
none Details | Review
Add setting to indicate pipeline is shared; Media do not manipulate state of shared-pipelines (16.62 KB, patch)
2017-03-04 09:18 UTC, Nick Kallen
none Details | Review

Description Nick Kallen 2017-03-02 17:35:34 UTC
In order to build videocompositor/mosaic RTSP server, I subclassed RTSPMediaFactory to create my own elements directly. Each RTSPMedia created by the factory is in the same pipeline (so they can mux together). But RTSPMedia does not allow you to share pipelines between Media elements, because as part of the preparation process it prerolls the pipeline: it sets the pipeline state to pause and then it listens for confirmation that it transitioned from ready -> pause before activating everything. But if you are sharing a pipeline between RTSPMedia it will already be in state playing most of the time, and new medias that share the pipeline will not get prepared correctly.

My solution is to make the preroll method overridable.

I wanted some feedback on this before I continue...
Comment 1 Nick Kallen 2017-03-02 17:42:34 UTC
Created attachment 347086 [details] [review]
Allow override of preroll
Comment 2 Nick Kallen 2017-03-04 09:18:45 UTC
Created attachment 347193 [details] [review]
Add setting to indicate pipeline is shared; Media do not manipulate state of shared-pipelines

I like this approach better although the change is more drastic.

There is a new setting, 'shared-pipeline', that tells the media not to manipulate the pipeline's state nor rely on the pipeline's state changes (e.g., in handle_message) for its own internal state. This allows different media to share a live pipeline.

In order for this to work correctly, the media needs to manipulate the state of its rtpbin and the various elements added by the stream, which would otherwise have inherited the state changes from the pipeline. To keep the code simple, these elements are added to the bin the user provides (i.e., the media's element) rather than adding them to the pipeline. Then simply changing the bin's state keeps everything in sync.

I also fixed what I think was a bug in `gst_rtsp_media_unprepare`, where the media would never be unprepared if it was in the suspend state, but going into the suspend state is a normal part of disposing of the media.
Comment 3 GStreamer system administrator 2018-11-03 15:41:14 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/issues/33.