subclass gstbin to overwrite handle_message

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

subclass gstbin to overwrite handle_message

Eloi Bail
Hi guys,

I am trying to subclass Gstbin to overwrite handle_message virtual method.

I tried to make it simple. I defined MyBin which is a subclass of GstBin and overwrites handle_message. (see mybin.h in attachment).

I used basic-tutorial-2.c where I added the redefinition of handle_message method, and just put a g_print to see if my redefined method is called (see basic-tutorial-2.c)

I never see my redefined method called and would like to have help to resolve this issue.

Notice that I am using glib 2.54.2 which uses G_DECLARE_DERIVABLE_TYPE.

Thanks,

Eloi


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

mybin.h (410 bytes) Download Attachment
basic-tutorial-2.c (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: subclass gstbin to overwrite handle_message

Thibault Saunier-4
Hello,

First looks like you are not instanciate a `my_bin` but a regular bin
(`my_bin = gst_bin_new ("my_bin");`).
Then you will need to set `MyBinClass->handle_message` in the class
init function.

Regards,

Thibault

On Wed, Nov 29, 2017 at 4:58 PM, Eloi Bail <[hidden email]> wrote:

> Hi guys,
>
> I am trying to subclass Gstbin to overwrite handle_message virtual method.
>
> I tried to make it simple. I defined MyBin which is a subclass of GstBin and
> overwrites handle_message. (see mybin.h in attachment).
>
> I used basic-tutorial-2.c where I added the redefinition of handle_message
> method, and just put a g_print to see if my redefined method is called (see
> basic-tutorial-2.c)
>
> I never see my redefined method called and would like to have help to
> resolve this issue.
>
> Notice that I am using glib 2.54.2 which uses G_DECLARE_DERIVABLE_TYPE.
>
> Thanks,
>
> Eloi
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: subclass gstbin to overwrite handle_message

Eloi Bail


First looks like you are not instanciate a `my_bin` but a regular bin
(`my_bin = gst_bin_new ("my_bin");`).
Then you will need to set `MyBinClass->handle_message` in the class
init function.


Hi Thibault,

Yes you are right. I then called directly the factory: 
my_bin = gst_element_factory_make ("my_bin", "testbin");

But it is failing no element :my_bin.
What am I missing here ? Shall I create a factory for "my_bin" ?

Thanks

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

Re: subclass gstbin to overwrite handle_message

Thibault Saunier-4
Hi,

You should either register the bin or just create as any other GObject.

Thibault.

On Thu, Nov 30, 2017 at 6:16 AM, Eloi Bail <[hidden email]> wrote:

>
>>
>> First looks like you are not instanciate a `my_bin` but a regular bin
>> (`my_bin = gst_bin_new ("my_bin");`).
>> Then you will need to set `MyBinClass->handle_message` in the class
>> init function.
>>
>
> Hi Thibault,
>
> Yes you are right. I then called directly the factory:
>>
>> my_bin = gst_element_factory_make ("my_bin", "testbin");
>
>
> But it is failing no element :my_bin.
> What am I missing here ? Shall I create a factory for "my_bin" ?
>
> Thanks
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: subclass gstbin to overwrite handle_message

Eloi Bail


You should either register the bin or just create as any other GObject.

I tried to register the bin. I follow the similar way than rtsp-media-factory-uri, subclass of rtsp-media-factory.

See in attachment. It is still not working and I honnestly do not know how to troubleshoot that.
Any help would be appreciated.

Thanks,

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

mybin.h (2K) Download Attachment
basic-tutorial-2.c (3K) Download Attachment