How to use GstVideoAffineTransformationMeta in gstglimagesink

Grégoire Gentil gregoire at gentil.com
Tue May 17 16:12:06 UTC 2016



On 05/17/2016 12:26 AM, Sebastian Dröge wrote:
> On So, 2016-05-15 at 16:57 -0700, Grégoire Gentil wrote:
>> Hello,
>>
>> I'm interested to use GstVideoAffineTransformationMeta in
>> gstglimagesink, especially in gst_glimage_sink_on_draw:
>>
>> https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/gl/gstglimagesink.c#n2028
>>
>> I have a pad probe installed in my pipeline in which I do:
>>
>> static GstPadProbeReturn cb_have_data(GstPad *pad, GstPadProbeInfo
>> *info, CustomData *data) {
>>
>> GstBuffer *buffer = gst_pad_probe_info_get_buffer (info);
>>
>> GstVideoAffineTransformationMeta *meta =
>> gst_buffer_add_video_affine_transformation_meta (buffer);
>
> Do you get warnings about the buffer not being writable? You should do
> something like
>
>    info->data = gst_mini_object_make_writable (info->data);
>
> and then get the buffer.
>
> Apart from that what you're doing there should work.
Thanks for helping. No, I don't get any warning. My pipeline (on 
Android) is:

filesrc location=%s ! qtdemux ! queue ! decodebin ! queue ! identity ! 
glimagesink

and my probe is on the sink pad of the identity element. Even with the 
added line, I still don't get any meta inside glimagesink. I have also 
tried on the sink pad of glimagesink without any success. The callback 
looks like this:

static GstPadProbeReturn cb(GstPad *pad, GstPadProbeInfo *info, 
CustomData *data) {
info->data = gst_mini_object_make_writable(info->data);
GstBuffer *buffer = gst_pad_probe_info_get_buffer(info);
GstVideoAffineTransformationMeta *meta = 
gst_buffer_add_video_affine_transformation_meta(buffer);
const gfloat matrix[16] = {
	0.5f, 0.0f, 0.0f, 0.0f,
	0.0f, 1.0f, 0.0f, 0.0f,
	0.0f, 0.0f, 1.0f, 0.0f,
	0.0f, 0.0f, 0.0f, 1.0f,
};
gst_video_affine_transformation_meta_apply_matrix(meta, matrix);
return GST_PAD_PROBE_OK;
}

Grégoire


More information about the gstreamer-devel mailing list