Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 8 files). Show all
Unified · Split
| @@ -134,7 +134,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 133 unmodified lines | |||
| 134 | 134 | ||
| 135 | pCtx->pArgDec = NULL; | 135 | pCtx->pArgDec = NULL; |
| 136 | 136 | ||
| 137 | pCtx->iOutputColorFormat = videoFormatI420; // yuv in default | 137 | pCtx->eOutputColorFormat = videoFormatI420; // yuv in default |
| 138 | pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related | 138 | pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related |
| 139 | pCtx->uiCpuFlag = 0; | 139 | pCtx->uiCpuFlag = 0; |
| 140 | 140 | ||
| @@ -331,7 +331,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 190 unmodified lines | |||
| 331 | return 1; | 331 | return 1; |
| 332 | 332 | ||
| 333 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); | 333 | memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam)); |
| 334 | pCtx->iOutputColorFormat = pCtx->pParam->iOutputColorFormat; | 334 | pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat; |
| 335 | pCtx->eErrorConMethod = pCtx->pParam->eEcActiveIdc; | 335 | pCtx->eErrorConMethod = pCtx->pParam->eEcActiveIdc; |
| 336 | 336 | ||
| 337 | if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType || | 337 | if (VIDEO_BITSTREAM_SVC == pCtx->pParam->sVideoProperty.eVideoBsType || |
| @@ -589,9 +589,15 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in · 251 unmodified lines | |||
| 589 | int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) { | 589 | int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) { |
| 590 | WELS_VERIFY_RETURN_IF (1, (NULL == pCtx)); | 590 | WELS_VERIFY_RETURN_IF (1, (NULL == pCtx)); |
| 591 | 591 | ||
| 592 | pCtx->iOutputColorFormat = kiColorFormat; | 592 | pCtx->eOutputColorFormat = (EVideoFormatType) kiColorFormat; |
| 593 | if (pCtx->pParam != NULL) { | 593 | if (pCtx->pParam != NULL) { |
| 594 | pCtx->pParam->iOutputColorFormat = kiColorFormat; | 594 | pCtx->pParam->eOutputColorFormat = (EVideoFormatType) kiColorFormat; |
| 595 | } | ||
| 596 | |||
| 597 | //For now, support only videoFormatI420! | ||
| 598 | if (kiColorFormat != (int32_t) videoFormatI420) { | ||
| 599 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "Support I420 output only for now! Change to I420...\n"); | ||
| 600 | pCtx->pParam->eOutputColorFormat = pCtx->eOutputColorFormat = videoFormatI420; | ||
| 595 | } | 601 | } |
| 596 | 602 | ||
| 597 | return 0; | 603 | return 0; |