summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6e7a0ef)
raw | patch | inline | side by side (parent: 6e7a0ef)
author | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Sun, 5 Jan 2014 16:36:27 +0000 (22:06 +0530) | ||
committer | Nikhil Devshatwar <nikhil.nd@ti.com> | |
Tue, 25 Mar 2014 09:02:51 +0000 (14:32 +0530) |
Use 6 buffers instead of 3
Queue all the buffers before calling stream ON
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
Queue all the buffers before calling stream ON
Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
dmabuftest.c | patch | blob | history |
diff --git a/dmabuftest.c b/dmabuftest.c
index a8329eb723e7330b0381d23f4d9c37f7f2e895e6..120db820e46a4661e22fc7e2a8bd1c1f5b0cd6c7 100644 (file)
--- a/dmabuftest.c
+++ b/dmabuftest.c
#include <pthread.h>
#include "util.h"
-#define NBUF 3
-#define CNT 500
+#define NBUF 6
+#define CNT 500000
enum display_area {
FULL,
uint32_t fourcc = data->fourcc;
uint32_t width = data->width, height = data->height;
- struct buffer **buffers;
+ struct buffer **buffers, *capt;
int ret, i;
buffers = disp_get_vid_buffers(disp, NBUF, fourcc, width, height);
get_overlay_plane(disp, buffers[i]);
}
}
- v4l2_qbuf(v4l2, buffers[0]);
+
+ for (i = 0; i < NBUF; i++) {
+ v4l2_qbuf(v4l2, buffers[i]);
+ }
+
v4l2_streamon(v4l2);
for (i = 1; i < CNT; i++) {
- v4l2_qbuf(v4l2, buffers[i % NBUF]);
+ capt = v4l2_dqbuf(v4l2);
switch(data->area) {
case FULL:
- ret = disp_post_vid_buffer(disp, v4l2_dqbuf(v4l2),
+ ret = disp_post_vid_buffer(disp, capt,
0, 0, width, height);
break;
case OVERLAY:
- ret = disp_post_vid_buffer(disp, v4l2_dqbuf(v4l2),
+ ret = disp_post_vid_buffer(disp, capt,
0, 0, width, height);
break;
}
if (ret) {
return NULL;
}
+ v4l2_qbuf(v4l2, capt);
}
v4l2_streamoff(v4l2);