aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/main.c b/main.c
index b945ee9..03af7da 100644
--- a/main.c
+++ b/main.c
@@ -103,7 +103,7 @@ static int handle_v4l_events(struct video *vid)
return 0;
}
-void cleanup(struct instance *i)
+static void cleanup(struct instance *i)
{
if (i->video.fd)
video_close(i);
@@ -113,7 +113,7 @@ void cleanup(struct instance *i)
close(i->out.fd);
}
-int save_encoded(struct instance *i, const void *buf, unsigned int size)
+static int save_encoded(struct instance *i, const void *buf, unsigned int size)
{
mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
char filename[64];
@@ -175,7 +175,7 @@ static int input_read(struct instance *inst, unsigned int index,
/* This threads is responsible for reading input file or stream and
* feeding video enccoder with consecutive frames to encode */
-void *input_thread_func(void *args)
+static void *input_thread_func(void *args)
{
struct instance *i = (struct instance *)args;
struct video *vid = &i->video;
@@ -219,7 +219,7 @@ void *input_thread_func(void *args)
return NULL;
}
-void *main_thread_func(void *args)
+static void *main_thread_func(void *args)
{
struct instance *i = (struct instance *)args;
struct video *vid = &i->video;
@@ -256,12 +256,7 @@ void *main_thread_func(void *args)
dbg("dequeuing capture buffer");
- if (i->use_dmabuf)
- ret = video_dequeue_capture_dmabuf(
- i, &n, &finished, &bytesused);
- else
- ret = video_dequeue_capture(i, &n, &finished,
- &bytesused);
+ ret = video_dequeue_capture(i, &n, &finished, &bytesused);
if (ret < 0)
goto next_event;
@@ -343,11 +338,7 @@ int main(int argc, char **argv)
if (ret)
goto err;
- if (inst.use_dmabuf)
- ret = video_setup_capture_dmabuf(&inst, 2, inst.width,
- inst.height);
- else
- ret = video_setup_capture(&inst, 2, inst.width, inst.height);
+ ret = video_setup_capture(&inst, 2, inst.width, inst.height);
if (ret)
goto err;
@@ -355,7 +346,13 @@ int main(int argc, char **argv)
if (ret)
goto err;
- ret = gentest_init(inst.width, inst.height, vid->out_buf_size);
+ info("gentest init: %ux%u, bpl:%u, crop_w:%u, crop_h:%u",
+ vid->out_w, vid->out_h, vid->out_bytesperline,
+ inst.width, inst.height);
+
+ ret = gentest_init(vid->out_w, vid->out_h, vid->out_bytesperline,
+ inst.width, inst.height,
+ vid->out_buf_size);
if (ret)
goto err;