[mpi]: use mpp_create / mpp_destroy pair to replace construct

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@532 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2016-01-20 02:01:10 +00:00
parent 41a1543648
commit 4830431996
4 changed files with 23 additions and 24 deletions

View File

@@ -63,7 +63,7 @@ static MPP_RET mpi_decode_put_packet(MppCtx ctx, MppPacket packet)
MpiImpl *p = (MpiImpl *)ctx;
if (NULL == p || p->check != p || NULL == p->ctx || NULL == packet) {
mpp_err("mpi_decode_put_packet found invalid context input ctx %p packet %p\n",
mpp_err_f("found invalid context input ctx %p packet %p\n",
ctx, packet);
return MPP_ERR_UNKNOW;
}
@@ -80,7 +80,7 @@ static MPP_RET mpi_decode_get_frame(MppCtx ctx, MppFrame *frame)
MpiImpl *p = (MpiImpl *)ctx;
if (NULL == p || p->check != p || NULL == p->ctx || NULL == frame) {
mpp_err("mpi_decode_get_frame found invalid context input ctx %p frame %p\n",
mpp_err_f("found invalid context input ctx %p frame %p\n",
ctx, frame);
return MPP_ERR_UNKNOW;
}
@@ -97,7 +97,7 @@ static MPP_RET mpi_encode_put_frame(MppCtx ctx, MppFrame frame)
MpiImpl *p = (MpiImpl *)ctx;
if (NULL == p || p->check != p || NULL == p->ctx || NULL == frame) {
mpp_err("mpi_encode_put_frame found invalid context input ctx %p frame %p\n",
mpp_err_f("found invalid context input ctx %p frame %p\n",
ctx, frame);
return MPP_ERR_UNKNOW;
}
@@ -114,7 +114,7 @@ static MPP_RET mpi_encode_get_packet(MppCtx ctx, MppPacket *packet)
MpiImpl *p = (MpiImpl *)ctx;
if (NULL == p || p->check != p || NULL == p->ctx || NULL == packet) {
mpp_err("mpi_encode_get_packet found invalid context input ctx %p packet %p\n",
mpp_err_f("found invalid context input ctx %p packet %p\n",
ctx, packet);
return MPP_ERR_UNKNOW;
}
@@ -161,15 +161,14 @@ static MppApi mpp_api = {
{0},
};
MPP_RET mpp_construct(MppCtx *ctx, MppApi **mpi)
MPP_RET mpp_create(MppCtx *ctx, MppApi **mpi)
{
MpiImpl *p;
MPI_FUNCTION_ENTER();
if (NULL == ctx || NULL == mpi) {
mpp_err("mpp_init invalid input ctx %p mpi %p\n", ctx, mpi);
mpp_err_f("invalid input ctx %p mpi %p\n", ctx, mpi);
return MPP_ERR_NULL_PTR;
}
@@ -178,7 +177,7 @@ MPP_RET mpp_construct(MppCtx *ctx, MppApi **mpi)
p = mpp_malloc(MpiImpl, 1);
if (NULL == p) {
mpp_err("mpp_init failed to allocate context\n");
mpp_err_f("failed to allocate context\n");
return MPP_ERR_MALLOC;
}
@@ -186,7 +185,7 @@ MPP_RET mpp_construct(MppCtx *ctx, MppApi **mpi)
p->ctx = new Mpp();
if (NULL == p->ctx) {
mpp_free(p);
mpp_err("mpp_construct failed to new Mpp\n");
mpp_err_f("failed to new Mpp\n");
return MPP_ERR_MALLOC;
}
p->api = &mpp_api;
@@ -206,7 +205,7 @@ MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding)
if (NULL == ctx ||
type >= MPP_CTX_BUTT ||
coding >= MPP_VIDEO_CodingMax) {
mpp_err("mpp_init invalid input ctx %p type %d coding %d\n",
mpp_err_f("invalid input ctx %p type %d coding %d\n",
ctx, type, coding);
return MPP_ERR_NULL_PTR;
}
@@ -220,20 +219,20 @@ MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding)
return MPP_OK;
}
MPP_RET mpp_deinit(MppCtx ctx)
MPP_RET mpp_destroy(MppCtx ctx)
{
MpiImpl *p;
MPI_FUNCTION_ENTER();
if (NULL == ctx) {
mpp_err("mpp_deinit input ctx %p is null pointer\n", ctx);
mpp_err_f("input ctx %p is null pointer\n", ctx);
return MPP_ERR_NULL_PTR;
}
p = (MpiImpl*)ctx;
if (p->check != p) {
mpp_err("mpp_deinit input invalid MppCtx\n");
mpp_err_f("input invalid MppCtx\n");
return MPP_ERR_UNKNOW;
}