[mpi]: Add poll interface to mpi

1. Add poll with timeout. Support three mode: block/non-block/timeout.
2. Change control MPP_SET_INPUT_BLOCK and MPP_SET_OUTPUT_BLOCK.
3. Remove msleep in most mpp interface.

Change-Id: I39d9a261b6f1da66c6cb944abd71d1e7f4928d2d
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2016-12-20 15:10:17 +08:00
parent 1bbd1dcce6
commit d8ed1f4eb1
13 changed files with 599 additions and 419 deletions

View File

@@ -229,12 +229,19 @@ typedef struct MppApi_t {
MPP_RET (*isp_get_frame)(MppCtx ctx, MppFrame *frame);
// advance data flow interface
/**
* @brief poll port for dequeue
* @param ctx The context of mpp
* @param type input port or output port which are both for data transaction
* @return 0 for success there is valid task for dequeue, others for failure
*/
MPP_RET (*poll)(MppCtx ctx, MppPortType type, MppPollType timeout);
/**
* @brief dequeue MppTask
* @param ctx The context of mpp
* @param type input port or output port which are both for data transaction
* @param task MppTask which is sent to mpp for process
* @return 0 for success, oters for failure
* @return 0 for success, others for failure
*/
MPP_RET (*dequeue)(MppCtx ctx, MppPortType type, MppTask *task);
/**
@@ -242,7 +249,7 @@ typedef struct MppApi_t {
* @param ctx The context of mpp
* @param type input port or output port which are both for data transaction
* @param task MppTask which is sent to mpp for process
* @return 0 for success, oters for failure
* @return 0 for success, others for failure
*/
MPP_RET (*enqueue)(MppCtx ctx, MppPortType type, MppTask task);
@@ -258,7 +265,7 @@ typedef struct MppApi_t {
* @param ctx The context of mpp
* @param cmd The mpi command
* @param param The mpi command parameter
* @return 0 for success, oters for failure
* @return 0 for success, others for failure
*/
MPP_RET (*control)(MppCtx ctx, MpiCmd cmd, MppParam param);