summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l2-mfc-example/main.c2
-rw-r--r--v4l2-mfc-example/mfc.c14
-rw-r--r--v4l2-mfc-example/mfc.h3
3 files changed, 18 insertions, 1 deletions
diff --git a/v4l2-mfc-example/main.c b/v4l2-mfc-example/main.c
index 73b9ad7..a27aa16 100644
--- a/v4l2-mfc-example/main.c
+++ b/v4l2-mfc-example/main.c
@@ -171,6 +171,8 @@ void *parser_thread_func(void *args)
dbg("Parser has extracted all frames");
i->parser.finished = 1;
fs = 0;
+ mfc_dec_stop(i);
+ return 0;
}
dbg("Extracted frame of size %d", fs);
diff --git a/v4l2-mfc-example/mfc.c b/v4l2-mfc-example/mfc.c
index 1b535e6..0a89657 100644
--- a/v4l2-mfc-example/mfc.c
+++ b/v4l2-mfc-example/mfc.c
@@ -367,3 +367,17 @@ int mfc_dec_setup_capture(struct instance *i, int extra_buf)
return 0;
}
+int mfc_dec_stop(struct instance *i)
+{
+ int ret;
+ struct v4l2_decoder_cmd cmd;
+
+ memzero(cmd);
+ cmd.cmd = V4L2_ENC_CMD_STOP;
+ ret = ioctl(i->mfc.fd, VIDIOC_DECODER_CMD, &cmd);
+ if (ret != 0) {
+ err("Failed ioctl vidioc_decoder_cmd");
+ return -1;
+ }
+ return 0;
+}
diff --git a/v4l2-mfc-example/mfc.h b/v4l2-mfc-example/mfc.h
index 74095b4..b30ff7a 100644
--- a/v4l2-mfc-example/mfc.h
+++ b/v4l2-mfc-example/mfc.h
@@ -48,6 +48,7 @@ int mfc_dec_setup_capture(struct instance *i, int extra_buf);
/* Dequeue a buffer, the structure *buf is used to return the parameters of the
* dequeued buffer. */
int mfc_dec_dequeue_buf(struct instance *i, struct v4l2_buffer *buf);
-
+/* This function is for EOS*/
+int mfc_dec_stop(struct instance *i);
#endif /* INCLUDE_MFC_H */