[gst-devel] how to obtain pipeline-id in the gst-plugin ?
bilboed at gmail.com
Wed Jan 24 19:04:05 CET 2007
On 1/24/07, Vinayak <vinayak.pane at gmail.com> wrote:
> On 1/24/07, Edward Hervey <bilboed at gmail.com > wrote:
> > On 1/24/07, Vinayak <vinayak.pane at gmail.com> wrote:
> > > Hi Everybody,
> > > Is there any way to obtain running pipeline-id in the gst-plugin code ?
> > >
> > > Actually, my requirement is to support multiple pipelines in the single
> > > application. In my gst-plugin I'm suppose to open some display device ..
> > > which can not be directly shared with other pipelines or other threads.
> > > supporting multiple threads I have fetched PID in my gst-plugin. But
> > > if the application wants to have multiple pipeline running in single
> > > application where I receive the same PID.
> > >
> > > For this purpose I want to use pipeline-id as a unique value to
> > > differentiate among the pipelines. I could see that the pipeline is
> > > registered as element in gst-registry.
> > > Please through some pointers on this.
> > My pointer (no pun intended) would be ... to use the address of the
> > pipeline object. I can't think of a more unique id.
> > gpointer myid = pipeline;
> The variable pipeline is global variable in gstreamer ?
No, I'm talking about the pipelines that you application creates. If
you want to differentiate them, just use their address (GstPipeline *
<== That's a pointer on a GstPipeline, that pointer is unique for each
pipeline you create in your application).
> Cause I want to
> access this from gst-plugin not from the application.
You're are looking for troubles if your plugin element needs to know
what's going on outside of it's boundaries.
> Applications should
> work seemless. They are not aware about the internal plugin
> implementations. But internally in plugins I want to maintain this
> That the calls are coming from different pipelines in the
> start section (function) of my plugin.
Recursively look for your parent, until you reach a parent of type
GstPipeline. That will be the pipeline your plugin is in. Then you use
the pointer trick I mentionned above. Be aware though that:
* you will need to store that information in a class-global
structure, and you will need a lock to protect reading/writing on that
* I have some doubts as to that class-structure being unique across
several process, this might need confirmation from somebody who knows
Anyway, you can see by the above that you are running into a LOT of
issues. It would be better if you could give us a higher-level view of
what you're trying to achieve. Maybe there's a better gst/gobject way
of doing that.
> I want a way to obtain which pipeline this particular execution belongs to
> in my plugin code.
Multimedia editing developer / Fluendo S.A.
More information about the gstreamer-devel