Merge pull request #1233 from ruil2/interface_ut_1

add a judgment
This commit is contained in:
lyao2 2014-07-29 12:01:19 +08:00
commit cd4a615c43
2 changed files with 2 additions and 8 deletions

View File

@ -147,7 +147,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) {
}
if ((pCfg->iRCMode != RC_OFF_MODE) && (pCfg->iRCMode != RC_QUALITY_MODE) && (pCfg->iRCMode != RC_BITRATE_MODE)
if ((pCfg->iRCMode != RC_OFF_MODE) && (pCfg->iRCMode != RC_QUALITY_MODE) && (pCfg->iRCMode!= RC_BUFFERBASED_MODE)&&(pCfg->iRCMode != RC_BITRATE_MODE)
&& (pCfg->iRCMode != RC_LOW_BW_MODE)) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid iRCMode = %d\n", pCfg->iRCMode);
return ENC_RETURN_UNSUPPORTED_PARA;
@ -189,7 +189,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa
return ENC_RETURN_INVALIDINPUT;
if ((pCodingParam->iUsageType != CAMERA_VIDEO_REAL_TIME) && (pCodingParam->iUsageType != SCREEN_CONTENT_REAL_TIME)) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(),Invalid usage type = %d", pCodingParam->iUsageType);
WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(),Invalid usage type = %d\n", pCodingParam->iUsageType);
return ENC_RETURN_UNSUPPORTED_PARA;
}
if (pCodingParam->iSpatialLayerNum < 1 || pCodingParam->iSpatialLayerNum > MAX_DEPENDENCY_LAYER) {

View File

@ -404,12 +404,6 @@ TEST_F (EncoderInterfaceTest, BasicInitializeTestFalse) {
iResult = pPtrEnc->Initialize (&sEncParamBase);
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
//iUsageType
GetValidEncParamBase (&sEncParamBase);
sEncParamBase.iRCMode = static_cast<RC_MODES> (3);
iResult = pPtrEnc->Initialize (&sEncParamBase);
EXPECT_EQ (iResult, static_cast<int> (cmInitParaError));
uiTraceLevel = WELS_LOG_ERROR;
pPtrEnc->SetOption (ENCODER_OPTION_TRACE_LEVEL, &uiTraceLevel);
}