switch (pixel_format) {
case V4L2_PIX_FMT_YUV420M:
case V4L2_PIX_FMT_YVU420M:
+#ifdef V4L2_PIX_FMT_YUV422M
case V4L2_PIX_FMT_YUV422M:
+#endif
+#ifdef V4L2_PIX_FMT_YVU422M
case V4L2_PIX_FMT_YVU422M:
+#endif
+#ifdef V4L2_PIX_FMT_YUV444M
case V4L2_PIX_FMT_YUV444M:
+#endif
+#ifdef V4L2_PIX_FMT_YVU444M
case V4L2_PIX_FMT_YVU444M:
+#endif
case V4L2_PIX_FMT_NV12M:
case V4L2_PIX_FMT_NV21M:
case V4L2_PIX_FMT_NV12MT_16X16:
frame->pts = v4l2_get_pts(avbuf);
frame->pkt_dts = AV_NOPTS_VALUE;
- /* these two values are updated also during re-init in v4l2_process_driver_event */
+ /* these values are updated also during re-init in v4l2_process_driver_event */
frame->height = avbuf->context->height;
frame->width = avbuf->context->width;
+ frame->sample_aspect_ratio = avbuf->context->sample_aspect_ratio;
/* 3. report errors upstream */
if (avbuf->buf.flags & V4L2_BUF_FLAG_ERROR) {
if (V4L2_TYPE_IS_MULTIPLANAR(ctx->type)) {
avbuf->num_planes = 0;
- for (;;) {
- /* in MP, the V4L2 API states that buf.length means num_planes */
- if (avbuf->num_planes >= avbuf->buf.length)
- break;
- if (avbuf->buf.m.planes[avbuf->num_planes].length)
+ /* in MP, the V4L2 API states that buf.length means num_planes */
+ for (i = 0; i < avbuf->buf.length; i++) {
+ if (avbuf->buf.m.planes[i].length)
avbuf->num_planes++;
}
} else