dmabuftest: Remove switch thread logic
[glsdk/omapdrmtest.git] / dmabuftest.c
index ff6b98fd061e4ff720b688cbe8a0e9f1404f6ad5..ab6e1d67098759ad030743a20094ddcccf742fa6 100644 (file)
 #define CNT  500000
 #define MAX_CAP 6
 
-pthread_t active_thread;
-
-enum display_area {
-       FULL,
-       OVERLAY
-};
-
 struct thr_data {
        struct display *disp;
        struct v4l2 *v4l2;
        uint32_t fourcc, width, height;
-       enum display_area area;
 };
 
 static void
@@ -63,11 +55,8 @@ capture_loop(void *arg)
        uint32_t width = data->width, height = data->height;
 
        struct buffer **buffers, *capt;
-       pthread_t tid;
        int ret, i;
 
-       tid = pthread_self();
-
        buffers = disp_get_vid_buffers(disp, NBUF, fourcc, width, height);
        if (!buffers) {
                return NULL;
@@ -78,13 +67,6 @@ capture_loop(void *arg)
                return NULL;
        }
 
-       if(data->area == OVERLAY) {
-               for (i = 0; i < NBUF; i++) {
-                       buffers[i]->noScale = true;
-                       get_overlay_plane(disp, buffers[i]);
-               }
-       }
-
        for (i = 0; i < NBUF; i++) {
                v4l2_qbuf(v4l2, buffers[i]);
        }
@@ -93,21 +75,11 @@ capture_loop(void *arg)
        for (i = 1; i < CNT; i++) {
 
                capt = v4l2_dqbuf(v4l2);
-               if(active_thread == tid) {
-                       switch(data->area) {
-                       case FULL:
-                               ret = disp_post_vid_buffer(disp, capt,
-                                       0, 0, width, height);
-                       break;
-                       case OVERLAY:
-                               ret = disp_post_vid_buffer(disp, capt,
-                                       0, 0, width, height);
-                       break;
-                       }
-                       if (ret) {
-                               MSG("Quitting");
-                               return NULL;
-                       }
+               ret = disp_post_vid_buffer(disp, capt,
+                       0, 0, width, height);
+               if (ret) {
+                       ERROR("Post buffer failed");
+                       return NULL;
                }
                v4l2_qbuf(v4l2, capt);
        }
@@ -160,7 +132,6 @@ main(int argc, char **argv)
                }
                tdata[i].disp = disp;
                tdata[i].v4l2 = v4l2;
-               tdata[i].area = FULL;
        }
 
        if (check_args(argc, argv)) {
@@ -175,15 +146,6 @@ main(int argc, char **argv)
                        MSG("Failed creating thread");
                }
        }
-       active_thread = threads[0];
-
-       while(1) {
-               c = getchar();
-               if(c == 's') {
-                       idx = (idx + 1) % multi;
-                       active_thread = threads[idx];
-               }
-       }
 
        for (i = 0; i < multi; i++) {
                pthread_join(threads[i], &result);