ref: 41339f3023c28961077d9bdf9fcf05f444297e69
parent: 0ff1eb482f7bf0e1acaa2f913f4f5345ef95974c
parent: 2e85e3c7d98811f1fea4ea617a55b23813a428dd
author: ruil2 <ruil2@cisco.com>
date: Fri Dec 12 04:13:29 EST 2014
Merge pull request #1615 from lyao2/ut_idr3 refine the UT case for checking IDR request
--- a/test/encoder/EncUT_EncoderExt.cpp
+++ b/test/encoder/EncUT_EncoderExt.cpp
@@ -125,7 +125,7 @@
int iResult;
iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
- //EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR));
+ EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR));
pSrcPic->uiTimeStamp += 30;
iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
@@ -622,7 +622,13 @@
//call next frame to be IDR
pPtrEnc->ForceIntraFrame (bIDR);
- EncodeOneIDRandP (pPtrEnc);
+ int iCount = 0;
+ do {
+ iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
+ pSrcPic->uiTimeStamp += 30;
+ } while ((sFbi.eFrameType == static_cast<int> (videoFrameTypeSkip)) && (iCount ++ < 100));
+ EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR));
pPtrEnc->Uninitialize();
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
@@ -662,7 +668,13 @@
//call next frame to be IDR
pPtrEnc->ForceIntraFrame (bIDR);
- EncodeOneIDRandP (pPtrEnc);
+ int iCount = 0;
+ do {
+ iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi);
+ EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));
+ pSrcPic->uiTimeStamp += 30;
+ } while ((sFbi.eFrameType == static_cast<int> (videoFrameTypeSkip)) && (iCount ++ < 100));
+ EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR));
pPtrEnc->Uninitialize();
EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess));