add new API as DecodeFrameNoDelay for immediate decoding
Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 6 files). Show all
Unified · Split
| @@ -394,6 +394,22 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 393 unmodified lines | ||
| 394 | 394 | return cmInitParaError; |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | +DECODING_STATE CWelsDecoder::DecodeFrameNoDelay (const unsigned char* kpSrc, | |
| 398 | + const int kiSrcLen, | |
| 399 | + unsigned char** ppDst, | |
| 400 | + SBufferInfo* pDstInfo) { | |
| 401 | + int iRet; | |
| 402 | + SBufferInfo sTmpBufferInfo; | |
| 403 | + iRet = (int) DecodeFrame2 (kpSrc, kiSrcLen, ppDst, pDstInfo); | |
| 404 | + memcpy (&sTmpBufferInfo, pDstInfo, sizeof (SBufferInfo)); | |
| 405 | + iRet |= DecodeFrame2 (NULL, 0, ppDst, pDstInfo); | |
| 406 | + if ((pDstInfo->iBufferStatus == 0) && (sTmpBufferInfo.iBufferStatus == 1)) { | |
| 407 | + memcpy (pDstInfo, &sTmpBufferInfo, sizeof (SBufferInfo)); | |
| 408 | + } | |
| 409 | + | |
| 410 | + return (DECODING_STATE) iRet; | |
| 411 | +} | |
| 412 | + | |
| 397 | 413 | DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, |
| 398 | 414 | const int kiSrcLen, |
| 399 | 415 | unsigned char** ppDst, |