Overlay peak value on video

Tim Müller tim at centricular.com
Mon Mar 9 03:28:52 PDT 2015


On Mon, 2015-03-09 at 10:11 +0000, Paul Barber wrote:

Hi Paul,

> Thanks for the suggestion. You said that:
>  > In the simplest case the element just knows about the bin and the 
> textoverlay and can just set the property directly.
> 
> That sounds good to me, but I do not understand why the bin is needed.
> Is there a good way for the element to know about another element?
> Can it have a property that can be the name, or handle, or pointer to 
> the other element?
> The only way I can see is to pass the GObject pointer, so that the new 
> element can use gst_util_set_object_arg() or g_object_set().

So, it all depends what you're trying to achieve. If you're trying to
come up with something that you want merged into one of GStreamer's
plugin modules you'd have to do things differently than if you are just
trying to do something for your particular application.

The bin is not really needed of course.

Sure, you can add a property that's of G_TYPE_POINTER (no memory
management or type checking), or G_TYPE_OBJECT or whatever to pass info
to your element. Or you just make a new function like this:

GstElement *
paul_video_measure_thingy_new (PaulApplication * app)
{
  GstElement *e = g_object_new (PAUL_TYPE_VIDEO_MEASURE_THINGY, NULL);

  e->priv->app = app;

  return e;
}

then you don't need a property ;)

If it's all just in your app, you have a lot more flexibility.

Cheers
 -Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list