Merge pull request #884 from huili2/API_dec_modify_master

modify dec API from void to explicit type
This commit is contained in:
HaiboZhu 2014-05-22 16:21:09 +08:00
commit 3b78290cd3
6 changed files with 19 additions and 19 deletions

View File

@ -109,7 +109,7 @@ class ISVCDecoder {
*/
virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* pSrc,
const int iSrcLen,
void** ppDst,
unsigned char** ppDst,
SBufferInfo* pDstInfo) = 0;
/*
@ -174,7 +174,7 @@ DECODING_STATE (*DecodeFrame) (ISVCDecoder*, const unsigned char* pSrc,
DECODING_STATE (*DecodeFrame2) (ISVCDecoder*, const unsigned char* pSrc,
const int iSrcLen,
void** ppDst,
unsigned char** ppDst,
SBufferInfo* pDstInfo);
DECODING_STATE (*DecodeFrameEx) (ISVCDecoder*, const unsigned char* pSrc,

View File

@ -76,7 +76,7 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
uint8_t* pBuf = NULL;
uint8_t uiStartCode[4] = {0, 0, 0, 1};
void* pData[3] = {NULL};
uint8_t* pData[3] = {NULL};
uint8_t* pDst[3] = {NULL};
SBufferInfo sDstBufInfo;
@ -212,9 +212,9 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
pDecoder->DecodeFrame2 (pBuf + iBufPos, iSliceSize, pData, &sDstBufInfo);
if (sDstBufInfo.iBufferStatus == 1) {
pDst[0] = (uint8_t*)pData[0];
pDst[1] = (uint8_t*)pData[1];
pDst[2] = (uint8_t*)pData[2];
pDst[0] = pData[0];
pDst[1] = pData[1];
pDst[2] = pData[2];
}
iEnd = WelsTime();
iTotal += iEnd - iStart;
@ -247,9 +247,9 @@ void H264DecodeInstance (ISVCDecoder* pDecoder, const char* kpH264FileName, cons
pDecoder->DecodeFrame2 (NULL, 0, pData, &sDstBufInfo);
if (sDstBufInfo.iBufferStatus == 1) {
pDst[0] = (uint8_t*)pData[0];
pDst[1] = (uint8_t*)pData[1];
pDst[2] = (uint8_t*)pData[2];
pDst[0] = pData[0];
pDst[1] = pData[1];
pDst[2] = pData[2];
}
if (sDstBufInfo.iBufferStatus == 1) {

View File

@ -64,7 +64,7 @@ class CWelsDecoder : public ISVCDecoder {
/***************************************************************************
* Description:
* Decompress one frame, and output RGB24 or YV12 decoded stream and its length.
* Decompress one frame, and output I420 or RGB24(in the future) decoded stream and its length.
* Input parameters:
* Parameter TYPE Description
* pSrc unsigned char* the h264 stream to decode
@ -83,7 +83,7 @@ class CWelsDecoder : public ISVCDecoder {
virtual DECODING_STATE EXTAPI DecodeFrame2 (const unsigned char* kpSrc,
const int kiSrcLen,
void** ppDst,
unsigned char** ppDst,
SBufferInfo* pDstInfo);
virtual DECODING_STATE EXTAPI DecodeFrameEx (const unsigned char* kpSrc,
const int kiSrcLen,

View File

@ -320,7 +320,7 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) {
DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc,
const int kiSrcLen,
void** ppDst,
unsigned char** ppDst,
SBufferInfo* pDstInfo) {
if (kiSrcLen > MAX_ACCESS_UNIT_CAPACITY - MAX_MACROBLOCK_CAPACITY) {//prevent from residual reading overflow
m_pDecContext->iErrorCode |= dsOutOfMemory;
@ -361,7 +361,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc,
m_pDecContext->iFeedbackTidInAu = -1; //initialize
WelsDecodeBs (m_pDecContext, kpSrc, kiSrcLen, (unsigned char**)ppDst,
WelsDecodeBs (m_pDecContext, kpSrc, kiSrcLen, ppDst,
pDstInfo); //iErrorCode has been modified in this function
if (m_pDecContext->iErrorCode) {
@ -406,7 +406,7 @@ DECODING_STATE CWelsDecoder::DecodeFrame (const unsigned char* kpSrc,
DstInfo.UsrData.sSystemBuffer.iWidth = iWidth;
DstInfo.UsrData.sSystemBuffer.iHeight = iHeight;
eDecState = DecodeFrame2 (kpSrc, kiSrcLen, (void**)ppDst, &DstInfo);
eDecState = DecodeFrame2 (kpSrc, kiSrcLen, ppDst, &DstInfo);
if (eDecState == dsErrorFree) {
pStride[0] = DstInfo.UsrData.sSystemBuffer.iStride[0];
pStride[1] = DstInfo.UsrData.sSystemBuffer.iStride[1];

View File

@ -71,7 +71,7 @@ void BaseDecoderTest::TearDown() {
void BaseDecoderTest::DecodeFrame(const uint8_t* src, int sliceSize, Callback* cbk) {
void* data[3];
uint8_t* data[3];
SBufferInfo bufInfo;
memset(data, 0, sizeof(data));
memset(&bufInfo, 0, sizeof(SBufferInfo));
@ -82,19 +82,19 @@ void BaseDecoderTest::DecodeFrame(const uint8_t* src, int sliceSize, Callback* c
if (bufInfo.iBufferStatus == 1 && cbk != NULL) {
const Frame frame = {
{ // y plane
static_cast<uint8_t*>(data[0]),
data[0],
bufInfo.UsrData.sSystemBuffer.iWidth,
bufInfo.UsrData.sSystemBuffer.iHeight,
bufInfo.UsrData.sSystemBuffer.iStride[0]
},
{ // u plane
static_cast<uint8_t*>(data[1]),
data[1],
bufInfo.UsrData.sSystemBuffer.iWidth / 2,
bufInfo.UsrData.sSystemBuffer.iHeight / 2,
bufInfo.UsrData.sSystemBuffer.iStride[1]
},
{ // v plane
static_cast<uint8_t*>(data[2]),
data[2],
bufInfo.UsrData.sSystemBuffer.iWidth / 2,
bufInfo.UsrData.sSystemBuffer.iHeight / 2,
bufInfo.UsrData.sSystemBuffer.iStride[1]

View File

@ -83,7 +83,7 @@ struct SVCDecoderImpl : public ISVCDecoder {
return static_cast<DECODING_STATE>(3);
}
virtual DECODING_STATE EXTAPI DecodeFrame2(const unsigned char* pSrc,
const int iSrcLen, void** ppDst, SBufferInfo* pDstInfo) {
const int iSrcLen, unsigned char** ppDst, SBufferInfo* pDstInfo) {
EXPECT_TRUE(gThis == this);
return static_cast<DECODING_STATE>(4);
}