Changing properties of Base classes

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing properties of Base classes

mariannasb
Hi,

I have created a Sink element which uses VideoSink as the Base class.

In my sink class I want to disable rendering the preroll frame.

I know I can do g_object_set(G_OBJECT(mysink), "show-preroll-frame", FALSE; NULL) inside my element init() function for example.
But if I then call gst-inspect it will still show show-preroll-frame default=TRUE

Is there a way for me to overwrite the default value so that it is reflected in gst-inspect?

And I would also like if possible to change it to a read-only property, because I never want to render the preroll frame in this kind of sink.

I have found something about calling g_object_class_install_property() in a derived class using the same property name as the one in the base class in order to overwrite the property.
But I don't really have access to the PROP_MAX_LATENESS enum value from my class in order to do that.
Reply | Threaded
Open this post in threaded view
|

Re: Changing properties of Base classes

Arun Raghavan-4
On Fri, 21 Oct 2016, at 03:43 PM, mariannasb wrote:

> Hi,
>
> I have created a Sink element which uses VideoSink as the Base class.
>
> In my sink class I want to disable rendering the preroll frame.
>
> I know I can do g_object_set(G_OBJECT(mysink), "show-preroll-frame",
> FALSE;
> NULL) inside my element init() function for example.
> But if I then call gst-inspect it will still show show-preroll-frame
> default=TRUE
>
> Is there a way for me to overwrite the default value so that it is
> reflected
> in gst-inspect?
>
> And I would also like if possible to change it to a read-only property,
> because I never want to render the preroll frame in this kind of sink.
>
> I have found something about calling g_object_class_install_property() in
> a
> derived class using the same property name as the one in the base class
> in
> order to overwrite the property.
> But I don't really have access to the PROP_MAX_LATENESS enum value from
> my
> class in order to do that.

Maybe this is useful to you:

  https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-class-override-property

In general, if I'm not sure if some GObject or GStreamer API is
available, I look around in Devhelp to see if there's something. The
next resort is of course this list or IRC.

Cheers,
Arun
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Changing properties of Base classes

mariannasb
Hi Arun,

Thanks,

>Maybe this is useful to you:
>
>https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-class-override-property

Yeah, I took a look at that function as well but from the information I can find that is only useful for redirecting the set/get_property() functions and not really to be able to change the default value.

Moreover I can see I mixed a bit the two of the things I wanted to do in my previous post, so just to explain again:
- I want to set the show-preroll-frame from GstVideoSink to always false (set default to false and make it readonly)
- And I also want to set max-lateness from GstBaseSink to -1 (note that it gets set to 20ms by VideoSink)

Calling g_object_set(G_OBJECT(mysink), "max-lateness", -1, NULL) inside my element init() function works exactly how I want (it also is reflected in gst-inspect)

However, for some bizarre reason, doing the same with show-preroll-frame does not work, the property does not seem to get set at all.
If I call it instead from the start() function it gets set upon going to paused, but then as expected it is not reflected in gst-inspect.
And using g_object_set() does not allow me to make it read only.

By looking at the source I could see a difference in the install_property calls from BaseSink and VideoSink.
VideoSink is using G_PARAM_CONSTRUCT for the preroll property.
Could this be the cause in their different behaviour?