GNOME Bugzilla – Bug 559131
Have client-draw-callback accept a gpointer of user data
Last modified: 2010-02-09 11:20:39 UTC
It would be helpful if the client draw callback passed to glimagesink could accept a gpointer of user data. This way data structures could be passed in from outside the callback and used in the drawing operations. This would require changes to gst-plugins-gl/gst-libs/gst/gl/gstgldispay.{c,h} and it's dependencies.
Are you making a patch ?
not at this time.
"... data structures ..." Ok so this data would be set using a property (client-data) ? (as a client-draw-callback is set)
Would it be possible to have something like: g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback, userData, NULL); Where drawCallback is something like: gboolean drawCallback (GLuint texture, GLuint width, GLuint height, gpointer data)
From gstglfilterapp.c, the callback pointer is retrieved in this way: static void gst_gl_filter_app_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { ... filter->clientDrawCallback = g_value_get_pointer (value); ... So I think we cannot avoid two distinct properties. But if you have a solution, let me know.
so that would give: g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback, "client-data", userData, NULL); ?
According to "Accessing multiple properties at once" from http://library.gnome.org/devel/gobject/unstable/gobject-properties.html you can do that.
Julien, I think there is some inconsistency in the way clientDrawCallback is used amongst different elements. glfilterapp has a client-draw-callback property that just adds a rendering step using the framebuffer object. glimagesink uses some custom code in gldisplay to replace the usual drawing routine (the one that just maps a rectangular texture to the whole scene). The first uses gst_gl_display_use_fbo, the second gst_gl_display_set_client_draw_callback. I believe Tristan is referring to the second one (but filterapp would probably benefit too from a data property. Anyway I don't think this can be done without an extra "client-data" property.
Ok and we agree we need one more property ("client-data"), so I can do the changes next week.
has the client-data property been implemented?
Not yet, it's in my TODO list
commit 26e11aea1dda5e4735c30b26d30cea2ad525767b Author: Julien Isorce <julien.isorce@gmail.com> Date: Sat Nov 21 13:21:54 2009 +0100 glimagesink: add a client-data property Also add it to glfilterapp. Fixes #559131