mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-06 17:46:50 +08:00
[mpp]: add packet/frame block flag and multi-frame output flag
git-svn-id: https://10.10.10.66:8443/svn/MediaProcessPlatform/trunk/mpp@363 6e48237b-75ef-9749-8fc9-41990f28c85a
This commit is contained in:
24
mpp/mpp.cpp
24
mpp/mpp.cpp
@@ -51,6 +51,9 @@ Mpp::Mpp(MppCtxType type, MppCodingType coding)
|
|||||||
mThreadHal(NULL),
|
mThreadHal(NULL),
|
||||||
mType(type),
|
mType(type),
|
||||||
mCoding(coding),
|
mCoding(coding),
|
||||||
|
mPacketBlock(0),
|
||||||
|
mFrameBlock(0),
|
||||||
|
mMultiFrame(0),
|
||||||
mStatus(0),
|
mStatus(0),
|
||||||
mDec(NULL),
|
mDec(NULL),
|
||||||
mEnc(NULL)
|
mEnc(NULL)
|
||||||
@@ -177,7 +180,8 @@ MPP_RET Mpp::get_frame(MppFrame *frame)
|
|||||||
|
|
||||||
if (0 == mFrames->list_size()) {
|
if (0 == mFrames->list_size()) {
|
||||||
mThreadCodec->signal();
|
mThreadCodec->signal();
|
||||||
mFrames->wait();
|
if (mFrameBlock)
|
||||||
|
mFrames->wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mFrames->list_size()) {
|
if (mFrames->list_size()) {
|
||||||
@@ -185,14 +189,16 @@ MPP_RET Mpp::get_frame(MppFrame *frame)
|
|||||||
mFrameGetCount++;
|
mFrameGetCount++;
|
||||||
mThreadHal->signal();
|
mThreadHal->signal();
|
||||||
|
|
||||||
MppFrame prev = first;
|
if (mMultiFrame) {
|
||||||
MppFrame next = NULL;
|
MppFrame prev = first;
|
||||||
while (mFrames->list_size()) {
|
MppFrame next = NULL;
|
||||||
mFrames->del_at_head(&next, sizeof(frame));
|
while (mFrames->list_size()) {
|
||||||
mFrameGetCount++;
|
mFrames->del_at_head(&next, sizeof(frame));
|
||||||
mThreadHal->signal();
|
mFrameGetCount++;
|
||||||
mpp_frame_set_next(prev, next);
|
mThreadHal->signal();
|
||||||
prev = next;
|
mpp_frame_set_next(prev, next);
|
||||||
|
prev = next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*frame = first;
|
*frame = first;
|
||||||
|
Reference in New Issue
Block a user