Showing the changes to test/encoder/EncUT_EncoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -124,6 +124,7 @@ void EncoderInterfaceTest::EncodeOneIDRandP (ISVCEncoder* pPtrEnc) { · 123 unmodified lines | ||
| 124 | 124 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 125 | 125 | EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); |
| 126 | 126 | |
| 127 | + pSrcPic->uiTimeStamp += 30; | |
| 127 | 128 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| 128 | 129 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 129 | 130 | EXPECT_NE (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); |
| @@ -687,6 +688,7 @@ void EncoderInterfaceTest::ChangeResolutionAndCheckStatistics (const SEncParamBa · 557 unmodified lines | ||
| 687 | 688 | |
| 688 | 689 | // 3, code one frame |
| 689 | 690 | PrepareOneSrcFrame(); |
| 691 | + pSrcPic->uiTimeStamp = 30 * pEncoderStatistics->uiInputFrameCount; | |
| 690 | 692 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| 691 | 693 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 692 | 694 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, pEncoderStatistics); |
| @@ -738,6 +740,14 @@ TEST_F (EncoderInterfaceTest, GetStatistics) { · 45 unmodified lines | ||
| 738 | 740 | sEncParamBase.iPicHeight = (sEncParamBase.iPicHeight % 16) + 1; //try 1~16 |
| 739 | 741 | ChangeResolutionAndCheckStatistics (sEncParamBase, &sEncoderStatistics); |
| 740 | 742 | |
| 743 | + // try timestamp and frame rate | |
| 744 | + pSrcPic->uiTimeStamp = 1000; | |
| 745 | + iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); | |
| 746 | + EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | |
| 747 | + iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, &sEncoderStatistics); | |
| 748 | + EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | |
| 749 | + EXPECT_EQ (static_cast<int> (sEncoderStatistics.fAverageFrameRate), sEncoderStatistics.uiInputFrameCount); | |
| 750 | + | |
| 741 | 751 | // 4, change log interval |
| 742 | 752 | int32_t iInterval = 0; |
| 743 | 753 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_STATISTICS_LOG_INTERVAL, &iInterval); |