After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 559131 - Have client-draw-callback accept a gpointer of user data
Have client-draw-callback accept a gpointer of user data
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-gl
git master
Other All
: Normal enhancement
: 0.10.2
Assigned To: Julien Isorce
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-03 16:02 UTC by Tristan Matthews
Modified: 2010-02-09 11:20 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Tristan Matthews 2008-11-03 16:02:19 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.
Comment 1 Julien Isorce 2009-07-28 11:47:19 UTC
Are you making a patch ?
Comment 2 Tristan Matthews 2009-07-28 12:56:48 UTC
not at this time.
Comment 3 Julien Isorce 2009-08-04 20:31:19 UTC
"... data structures ..."

Ok so this data would be set using a property (client-data) ? (as a client-draw-callback is set)
Comment 4 Tristan Matthews 2009-08-04 21:23:19 UTC
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)
Comment 5 Julien Isorce 2009-08-05 20:45:08 UTC
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.
Comment 6 Tristan Matthews 2009-08-05 20:47:18 UTC
so that would give:
g_object_set(G_OBJECT(glimagesink), "client-draw-callback", drawCallback,
"client-data", userData, NULL);
?
Comment 7 Julien Isorce 2009-08-05 21:03:45 UTC
According to "Accessing multiple properties at once" from http://library.gnome.org/devel/gobject/unstable/gobject-properties.html you can do that.
Comment 8 Filippo Argiolas 2009-08-06 08:58:44 UTC
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.
Comment 9 Julien Isorce 2009-08-06 09:29:52 UTC
Ok and we agree we need one more property ("client-data"), so I can do the changes next week.
Comment 10 Tristan Matthews 2009-11-16 16:49:39 UTC
has the client-data property been implemented?
Comment 11 Julien Isorce 2009-11-16 18:04:33 UTC
Not yet, it's in my TODO list
Comment 12 Julien Isorce 2009-11-21 12:27:41 UTC
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