How to use GstVideoAffineTransformationMeta in gstglimagesink

Matthew Waters ystreet00 at gmail.com
Tue May 17 17:02:39 UTC 2016


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.

Cheers
-Matt

> Thanks in advance,
>
> Grégoire
>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160517/25955cbf/attachment.sig>


More information about the gstreamer-devel mailing list