if (!atomic_load(&s->refcount))
sem_post(&s->refsync);
} else {
- if (s->draining) {
+ if (s->draining && V4L2_TYPE_IS_OUTPUT(avbuf->context->type)) {
/* no need to queue more buffers to the driver */
avbuf->status = V4L2BUF_AVAILABLE;
}
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:
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