Rename public interface methods to avoid two overloaded methods with the same name

This is required to make the order in the C++ virtual table
consistent in MSVC - previously the overloaded methods were
ordered differently in the vtable compared to the interface
declaration.
This commit is contained in:
Martin Storsjö 2014-01-21 20:37:03 +02:00
parent efaa153bb1
commit dd0db820fc
8 changed files with 17 additions and 17 deletions

View File

@ -42,7 +42,7 @@ class ISVCEncoder {
* return: CM_RETURN: 0 - success; otherwise - failed;
*/
virtual int Initialize (SVCEncodingParam* pParam, const INIT_TYPE kiInitType = INIT_TYPE_PARAMETER_BASED) = 0;
virtual int Initialize (void* pParam, const INIT_TYPE kiInitType = INIT_TYPE_CONFIG_BASED) = 0;
virtual int Initialize2 (void* pParam, const INIT_TYPE kiInitType = INIT_TYPE_CONFIG_BASED) = 0;
virtual int Uninitialize() = 0;
@ -50,7 +50,7 @@ class ISVCEncoder {
* return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid]
*/
virtual int EncodeFrame (const unsigned char* kpSrc, SFrameBSInfo* pBsInfo) = 0;
virtual int EncodeFrame (const SSourcePicture** kppSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) = 0;
virtual int EncodeFrame2 (const SSourcePicture** kppSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) = 0;
/*
* return: 0 - success; otherwise - failed;
@ -92,7 +92,7 @@ class ISVCDecoder {
/*
* src must be 4 byte aligned, recommend 16 byte aligned. the available src size must be multiple of 4.
*/
virtual DECODING_STATE DecodeFrame (const unsigned char* pSrc,
virtual DECODING_STATE DecodeFrame2 (const unsigned char* pSrc,
const int iSrcLen,
void** ppDst,
SBufferInfo* pDstInfo) = 0;

View File

@ -217,7 +217,7 @@ void_t H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, co
pData[2] = NULL;
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
pDecoder->DecodeFrame (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
pDecoder->DecodeFrame2 (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
if (sDstBufInfo.iBufferStatus == 1) {
pDst[0] = (uint8_t*)pData[0];
@ -259,7 +259,7 @@ void_t H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, co
pData[2] = NULL;
memset (&sDstBufInfo, 0, sizeof (SBufferInfo));
pDecoder->DecodeFrame (NULL, 0, pData, &sDstBufInfo);
pDecoder->DecodeFrame2 (NULL, 0, pData, &sDstBufInfo);
if (sDstBufInfo.iBufferStatus == 1) {
pDst[0] = (uint8_t*)pData[0];
pDst[1] = (uint8_t*)pData[1];

View File

@ -964,7 +964,7 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iFrameHeight =
WELS_ALIGN(sSvcParam.sDependencyLayers[sSvcParam.iNumDependencyLayer - 1].iActualHeight, MB_HEIGHT_LUMA);
if (cmResultSuccess != pPtrEnc->Initialize ((void*)&sSvcParam, INIT_TYPE_CONFIG_BASED)) { // SVC encoder initialization
if (cmResultSuccess != pPtrEnc->Initialize2 ((void*)&sSvcParam, INIT_TYPE_CONFIG_BASED)) { // SVC encoder initialization
fprintf (stderr, "SVC encoder Initialize failed\n");
iRet = 1;
goto INSIDE_MEM_FREE;
@ -1094,7 +1094,7 @@ int ProcessEncodingSvcWithConfig (ISVCEncoder* pPtrEnc, int argc, char** argv) {
// To encoder this frame
iStart = WelsTime();
int iEncFrames = pPtrEnc->EncodeFrame (const_cast<const SSourcePicture**> (pSrcPicList), nSpatialLayerNum, &sFbi);
int iEncFrames = pPtrEnc->EncodeFrame2 (const_cast<const SSourcePicture**> (pSrcPicList), nSpatialLayerNum, &sFbi);
iTotal += WelsTime() - iStart;
// fixed issue in case dismatch source picture introduced by frame skipped, 1/12/2010

View File

@ -81,7 +81,7 @@ virtual DECODING_STATE DecodeFrame (const unsigned char* kpSrc,
int& iWidth,
int& iHeight);
virtual DECODING_STATE DecodeFrame (const unsigned char* kpSrc,
virtual DECODING_STATE DecodeFrame2 (const unsigned char* kpSrc,
const int kiSrcLen,
void_t** ppDst,
SBufferInfo* pDstInfo);

View File

@ -340,7 +340,7 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void_t* pOption) {
return cmInitParaError;
}
DECODING_STATE CWelsDecoder::DecodeFrame (const unsigned char* kpSrc,
DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc,
const int kiSrcLen,
void_t** ppDst,
SBufferInfo* pDstInfo) {
@ -430,7 +430,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame (const unsigned char* kpSrc,
DstInfo.UsrData.sSystemBuffer.iHeight = iHeight;
DstInfo.eBufferProperty = BUFFER_HOST;
eDecState = DecodeFrame (kpSrc, kiSrcLen, (void_t**)ppDst, &DstInfo);
eDecState = DecodeFrame2 (kpSrc, kiSrcLen, (void_t**)ppDst, &DstInfo);
if (eDecState == dsErrorFree) {
pStride[0] = DstInfo.UsrData.sSystemBuffer.iStride[0];
pStride[1] = DstInfo.UsrData.sSystemBuffer.iStride[1];

View File

@ -66,7 +66,7 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
* return: CM_RETURN: 0 - success; otherwise - failed;
*/
virtual int Initialize (SVCEncodingParam* argv, const INIT_TYPE init_type);
virtual int Initialize (void* argv, const INIT_TYPE init_type);
virtual int Initialize2 (void* argv, const INIT_TYPE init_type);
virtual int Uninitialize();
@ -74,7 +74,7 @@ class CWelsH264SVCEncoder : public ISVCEncoder {
* return: EVideoFrameType [IDR: videoFrameTypeIDR; P: videoFrameTypeP; ERROR: videoFrameTypeInvalid]
*/
virtual int EncodeFrame (const unsigned char* kpSrc, SFrameBSInfo* pBsInfo);
virtual int EncodeFrame (const SSourcePicture** kppSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo);
virtual int EncodeFrame2 (const SSourcePicture** kppSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo);
/*
* return: 0 - success; otherwise - failed;

View File

@ -353,10 +353,10 @@ int CWelsH264SVCEncoder::Initialize (SVCEncodingParam* argv, const INIT_TYPE iIn
m_iSrcListSize = 1;
return Initialize ((void*)&sConfig, INIT_TYPE_CONFIG_BASED);
return Initialize2 ((void*)&sConfig, INIT_TYPE_CONFIG_BASED);
}
int CWelsH264SVCEncoder::Initialize (void* argv, const INIT_TYPE iInitType) {
int CWelsH264SVCEncoder::Initialize2 (void* argv, const INIT_TYPE iInitType) {
if (INIT_TYPE_CONFIG_BASED != iInitType || NULL == argv) {
WelsLog (m_pEncContext, WELS_LOG_ERROR, "CWelsH264SVCEncoder::Initialize(), invalid iInitType= %d, argv= 0x%p.\n",
iInitType, (void*)argv);
@ -602,7 +602,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const unsigned char* pSrc, SFrameBSInfo* p
int32_t uiFrameType = videoFrameTypeInvalid;
if (RawData2SrcPic ((uint8_t*)pSrc) == 0) {
uiFrameType = EncodeFrame (const_cast<const SSourcePicture**> (m_pSrcPicList), 1, pBsInfo);
uiFrameType = EncodeFrame2 (const_cast<const SSourcePicture**> (m_pSrcPicList), 1, pBsInfo);
}
#ifdef REC_FRAME_COUNT
@ -619,7 +619,7 @@ int CWelsH264SVCEncoder::EncodeFrame (const unsigned char* pSrc, SFrameBSInfo* p
}
int CWelsH264SVCEncoder::EncodeFrame (const SSourcePicture** pSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) {
int CWelsH264SVCEncoder::EncodeFrame2 (const SSourcePicture** pSrcPicList, int nSrcPicNum, SFrameBSInfo* pBsInfo) {
if (! (pSrcPicList && m_pEncContext && m_bInitialFlag)) {
return videoFrameTypeInvalid;
}

View File

@ -67,7 +67,7 @@ static bool DecodeAndProcess(ISVCDecoder* decoder, const uint8_t* src,
memset(data, 0, sizeof(data));
memset(&bufInfo, 0, sizeof(SBufferInfo));
DECODING_STATE rv = decoder->DecodeFrame(src, sliceSize, data, &bufInfo);
DECODING_STATE rv = decoder->DecodeFrame2(src, sliceSize, data, &bufInfo);
if (rv != dsErrorFree) {
return false;
}