modify unit test for return type modification
This commit is contained in:
parent
36d56b6638
commit
36abe317a5
@ -512,7 +512,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn
|
||||
}
|
||||
|
||||
const int32_t kiEncoderReturn = EncodeFrameInternal(kpSrcPic, pBsInfo);
|
||||
|
||||
|
||||
switch (kiEncoderReturn) {
|
||||
case ENC_RETURN_MEMALLOCERR:
|
||||
WelsUninitEncoderExt (&m_pEncContext);
|
||||
@ -540,7 +540,6 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn
|
||||
#ifdef DUMP_SRC_PICTURE
|
||||
DumpSrcPicture (pSrc);
|
||||
#endif // DUMP_SRC_PICTURE
|
||||
|
||||
return cmResultSuccess;
|
||||
}
|
||||
|
||||
@ -556,18 +555,12 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr
|
||||
const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic);
|
||||
XMMREG_PROTECT_LOAD(CWelsH264SVCEncoder);
|
||||
|
||||
switch (kiEncoderReturn) {
|
||||
case ENC_RETURN_MEMALLOCERR:
|
||||
if(kiEncoderReturn == ENC_RETURN_MEMALLOCERR) {
|
||||
WelsUninitEncoderExt (&m_pEncContext);
|
||||
return videoFrameTypeInvalid;
|
||||
case ENC_RETURN_SUCCESS:
|
||||
case ENC_RETURN_CORRECTED:
|
||||
break;//continue processing
|
||||
case ENC_RETURN_UNSUPPORTED_PARA:
|
||||
case ENC_RETURN_UNEXPECTED:
|
||||
return videoFrameTypeInvalid;
|
||||
default:
|
||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from WelsEncoderEncodeExt()!\n", kiEncoderReturn);
|
||||
}
|
||||
else if((kiEncoderReturn != ENC_RETURN_SUCCESS)&&(kiEncoderReturn == ENC_RETURN_CORRECTED)){
|
||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from EncodeFrameInternal()!\n", kiEncoderReturn);
|
||||
return videoFrameTypeInvalid;
|
||||
}
|
||||
|
||||
@ -593,8 +586,6 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
///////////////////for test
|
||||
#ifdef OUTPUT_BIT_STREAM
|
||||
if (iFrameType != videoFrameTypeInvalid && iFrameType != videoFrameTypeSkip) {
|
||||
@ -642,7 +633,7 @@ int CWelsH264SVCEncoder::EncodeFrameInternal(const SSourcePicture* pSrcPic, SFr
|
||||
DumpSrcPicture (pSrcPicList[0]->pData[0]);
|
||||
#endif // DUMP_SRC_PICTURE
|
||||
|
||||
return iFrameType;
|
||||
return kiEncoderReturn;
|
||||
|
||||
}
|
||||
|
||||
|
@ -81,8 +81,8 @@ void BaseEncoderTest::EncodeStream(InputStream* in, int width, int height,
|
||||
pic.pData[2] = pic.pData[1] + (width*height>>2);
|
||||
while (in->read(buf.data(), frameSize) == frameSize) {
|
||||
rv = encoder_->EncodeFrame(&pic, &info);
|
||||
ASSERT_TRUE(rv != videoFrameTypeInvalid);
|
||||
if (rv != videoFrameTypeSkip && cbk != NULL) {
|
||||
ASSERT_TRUE(rv == cmResultSuccess);
|
||||
if (info.eOutputFrameType != videoFrameTypeSkip && cbk != NULL) {
|
||||
cbk->onEncodeFrame(info);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user