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 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 124 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 125 | EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | 125 | EXPECT_EQ (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); |
| 126 | 126 | ||
| 127 | pSrcPic->uiTimeStamp += 30; | ||
| 127 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); | 128 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| 128 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 129 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 129 | EXPECT_NE (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); | 130 | EXPECT_NE (sFbi.eFrameType, static_cast<int> (videoFrameTypeIDR)); |
| @@ -687,6 +688,7 @@ void EncoderInterfaceTest::ChangeResolutionAndCheckStatistics (const SEncParamBa · 557 unmodified lines | |||
| 687 | 688 | ||
| 688 | // 3, code one frame | 689 | // 3, code one frame |
| 689 | PrepareOneSrcFrame(); | 690 | PrepareOneSrcFrame(); |
| 691 | pSrcPic->uiTimeStamp = 30 * pEncoderStatistics->uiInputFrameCount; | ||
| 690 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); | 692 | iResult = pPtrEnc->EncodeFrame (pSrcPic, &sFbi); |
| 691 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); | 693 | EXPECT_EQ (iResult, static_cast<int> (cmResultSuccess)); |
| 692 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, pEncoderStatistics); | 694 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_GET_STATISTICS, pEncoderStatistics); |
| @@ -738,6 +740,14 @@ TEST_F (EncoderInterfaceTest, GetStatistics) { · 45 unmodified lines | |||
| 738 | sEncParamBase.iPicHeight = (sEncParamBase.iPicHeight % 16) + 1; //try 1~16 | 740 | sEncParamBase.iPicHeight = (sEncParamBase.iPicHeight % 16) + 1; //try 1~16 |
| 739 | ChangeResolutionAndCheckStatistics (sEncParamBase, &sEncoderStatistics); | 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 | // 4, change log interval | 751 | // 4, change log interval |
| 742 | int32_t iInterval = 0; | 752 | int32_t iInterval = 0; |
| 743 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_STATISTICS_LOG_INTERVAL, &iInterval); | 753 | iResult = pPtrEnc->GetOption (ENCODER_OPTION_STATISTICS_LOG_INTERVAL, &iInterval); |