Showing the changes to test/api/encode_options_test.cpp (1 of 9 files). Show all
Unified · Split
| @@ -1033,6 +1033,13 @@ TEST_F (EncodeDecodeTestAPI, SimulcastSVC) { · 1032 unmodified lines | |||
| 1033 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << "LayerIdx=" << iIdx; | 1033 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << "LayerIdx=" << iIdx; |
| 1034 | iResult = decoder[iIdx]->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); | 1034 | iResult = decoder[iIdx]->DecodeFrame2 (NULL, 0, pData, &dstBufInfo_); |
| 1035 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << "LayerIdx=" << iIdx; | 1035 | EXPECT_TRUE (iResult == cmResultSuccess) << "iResult=" << iResult << "LayerIdx=" << iIdx; |
| 1036 | if (dstBufInfo_.iBufferStatus == 0) { | ||
| 1037 | int32_t num_of_frames_in_buffer = 0; | ||
| 1038 | decoder[iIdx]->GetOption (DECODER_OPTION_NUM_OF_FRAMES_REMAINING_IN_BUFFER, &num_of_frames_in_buffer); | ||
| 1039 | for (int32_t i = 0; i < num_of_frames_in_buffer; ++i) { | ||
| 1040 | decoder[iIdx]->FlushFrame (pData, &dstBufInfo_); | ||
| 1041 | } | ||
| 1042 | } | ||
| 1036 | EXPECT_EQ (dstBufInfo_.iBufferStatus, 1) << "LayerIdx=" << iIdx; | 1043 | EXPECT_EQ (dstBufInfo_.iBufferStatus, 1) << "LayerIdx=" << iIdx; |
| 1037 | } | 1044 | } |
| 1038 | } | 1045 | } |
| @@ -2299,7 +2306,7 @@ TEST_F (EncodeDecodeTestAPI, TemporalLayerChangeDuringEncoding_Specific) { · 1260 unmodified lines | |||
| 2299 | 2306 | ||
| 2300 | while (fileStream.read (buf_.data(), frameSize) == frameSize) { | 2307 | while (fileStream.read (buf_.data(), frameSize) == frameSize) { |
| 2301 | 2308 | ||
| 2302 | if ( (iStepIdx < 3) && (iFrameNum == ((iTotalFrame / 3) * (iStepIdx + 1)))) { | 2309 | if ((iStepIdx < 3) && (iFrameNum == ((iTotalFrame / 3) * (iStepIdx + 1)))) { |
| 2303 | sParam.iTemporalLayerNum = originalTemporalLayerNum * iSteps[iStepIdx]; | 2310 | sParam.iTemporalLayerNum = originalTemporalLayerNum * iSteps[iStepIdx]; |
| 2304 | sParam.iTargetBitrate = sParam.sSpatialLayers[0].iSpatialBitrate = originalBR * iSteps[iStepIdx]; | 2311 | sParam.iTargetBitrate = sParam.sSpatialLayers[0].iSpatialBitrate = originalBR * iSteps[iStepIdx]; |
| 2305 | sParam.fMaxFrameRate = sParam.sSpatialLayers[0].fFrameRate = originalFR * pow (2.0f, iSteps[iStepIdx]); | 2312 | sParam.fMaxFrameRate = sParam.sSpatialLayers[0].fFrameRate = originalFR * pow (2.0f, iSteps[iStepIdx]); |
| @@ -2314,9 +2321,11 @@ TEST_F (EncodeDecodeTestAPI, TemporalLayerChangeDuringEncoding_Specific) { · 8 unmodified lines | |||
| 2314 | 2321 | ||
| 2315 | if (bSetOption) { | 2322 | if (bSetOption) { |
| 2316 | if ((iStepIdx == 1) || (iStepIdx == 3)) { | 2323 | if ((iStepIdx == 1) || (iStepIdx == 3)) { |
| 2317 | EXPECT_TRUE (info.eFrameType == videoFrameTypeIDR) << "iStepIdx=" << iStepIdx << "iFrameNum=" << iFrameNum << "iTotalFrame=" << iTotalFrame; | 2324 | EXPECT_TRUE (info.eFrameType == videoFrameTypeIDR) << "iStepIdx=" << iStepIdx << "iFrameNum=" << iFrameNum << |
| 2325 | "iTotalFrame=" << iTotalFrame; | ||
| 2318 | } else { | 2326 | } else { |
| 2319 | EXPECT_TRUE (info.eFrameType != videoFrameTypeIDR) << "iStepIdx=" << iStepIdx << "iFrameNum=" << iFrameNum << "iTotalFrame=" << iTotalFrame; | 2327 | EXPECT_TRUE (info.eFrameType != videoFrameTypeIDR) << "iStepIdx=" << iStepIdx << "iFrameNum=" << iFrameNum << |
| 2328 | "iTotalFrame=" << iTotalFrame; | ||
| 2320 | } | 2329 | } |
| 2321 | 2330 | ||
| 2322 | bSetOption = false; | 2331 | bSetOption = false; |