Hantro H1 and Rockchip VEPU2 drivers will pad the width/height to a
multiple of 16. In order to obtain the right JPEG size, the image needs
to be cropped using the S_SELECTION API. This support is added as best
effort since older drivers may emulate this by looking at the capture
queue width/height.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2329>
struct v4l2_selection sel = { 0 };
GST_V4L2_CHECK_OPEN (obj);
- GST_V4L2_CHECK_NOT_ACTIVE (obj);
sel.type = obj->type;
sel.target = V4L2_SEL_TGT_COMPOSE_DEFAULT;
struct v4l2_crop crop = { 0 };
GST_V4L2_CHECK_OPEN (obj);
- GST_V4L2_CHECK_NOT_ACTIVE (obj);
sel.type = obj->type;
sel.target = V4L2_SEL_TGT_CROP;
return FALSE;
}
+ /* best effort */
+ gst_v4l2_object_setup_padding (self->v4l2output);
+
self->input_state = gst_video_codec_state_ref (state);
GST_DEBUG_OBJECT (self, "output caps: %" GST_PTR_FORMAT, state->caps);
}
gst_caps_unref (caps);
+ /* best effort */
+ gst_v4l2_object_setup_padding (self->v4l2capture);
+
if (gst_v4l2_object_decide_allocation (self->v4l2capture, query)) {
GstVideoEncoderClass *enc_class = GST_VIDEO_ENCODER_CLASS (parent_class);
ret = enc_class->decide_allocation (encoder, query);