mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-06 17:46:50 +08:00
[mpi/mpp]: Add mpp internal start / stop function
Change-Id: I959211f26cd1c37924c7f6894535acedd8a37b88 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -99,6 +99,10 @@ public:
|
|||||||
Mpp();
|
Mpp();
|
||||||
~Mpp();
|
~Mpp();
|
||||||
MPP_RET init(MppCtxType type, MppCodingType coding);
|
MPP_RET init(MppCtxType type, MppCodingType coding);
|
||||||
|
|
||||||
|
MPP_RET start();
|
||||||
|
MPP_RET stop();
|
||||||
|
|
||||||
MPP_RET put_packet(MppPacket packet);
|
MPP_RET put_packet(MppPacket packet);
|
||||||
MPP_RET get_frame(MppFrame *frame);
|
MPP_RET get_frame(MppFrame *frame);
|
||||||
|
|
||||||
|
58
mpp/mpi.cpp
58
mpp/mpi.cpp
@@ -137,7 +137,7 @@ static MPP_RET mpi_decode(MppCtx ctx, MppPacket packet, MppFrame *frame)
|
|||||||
|
|
||||||
mpp_assert(0 == mpp_packet_get_length(packet));
|
mpp_assert(0 == mpp_packet_get_length(packet));
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,7 +161,7 @@ static MPP_RET mpi_decode_put_packet(MppCtx ctx, MppPacket packet)
|
|||||||
ret = p->ctx->put_packet(packet);
|
ret = p->ctx->put_packet(packet);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ static MPP_RET mpi_decode_get_frame(MppCtx ctx, MppFrame *frame)
|
|||||||
ret = p->ctx->get_frame(frame);
|
ret = p->ctx->get_frame(frame);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ static MPP_RET mpi_encode(MppCtx ctx, MppFrame frame, MppPacket *packet)
|
|||||||
// TODO: do encode here
|
// TODO: do encode here
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,7 +233,7 @@ static MPP_RET mpi_encode_put_frame(MppCtx ctx, MppFrame frame)
|
|||||||
ret = p->ctx->put_frame(frame);
|
ret = p->ctx->put_frame(frame);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +257,7 @@ static MPP_RET mpi_encode_get_packet(MppCtx ctx, MppPacket *packet)
|
|||||||
ret = p->ctx->get_packet(packet);
|
ret = p->ctx->get_packet(packet);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ static MPP_RET mpi_isp(MppCtx ctx, MppFrame dst, MppFrame src)
|
|||||||
|
|
||||||
// TODO: do isp process here
|
// TODO: do isp process here
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return MPP_OK;
|
return MPP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,7 +279,7 @@ static MPP_RET mpi_isp_put_frame(MppCtx ctx, MppFrame frame)
|
|||||||
|
|
||||||
// TODO: do isp put frame process here
|
// TODO: do isp put frame process here
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ static MPP_RET mpi_poll(MppCtx ctx, MppPortType type, MppPollType timeout)
|
|||||||
ret = MPP_OK;
|
ret = MPP_OK;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ static MPP_RET mpi_dequeue(MppCtx ctx, MppPortType type, MppTask *task)
|
|||||||
ret = p->ctx->dequeue(type, task);
|
ret = p->ctx->dequeue(type, task);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ static MPP_RET mpi_enqueue(MppCtx ctx, MppPortType type, MppTask task)
|
|||||||
ret = p->ctx->enqueue(type, task);
|
ret = p->ctx->enqueue(type, task);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ static MPP_RET mpi_reset(MppCtx ctx)
|
|||||||
ret = p->ctx->reset();
|
ret = p->ctx->reset();
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,7 +402,7 @@ static MPP_RET mpi_control(MppCtx ctx, MpiCmd cmd, MppParam param)
|
|||||||
ret = p->ctx->control(cmd, param);
|
ret = p->ctx->control(cmd, param);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -493,7 +493,7 @@ MPP_RET mpp_init(MppCtx ctx, MppCtxType type, MppCodingType coding)
|
|||||||
p->coding = coding;
|
p->coding = coding;
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -515,7 +515,35 @@ MPP_RET mpp_destroy(MppCtx ctx)
|
|||||||
mpp_free(p);
|
mpp_free(p);
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
mpi_dbg_func("leave ret %d\n", ret);
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
MPP_RET mpp_start(MppCtx ctx)
|
||||||
|
{
|
||||||
|
mpi_dbg_func("enter ctx %p\n", ctx);
|
||||||
|
|
||||||
|
MpiImpl *p = (MpiImpl*)ctx;
|
||||||
|
MPP_RET ret = check_mpp_ctx(p);
|
||||||
|
|
||||||
|
if (MPP_OK == ret)
|
||||||
|
ret = p->ctx->start();
|
||||||
|
|
||||||
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
MPP_RET mpp_stop(MppCtx ctx)
|
||||||
|
{
|
||||||
|
mpi_dbg_func("enter ctx %p\n", ctx);
|
||||||
|
|
||||||
|
MpiImpl *p = (MpiImpl*)ctx;
|
||||||
|
MPP_RET ret = check_mpp_ctx(p);
|
||||||
|
|
||||||
|
if (MPP_OK == ret)
|
||||||
|
ret = p->ctx->stop();
|
||||||
|
|
||||||
|
mpi_dbg_func("leave ctx %p ret %d\n", ctx, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
10
mpp/mpp.cpp
10
mpp/mpp.cpp
@@ -285,6 +285,16 @@ void Mpp::clear()
|
|||||||
mpp_dump_deinit(&mDump);
|
mpp_dump_deinit(&mDump);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MPP_RET Mpp::start()
|
||||||
|
{
|
||||||
|
return MPP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
MPP_RET Mpp::stop()
|
||||||
|
{
|
||||||
|
return MPP_OK;
|
||||||
|
}
|
||||||
|
|
||||||
MPP_RET Mpp::put_packet(MppPacket packet)
|
MPP_RET Mpp::put_packet(MppPacket packet)
|
||||||
{
|
{
|
||||||
if (!mInitDone)
|
if (!mInitDone)
|
||||||
|
Reference in New Issue
Block a user