diff options
author | Divya Jaiswal <divya.jswl@samsung.com> | 2015-07-07 14:53:03 +0200 |
---|---|---|
committer | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2015-07-09 15:55:20 +0200 |
commit | d1bb80df16a8bee9635a916f02c848298f7d9988 (patch) | |
tree | 19d4389988fd464a5b35a9ef03cc3021be0a161e | |
parent | d71d5fc9fd0420d4a738a69c2e68d4e68e31a8fd (diff) |
v4l2-mfc-example: Add EOS
This patch adds a function that tells MFC when there is end of stream.
Signed-off-by: Divya Jaiswal <divya.jswl@samsung.com>
Signed-off-by: Mateusz Krawczuk <m.krawczuk@samsung.com>
-rw-r--r-- | v4l2-mfc-example/main.c | 2 | ||||
-rw-r--r-- | v4l2-mfc-example/mfc.c | 14 | ||||
-rw-r--r-- | v4l2-mfc-example/mfc.h | 3 |
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 */ |