History

setget_dataformat_ut

huili2 committed 12 years ago

Commit e8fdd4c1 parent d0d68428 files · +57 −20Browse files

Showing the changes to codec/decoder (3 of 8 files). Show all

Unified · Split

3 files
  1. codec/decoder/core/inc/decoder_context.h +3 −3
  2. codec/decoder/core/src/decoder.cpp +10 −4
  3. codec/decoder/plus/src/welsDecoderExt.cpp +1 −1
codec/decoder/core/inc/decoder_context.h+3−3
@@ -168,13 +168,13 @@ SLogContext sLogCtx; · 167 unmodified lines
168168 // Input
169169 void* pArgDec; // structured arguments for decoder, reserved here for extension in the future
170170
171−SDataBuffer sRawData;
171+SDataBuffer sRawData;
172172
173173 // Configuration
174−SDecodingParam* pParam;
174+SDecodingParam* pParam;
175175 uint32_t uiCpuFlag; // CPU compatibility detected
176176
177−int32_t iOutputColorFormat; // color space format to be outputed
177+EVideoFormatType eOutputColorFormat; // color space format to be outputed
178178 VIDEO_BITSTREAM_TYPE eVideoType; //indicate the type of video to decide whether or not to do qp_delta error detection.
179179 bool bHaveGotMemory; // global memory for decoder context related ever requested?
180180
codec/decoder/core/src/decoder.cpp+10−4
@@ -134,7 +134,7 @@ void WelsDecoderDefaults (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 133 unmodified lines
134134
135135 pCtx->pArgDec = NULL;
136136
137− pCtx->iOutputColorFormat = videoFormatI420; // yuv in default
137+ pCtx->eOutputColorFormat = videoFormatI420; // yuv in default
138138 pCtx->bHaveGotMemory = false; // not ever request memory blocks for decoder context related
139139 pCtx->uiCpuFlag = 0;
140140
@@ -331,7 +331,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 190 unmodified lines
331331 return 1;
332332
333333 memcpy (pCtx->pParam, kpParam, sizeof (SDecodingParam));
334− pCtx->iOutputColorFormat = pCtx->pParam->iOutputColorFormat;
334+ pCtx->eOutputColorFormat = pCtx->pParam->eOutputColorFormat;
335335 pCtx->eErrorConMethod = pCtx->pParam->eEcActiveIdc;
336336
337337 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
589589 int32_t DecoderSetCsp (PWelsDecoderContext pCtx, const int32_t kiColorFormat) {
590590 WELS_VERIFY_RETURN_IF (1, (NULL == pCtx));
591591
592− pCtx->iOutputColorFormat = kiColorFormat;
592+ pCtx->eOutputColorFormat = (EVideoFormatType) kiColorFormat;
593593 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;
595601 }
596602
597603 return 0;
codec/decoder/plus/src/welsDecoderExt.cpp+1−1
@@ -304,7 +304,7 @@ long CWelsDecoder::GetOption (DECODER_OPTION eOptID, void* pOption) { · 303 unmodified lines
304304 return cmInitParaError;
305305
306306 if (DECODER_OPTION_DATAFORMAT == eOptID) {
307− iVal = m_pDecContext->iOutputColorFormat;
307+ iVal = (int32_t) m_pDecContext->eOutputColorFormat;
308308 * ((int*)pOption) = iVal;
309309 return cmResultSuccess;
310310 } else if (DECODER_OPTION_END_OF_STREAM == eOptID) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t