aboutsummaryrefslogtreecommitdiff
path: root/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'video.c')
-rw-r--r--video.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/video.c b/video.c
index 013fd30..b704fa2 100644
--- a/video.c
+++ b/video.c
@@ -34,6 +34,9 @@
#include "common.h"
+/* mem2mem encoder/decoder */
+#define V4L2_BUF_FLAG_LAST 0x00100000
+
static char *dbg_type[2] = {"OUTPUT", "CAPTURE"};
static char *dbg_status[2] = {"ON", "OFF"};
@@ -88,23 +91,7 @@ int video_set_control(struct instance *i)
ret = ioctl(i->video.fd, VIDIOC_S_PARM, &parm);
if (ret)
err("set framerate (%s)", strerror(errno));
-#if 0
- cntrl.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE;
- cntrl.value = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
-
- info("setting profile");
- ret = ioctl(i->video.fd, VIDIOC_S_CTRL, &cntrl);
- if (ret)
- err("set control - profile (%s)", strerror(errno));
- cntrl.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL;
- cntrl.value = V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
-
- info("setting level");
- ret = ioctl(i->video.fd, VIDIOC_S_CTRL, &cntrl);
- if (ret)
- err("set control - level (%s)", strerror(errno));
-#endif
cntrl.id = V4L2_CID_MPEG_VIDEO_BITRATE;
cntrl.value = 64000;
@@ -211,8 +198,10 @@ static int video_queue_buf(struct instance *i, int index, int l1, int l2,
buf.m.planes[0].length = vid->cap_buf_size[0];
} else {
buf.m.planes[0].length = vid->out_buf_size;
- if (l1 == 0)
- buf.flags |= V4L2_QCOM_BUF_FLAG_EOS;
+ if (l1 == 0) {
+ buf.m.planes[0].bytesused = 1;
+ buf.flags |= V4L2_BUF_FLAG_LAST;
+ }
ret = gettimeofday(&tv, NULL);
if (ret)
@@ -322,6 +311,7 @@ int video_dequeue_capture(struct instance *i, int *n, int *finished,
*finished = 0;
if (buf.flags & V4L2_QCOM_BUF_FLAG_EOS ||
+ buf.flags & V4L2_BUF_FLAG_LAST ||
buf.m.planes[0].bytesused == 0)
*finished = 1;