[mpp]: add mpp decode function implement

Change-Id: Ia37d42a1b52bb152a5cf98e78b040150d6451124
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
Herman Chen
2016-10-11 09:28:56 +08:00
parent 80140b3966
commit d1be7a7b4d
2 changed files with 318 additions and 245 deletions

View File

@@ -88,6 +88,7 @@ static MPP_RET mpi_decode(MppCtx ctx, MppPacket packet, MppFrame *frame)
mpi_dbg_func("enter ctx %p packet %p frame %p\n", ctx, packet, frame);
do {
RK_U32 packet_done = 0;
ret = check_mpp_ctx(p);
if (ret)
break;
@@ -97,9 +98,32 @@ static MPP_RET mpi_decode(MppCtx ctx, MppPacket packet, MppFrame *frame)
ret = MPP_ERR_NULL_PTR;
break;
}
// TODO: do decode here
*frame = NULL;
do {
/*
* if there is frame to return get the frame first
*/
ret = p->ctx->get_frame(frame);
if (ret || *frame)
break;
/* when packet is send do one more get frame here */
if (packet_done)
break;
/*
* then send input stream with block mode
*/
ret = p->ctx->put_packet(packet);
if (MPP_OK == ret)
packet_done = 1;
} while (1);
} while (0);
mpp_assert(0 == mpp_packet_get_length(packet));
mpi_dbg_func("leave ret %d\n", ret);
return ret;
}