Hi, I’m trying to implement a plugin using an external transport library.
I am trying to develop a system where multiple plugins in the same pipeline can “access” the same library handle and would love to have them “check” a global value in GStreamer if the handle “exists” instead of initializing the library multiple times due to the huge performance drop in that scenario.
Is there a way for pipelines to “register” a global value? Is there a way for other pipelines to check if such a value exists during class initialization?
And is there any mutex mechanism where I can just tell other pipelines to wait in the _start until the main handle value wakes them up?
Huge thanks to anyone able to help me with this.
I feel like my post is all over the place
Creating a Global Value in a GStreamer Pipeline
Question:
Hi, I’m developing a GStreamer plugin using an external transport library. I want multiple plugins in the same pipeline to share a single library handle to avoid performance issues from initializing the library multiple times.
Goals:
- Register a Global Value: Have a global value that plugins can check to see if the library handle already exists.
- Mutex Protection: Use a mutex to protect this global value and ensure thread safety.
- Synchronization: Make other plugins wait until the main handle is available.
Example Scenario:
- Multiple plugins need to access the same library handle.
- If the handle exists, use it.
- If not, initialize it and make it available to others.
Questions:
- How can I register a global value in a GStreamer pipeline?
- How can other plugins check if this value exists during class initialization?
- Is there a mutex mechanism to synchronize access to this global value?
Thanks for any help!