Run OpenGl plugin

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

Run OpenGl plugin

Potoman
This post was updated on .
Hey !

I try to build my own plugin based on glvideomixer plugin.

I try to compile the gstglvideomix with the modification of the plugin name.

I change glvideomixer to gltestvideomixer.

I successfully compile it under windows/msvc but I had to add in my project the c file :
- gstglbasemixer.c
- gstglmixer.c
- gstglmixerbin.c
If I don't put this file, the compilation fail cause msvc doesn't found the symbol of this c file.

I'm asking you if it's a good manner ?

Cause I have this problem, when I run my plugin with a basic command line :

 gst-launch-1.0  gltestvideomixer name=m ! glimagesink \ videotestsrc ! video/x-raw, format=YUY2 ! m. \ videotestsrc pattern=12 ! video/x-raw, format=I420, framerate=5/1, width=100, height=200 ! queue ! m. \ videotestsrc ! video/x-raw, format=RGB, framerate=15/1, width=1500, height=1500 ! queue ! m. \ videotestsrc ! queue ! m.  \ videotestsrc ! glfiltercube ! queue ! m. \ videotestsrc ! queue ! m.

I have this error :

(gst-inspect-1.0:3640): GLib-GObject-WARNING **: cannot register existing type 'GstGLBaseMixer'

(gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(gst-inspect-1.0:3640): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(gst-inspect-1.0:3640): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed

(gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed

(gst-inspect-1.0:3640): GStreamer-CRITICAL **: gst_element_register: assertion 'g_type_is_a (type, GST_TYPE_ELEMENT)' failed



It's look like there are a conflict between glvideomixer and my plugin. I think I declare both GstGLBaseMixer cause I compile it in my project.

Is it because the dll libgstopengl.dll already contain the symbol of gstglbasemixer.c, gstglmixer.c and gstglmixerbin.c file ?

How  can I fix this conflict ?

Thanks !
Reply | Threaded
Open this post in threaded view
|

Re: Run OpenGl plugin

Matthew Waters
On 06/07/16 19:01, Potoman wrote:

> Hey !
>
> I try to build my own plugin based on glvideomixer plugin.
>
> I try to compile the gstglvideomix with the modification of the plugin name.
>
> I change glvideomixer to gltestvideomixer.
>
> I successfully compile it under windows/msvc but I had to add in my project
> the c file :
> - gstglbasemixer.c
> - gstglmixer.c
> - gstglmixerbin.c
> If I don't put this symbol, the compilation fail cause msvc doesn't found
> the symbol of this c file.
>
> I'm asking you if it's a good manner ?
>
> Cause I have this problem, when I run my plugin with a basic command line :
>
>  gst-launch-1.0  gltestvideomixer name=m ! glimagesink \ videotestsrc !
> video/x-raw, format=YUY2 ! m. \ videotestsrc pattern=12 ! video/x-raw,
> format=I420, framerate=5/1, width=100, height=200 ! queue ! m. \
> videotestsrc ! video/x-raw, format=RGB, framerate=15/1, width=1500,
> height=1500 ! queue ! m. \ videotestsrc ! queue ! m.  \ videotestsrc !
> glfiltercube ! queue ! m. \ videotestsrc ! queue ! m.
>
> I have this error :
>
> (gst-inspect-1.0:3640): GLib-GObject-WARNING **: cannot register existing
> type 'GstGLBaseMixer'
>
> (gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion
> 'result != 0' failed
>
> (gst-inspect-1.0:3640): GLib-GObject-CRITICAL **: g_type_register_static:
> assertion 'parent_type > 0' failed
>
> (gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion
> 'result != 0' failed
>
> (gst-inspect-1.0:3640): GLib-GObject-CRITICAL **: g_type_register_static:
> assertion 'parent_type > 0' failed
>
> (gst-inspect-1.0:3640): GLib-CRITICAL **: g_once_init_leave: assertion
> 'result != 0' failed
>
> (gst-inspect-1.0:3640): GStreamer-CRITICAL **: gst_element_register:
> assertion 'g_type_is_a (type, GST_TYPE_ELEMENT)' failed
>
>
>
> It's look like there are a conflict between glvideomixer and my plugin. I
> think I declare both GstGLBaseMixer cause I compile it in my project.
>
> Is it because the dll libgstopengl.dll already contain the symbol of
> gstglbasemixer.c, gstglmixer.c and gstglmixerbin.c file ?
>
> How  can I fix this conflict ?
This is most likely your problem.  If you don't change the name of these
classes, you will get these criticals trying to register types with the
same name.

You'll either need to change the names of your local copies of these
classes or patch your element into the existing opengl plugin.

Cheers
-Matt


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

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Run OpenGl plugin

Potoman
Yes yes, I have change all name :

GstGlVideoMixer, by GstGlTestVideoMixer.

And all of the define.

Like :

#define GST_TYPE_GL_TEST_VIDEO_MIXER            (gst_gl_TestVideoMixer_get_type())
#define GST_GL_TEST_VIDEO_MIXER(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixer))
#define GST_IS_GL_TEST_VIDEO_MIXER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_TEST_VIDEO_MIXER))
#define GST_GL_TEST_VIDEO_MIXER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass) ,GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixerClass))
#define GST_IS_GL_TEST_VIDEO_MIXER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_TEST_VIDEO_MIXER))
#define GST_GL_TEST_VIDEO_MIXER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj) ,GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixerClass))

The thing you're going to say is,

In addition to modify the name into gstglvideomixer.c (which become gstgltestvideomiver.c),

I have to modify gstglbasemixer.c to gstgltestbasemixer.c and change everithing into ?

I have to do the same for the other two file ?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Re: Run OpenGl plugin

Matthew Waters
On 06/07/16 22:00, Potoman wrote:

> Yes yes, I have change all name :
>
> GstGlVideoMixer, by GstGlTestVideoMixer.
>
> And all of the define.
>
> Like :
>
> #define GST_TYPE_GL_TEST_VIDEO_MIXER          
> (gst_gl_TestVideoMixer_get_type())
> #define GST_GL_TEST_VIDEO_MIXER(obj)          
> (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixer))
> #define GST_IS_GL_TEST_VIDEO_MIXER(obj)        
> (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_TEST_VIDEO_MIXER))
> #define GST_GL_TEST_VIDEO_MIXER_CLASS(klass)  
> (G_TYPE_CHECK_CLASS_CAST((klass)
> ,GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixerClass))
> #define GST_IS_GL_TEST_VIDEO_MIXER_CLASS(klass)
> (G_TYPE_CHECK_CLASS_TYPE((klass) ,GST_TYPE_GL_TEST_VIDEO_MIXER))
> #define GST_GL_TEST_VIDEO_MIXER_GET_CLASS(obj)
> (G_TYPE_INSTANCE_GET_CLASS((obj)
> ,GST_TYPE_GL_TEST_VIDEO_MIXER,GstGLTestVideoMixerClass))
>
> The thing you're going to say is,
>
> In addition to modify the name into gstglvideomixer.c (which become
> gstgltestvideomiver.c),
>
> I have to modify gstglbasemixer.c to gstgltestbasemixer.c and change
> everithing into ?
>
> I have to do the same for the other two file ?
Yes, that's the only way if you want to keep your plugin separate.

Ideally those classes should be moved into the libgstgl library however
that's waiting on GstAggregator/GstVideoAggregator moving to -base.

Cheers
-Matt

> Thanks.


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

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Re: Run OpenGl plugin

Potoman
Ok thanks ! That's work perfectly :)