v4l2sink: Use GstVideoCropMeta to set overlay window if available
Submitted by Aurélien Zanelli
Link to original bug (#725835)
Description
Created attachment 271119
v4l2sink: Use GstVideoCropMeta to set overlay window if available
An upstream element could provide buffers with GstVideoCropMeta to v4l2sink.
The main idea of the attached patch is to update the V4L2 overlay window according to incoming GstVideoCropMeta (if available) when rendering frames.
However, current implementation of this will override any overlay rectangle set by set_property() method. Maybe it should be property first then GstVideoCropMeta.
More background:
Our H264 decoder output non-cropped frames with a definition multiple of 16, which is the h264 macroblock size.
When input video definition is not a multiple of 16, encoding/decoding process add padding and provide crop information.
Since our gst pipeline is decoder --> v4l2sink, we want to let the cropping job to the v4l2 device. So decoder send cropping info through GstVideoCropMeta and v4l2sink set overlay window accordingly.
Current patch apply on master and 1.2.3, however i only tested it on 1.2.3
Patch 271119, "v4l2sink: Use GstVideoCropMeta to set overlay window if available":
0001-v4l2sink-Use-GstVideoCropMeta-to-set-overlay-window-.patch