Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 25 files). Show all
Unified · Split
| @@ -86,7 +86,7 @@ namespace WelsDec { · 85 unmodified lines | |||
| 86 | ***************************************************************************/ | 86 | ***************************************************************************/ |
| 87 | CWelsDecoder::CWelsDecoder (void) | 87 | CWelsDecoder::CWelsDecoder (void) |
| 88 | : m_pDecContext (NULL), | 88 | : m_pDecContext (NULL), |
| 89 | m_pTrace (NULL) { | 89 | m_pWelsTrace (NULL) { |
| 90 | #ifdef OUTPUT_BIT_STREAM | 90 | #ifdef OUTPUT_BIT_STREAM |
| 91 | char chFileName[1024] = { 0 }; //for .264 | 91 | char chFileName[1024] = { 0 }; //for .264 |
| 92 | int iBufUsed = 0; | 92 | int iBufUsed = 0; |
| @@ -99,9 +99,20 @@ CWelsDecoder::CWelsDecoder (void) · 6 unmodified lines | |||
| 99 | int iCurUsedSize; | 99 | int iCurUsedSize; |
| 100 | #endif//OUTPUT_BIT_STREAM | 100 | #endif//OUTPUT_BIT_STREAM |
| 101 | 101 | ||
| 102 | m_pTrace = CreateWelsTrace (Wels_Trace_Type); | ||
| 103 | 102 | ||
| 104 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry"); | 103 | m_pWelsTrace = new welsCodecTrace(); |
| 104 | if (m_pWelsTrace != NULL) { | ||
| 105 | const int32_t iWelsTraceExistingFlag = m_pWelsTrace->WelsTraceModuleIsExist(); | ||
| 106 | if (iWelsTraceExistingFlag) { | ||
| 107 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); | ||
| 108 | WelsSetLogCallback (welsCodecTrace::CODEC_TRACE); | ||
| 109 | } | ||
| 110 | } | ||
| 111 | |||
| 112 | // initialization | ||
| 113 | WelsSetLogLevel (WELS_LOG_ERROR); // no output, WELS_LOG_QUIET | ||
| 114 | |||
| 115 | WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::CWelsDecoder() entry"); | ||
| 105 | 116 | ||
| 106 | #ifdef OUTPUT_BIT_STREAM | 117 | #ifdef OUTPUT_BIT_STREAM |
| 107 | SWelsTime sCurTime; | 118 | SWelsTime sCurTime; |
| @@ -156,7 +167,7 @@ CWelsDecoder::CWelsDecoder (void) · 48 unmodified lines | |||
| 156 | * return: none | 167 | * return: none |
| 157 | ***************************************************************************/ | 168 | ***************************************************************************/ |
| 158 | CWelsDecoder::~CWelsDecoder() { | 169 | CWelsDecoder::~CWelsDecoder() { |
| 159 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()"); | 170 | WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::~CWelsDecoder()"); |
| 160 | 171 | ||
| 161 | UninitDecoder(); | 172 | UninitDecoder(); |
| 162 | 173 | ||
| @@ -171,15 +182,15 @@ CWelsDecoder::~CWelsDecoder() { · 8 unmodified lines | |||
| 171 | } | 182 | } |
| 172 | #endif//OUTPUT_BIT_STREAM | 183 | #endif//OUTPUT_BIT_STREAM |
| 173 | 184 | ||
| 174 | if (NULL != m_pTrace) { | 185 | if (m_pWelsTrace != NULL) { |
| 175 | delete m_pTrace; | 186 | delete m_pWelsTrace; |
| 176 | m_pTrace = NULL; | 187 | m_pWelsTrace = NULL; |
| 177 | } | 188 | } |
| 178 | } | 189 | } |
| 179 | 190 | ||
| 180 | long CWelsDecoder::Initialize (const SDecodingParam* pParam) { | 191 | long CWelsDecoder::Initialize (const SDecodingParam* pParam) { |
| 181 | if (pParam == NULL) { | 192 | if (pParam == NULL) { |
| 182 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument."); | 193 | WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::Initialize(), invalid input argument."); |
| 183 | return cmInitParaError; | 194 | return cmInitParaError; |
| 184 | } | 195 | } |
| 185 | 196 | ||
| @@ -201,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) { · 15 unmodified lines | |||
| 201 | if (NULL == m_pDecContext) | 212 | if (NULL == m_pDecContext) |
| 202 | return; | 213 | return; |
| 203 | 214 | ||
| 204 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder().."); | 215 | WelsLog (NULL, WELS_LOG_INFO, "into CWelsDecoder::uninit_decoder().."); |
| 205 | 216 | ||
| 206 | WelsEndDecoder (m_pDecContext); | 217 | WelsEndDecoder (m_pDecContext); |
| 207 | 218 | ||
| @@ -211,18 +222,19 @@ void CWelsDecoder::UninitDecoder (void) { · 3 unmodified lines | |||
| 211 | m_pDecContext = NULL; | 222 | m_pDecContext = NULL; |
| 212 | } | 223 | } |
| 213 | 224 | ||
| 214 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder().."); | 225 | WelsLog (NULL , WELS_LOG_INFO, "left CWelsDecoder::uninit_decoder().."); |
| 215 | } | 226 | } |
| 216 | 227 | ||
| 217 | // the return value of this function is not suitable, it need report failure info to upper layer. | 228 | // the return value of this function is not suitable, it need report failure info to upper layer. |
| 218 | void CWelsDecoder::InitDecoder (void) { | 229 | void CWelsDecoder::InitDecoder (void) { |
| 219 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::init_decoder().."); | 230 | |
| 231 | WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder().."); | ||
| 220 | 232 | ||
| 221 | m_pDecContext = (PWelsDecoderContext)WelsMalloc (sizeof (SWelsDecoderContext), "m_pDecContext"); | 233 | m_pDecContext = (PWelsDecoderContext)WelsMalloc (sizeof (SWelsDecoderContext), "m_pDecContext"); |
| 222 | 234 | ||
| 223 | WelsInitDecoder (m_pDecContext, m_pTrace, IWelsTrace::WelsTrace); | 235 | WelsInitDecoder (m_pDecContext); |
| 224 | 236 | ||
| 225 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left"); | 237 | WelsLog (NULL, WELS_LOG_INFO, "CWelsDecoder::init_decoder().. left"); |
| 226 | } | 238 | } |
| 227 | 239 | ||
| 228 | /* | 240 | /* |
| @@ -380,8 +392,8 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 151 unmodified lines | |||
| 380 | } | 392 | } |
| 381 | } | 393 | } |
| 382 | 394 | ||
| 383 | IWelsTrace::WelsVTrace (m_pTrace, IWelsTrace::WELS_LOG_INFO, "decode failed, failure type:%d \n", | 395 | WelsLog (NULL, WELS_LOG_INFO, "decode failed, failure type:%d \n", |
| 384 | m_pDecContext->iErrorCode); | 396 | m_pDecContext->iErrorCode); |
| 385 | return (DECODING_STATE)m_pDecContext->iErrorCode; | 397 | return (DECODING_STATE)m_pDecContext->iErrorCode; |
| 386 | } | 398 | } |
| 387 | 399 | ||