History

check resolution configure

ruil2 committed 12 years ago

Commit 15e225a1 parent 66447341 file · +13 −0Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+13−0
@@ -91,6 +91,19 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 90 unmodified lines
9191 return ENC_RETURN_UNSUPPORTED_PARA;
9292 }
9393 }
94+ if (pCfg->iSpatialLayerNum > 1) {
95+ int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;
96+ int32_t iFinalHeight = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;
97+ for (i = 0; i < (pCfg->iSpatialLayerNum - 1); i++) {
98+ SSpatialLayerConfig* fDlp = &pCfg->sSpatialLayers[i];
99+ if ((fDlp->iVideoWidth > iFinalWidth) || (fDlp->iVideoHeight > iFinalHeight)) {
100+ WelsLog (pLogCtx, WELS_LOG_ERROR,
101+ "ParamValidation,Invalid resolution layer(%d) resolution(%d x %d) shoudl be less than the highest spatial layer resolution(%d x %d)\n ",
102+ i, fDlp->iVideoWidth, fDlp->iVideoHeight, iFinalWidth, iFinalHeight);
103+ return ENC_RETURN_UNSUPPORTED_PARA;
104+ }
105+ }
106+ }
94107 for (i = 0; i < pCfg->iSpatialLayerNum; ++ i) {
95108 SSpatialLayerInternal* fDlp = &pCfg->sDependencyLayers[i];
96109 if (fDlp->fOutputFrameRate > fDlp->fInputFrameRate || (fDlp->fInputFrameRate >= -fEpsn

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t