How to use GstVideoAffineTransformationMeta in gstglimagesink
Grégoire Gentil
gregoire at gentil.com
Tue May 17 17:10:38 UTC 2016
On 05/17/2016 10:02 AM, Matthew Waters wrote:
> On 16/05/16 01:57, 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);
>>
>> //To be modified
>> const gfloat matrix[16] = {
>> 0.1f, 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);
>>
>>
>> But when the code reaches gst_glimage_sink_on_draw, af_meta =
>> gst_buffer_get_video_affine_transformation_meta
>> (gl_sink->stored_buffer[0]); is NULL.
>>
>> Any idea how I could use GstVideoAffineTransformationMeta to have my
>> own transform matrix?
>
> Most likely, you're using a pipeline that does not have an upstream
> element that will add the GstVideoAffineTransformation so that's to be
> expected.
>
> With the latest master of gst-plugins-bad, you can use gltransformation
> which will build the GstVideoAffineTransformation for you and
> glimagesink/glvideomixer will use that instead of gltransformation
> performing a render pass.
Thanks for the clarification. This is interesting and I recall having
read gltransformation code but it doesn't do what I want, aka. having a
specific transformation matrix. My ultimate goal is to crop the video.
Can I do it with the existing property of gltransformation?
Grégoire
More information about the gstreamer-devel
mailing list