modify EncoderFrame return type.
commit b99a307ab94183c32a293ad5fda8b0e3323546a0 Author: ruil2 <ruil2@cisco.com> Date: Wed Mar 12 13:34:27 2014 +0800 fix typo
This commit is contained in:
parent
2c796337ba
commit
36d56b6638
@ -64,7 +64,7 @@ class ISVCEncoder {
|
||||
virtual int EXTAPI Uninitialize() = 0;
|
||||
|
||||
/*
|
||||
* return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid]
|
||||
* return: 0 - success; otherwise -failed;
|
||||
*/
|
||||
virtual int EXTAPI EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) = 0;
|
||||
/*
|
||||
|
@ -75,6 +75,7 @@ typedef enum {
|
||||
cmUnkonwReason,
|
||||
cmMallocMemeError, /*Malloc a memory error*/
|
||||
cmInitExpected, /*Initial action is expected*/
|
||||
cmUnsupportedData,
|
||||
} CM_RETURN;
|
||||
|
||||
|
||||
|
@ -1730,8 +1730,8 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp
|
||||
break;
|
||||
case SM_AUTO_SLICE:
|
||||
iMaxSliceCount = MAX_SLICES_NUM;
|
||||
pDlp->sSliceCfg.sSliceArgument.uiSliceNum = kiCpuCores;
|
||||
if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceCount){
|
||||
pDlp->sSliceCfg.sSliceArgument.uiSliceNum = kiCpuCores;
|
||||
if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceCount){
|
||||
pDlp->sSliceCfg.sSliceArgument.uiSliceNum = iMaxSliceCount;
|
||||
}
|
||||
if (pDlp->sSliceCfg.sSliceArgument.uiSliceNum == 1) {
|
||||
|
@ -508,11 +508,28 @@ int32_t CWelsH264SVCEncoder::RawData2SrcPic (const uint8_t* pSrc) {
|
||||
*/
|
||||
int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSInfo* pBsInfo) {
|
||||
if (! (kpSrcPic && m_pEncContext && m_bInitialFlag)) {
|
||||
return videoFrameTypeInvalid;
|
||||
return cmInitParaError;
|
||||
}
|
||||
|
||||
const int32_t kiEncoderReturn = EncodeFrameInternal(kpSrcPic, pBsInfo);
|
||||
|
||||
switch (kiEncoderReturn) {
|
||||
case ENC_RETURN_MEMALLOCERR:
|
||||
WelsUninitEncoderExt (&m_pEncContext);
|
||||
return cmMallocMemeError;
|
||||
case ENC_RETURN_SUCCESS:
|
||||
case ENC_RETURN_CORRECTED:
|
||||
break;//continue processing
|
||||
case ENC_RETURN_UNSUPPORTED_PARA:
|
||||
return cmUnsupportedData;
|
||||
break;
|
||||
case ENC_RETURN_UNEXPECTED:
|
||||
return cmUnkonwReason;
|
||||
default:
|
||||
WelsLog (m_pEncContext, WELS_LOG_ERROR, "unexpected return(%d) from WelsEncoderEncodeExt()!\n", kiEncoderReturn);
|
||||
return cmUnkonwReason;
|
||||
}
|
||||
|
||||
int32_t uiFrameType = videoFrameTypeInvalid;
|
||||
uiFrameType = EncodeFrameInternal(kpSrcPic, pBsInfo);
|
||||
|
||||
#ifdef REC_FRAME_COUNT
|
||||
++ m_uiCountFrameNum;
|
||||
@ -524,7 +541,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture* kpSrcPic, SFrameBSIn
|
||||
DumpSrcPicture (pSrc);
|
||||
#endif // DUMP_SRC_PICTURE
|
||||
|
||||
return uiFrameType;
|
||||
return cmResultSuccess;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user