GNOME Bugzilla – Bug 761747
Client-draw problem in glimagesink (Android)
Last modified: 2016-02-10 07:52:09 UTC
First, documentation in the source code is not correct here: https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/gstglimagesink.c#n538 The arguments are context and sample. Secondly, it seems that GstVideoAffineTransformationMeta is always NULL. In an Android 6.0.1 Gstreamer-master-git tutorial-5-derived application, I have: g_signal_connect(G_OBJECT(data->glimagesink), "client-draw", G_CALLBACK(client_draw_cb), data); static gboolean client_draw_cb(GstElement *sink, GLuint texture, GstSample *sample, CustomData *data) { GstBuffer *buf = gst_sample_get_buffer(sample); GstVideoAffineTransformationMeta *atm = gst_buffer_get_video_affine_transformation_meta(buf); //atm is NULL all the time atm = gst_buffer_add_video_affine_transformation_meta(buf); //atm is NULL again GstVideoAffineTransformationMeta is null and it can't be created. To give the big picture, my objective is to crop the video. I tried glOrthof but as I return FALSE because I don't want to deal with the texture, it's discarded by the original code. Fair enough. So I wanted to use a GstVideoAffineTransformationMeta. I can't access or create any GstVideoAffineTransformationMeta in this callback.
It seems that the buffer is not writable (gst_buffer_is_writable(element) == 0). I guess that it's by design. Still the documentation about the client-redraw callback is not proper.
GstVideoAffineTransformationMeta should be added in the probe of glimagesink, not in the client-draw. That was my problem. Sorry for the noise.