[mpp]: separate mpp_dec into parser and hal

1. add syntax group for hal dec task management
2. separate mpp_dec and mpp_enc in mpp.cpp
3. separate decoder parser thread / decoder hal thread and encoder control thread / encoder hal thread

git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@196 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
ChenHengming
2008-01-25 22:22:40 +00:00
parent 1417648f19
commit 98665c1ede
14 changed files with 428 additions and 243 deletions

View File

@@ -47,13 +47,11 @@ Mpp::Mpp(MppCtxType type, MppCodingType coding)
mPacketGroup(NULL),
mFrameGroup(NULL),
mDec(NULL),
mHal(NULL),
mTheadCodec(NULL),
mThreadHal(NULL),
mType(type),
mCoding(coding),
mStatus(0),
mBufSlots(NULL),
mTask(NULL),
mTaskNum(2)
{
@@ -64,13 +62,8 @@ Mpp::Mpp(MppCtxType type, MppCodingType coding)
mTasks = new mpp_list((node_destructor)NULL);
mpp_dec_init(&mDec, coding);
MppHalCfg cfg = {
type,
coding,
};
mpp_hal_init(&mHal, &cfg);
mTheadCodec = new MppThread(mpp_dec_thread, this);
mThreadHal = new MppThread(mpp_hal_thread, this);
mTheadCodec = new MppThread(mpp_dec_parser_thread, this);
mThreadHal = new MppThread(mpp_dec_hal_thread, this);
mTask = mpp_malloc(MppHalDecTask*, mTaskNum);
mpp_buffer_group_normal_get(&mInternalGroup, MPP_BUFFER_TYPE_ION);
@@ -84,13 +77,8 @@ Mpp::Mpp(MppCtxType type, MppCodingType coding)
mTasks = new mpp_list((node_destructor)NULL);
mpp_dec_init(&mDec, coding);
MppHalCfg cfg = {
type,
coding,
};
mpp_hal_init(&mHal, &cfg);
mTheadCodec = new MppThread(mpp_enc_thread, this);
mThreadHal = new MppThread(mpp_hal_thread, this);
mTheadCodec = new MppThread(mpp_enc_control_thread, this);
mThreadHal = new MppThread(mpp_dec_hal_thread, this);
mTask = mpp_malloc(MppHalDecTask*, mTaskNum);
mpp_buffer_group_normal_get(&mInternalGroup, MPP_BUFFER_TYPE_ION);
@@ -103,7 +91,7 @@ Mpp::Mpp(MppCtxType type, MppCodingType coding)
}
if (mFrames && mPackets && mTask &&
mDec && mHal &&
(mDec || mEnc) &&
mTheadCodec && mThreadHal &&
mPacketGroup && mFrameGroup) {
mTheadCodec->start();
@@ -141,10 +129,6 @@ void Mpp::clear()
mpp_dec_deinit(mDec);
mDec = NULL;
}
if (mHal) {
mpp_hal_deinit(mHal);
mHal = NULL;
}
if (mPackets) {
delete mPackets;
mPackets = NULL;