Init members
| 170 | |
| 171 | //Init members |
| 172 | int32_t DecoderParseSyntaxTest::Init() { |
| 173 | memset (&m_sBufferInfo, 0, sizeof (SBufferInfo)); |
| 174 | memset (&m_sDecParam, 0, sizeof (SDecodingParam)); |
| 175 | memset (&m_sParserBsInfo, 0, sizeof (SParserBsInfo)); |
| 176 | memset (&m_sDecoderSpsPpsCTX, 0, sizeof (SWelsDecoderSpsPpsCTX)); |
| 177 | memset (&m_sLastDecPicInfo, 0, sizeof (SWelsLastDecPicInfo)); |
| 178 | memset (&m_sDecoderStatistics, 0, sizeof (SDecoderStatistics)); |
| 179 | memset (&m_sVlcTable, 0, sizeof (SVlcTable)); |
| 180 | |
| 181 | m_sDecParam.pFileNameRestructed = NULL; |
| 182 | m_sDecParam.uiCpuLoad = rand() % 100; |
| 183 | m_sDecParam.uiTargetDqLayer = rand() % 100; |
| 184 | m_sDecParam.eEcActiveIdc = (ERROR_CON_IDC)7; |
| 185 | m_sDecParam.sVideoProperty.size = sizeof (SVideoProperty); |
| 186 | m_sDecParam.sVideoProperty.eVideoBsType = (VIDEO_BITSTREAM_TYPE) (rand() % 2); |
| 187 | m_sDecParam.bParseOnly = false; |
| 188 | |
| 189 | m_pData[0] = m_pData[1] = m_pData[2] = NULL; |
| 190 | m_szBuffer[0] = m_szBuffer[1] = m_szBuffer[2] = 0; |
| 191 | m_szBuffer[3] = 1; |
| 192 | m_iBufLength = 4; |
| 193 | // |
| 194 | m_pCtx = (PWelsDecoderContext)malloc (sizeof (SWelsDecoderContext)); |
| 195 | if (m_pCtx == NULL) |
| 196 | return ERR_MALLOC_FAILED; |
| 197 | memset (m_pCtx, 0, sizeof (SWelsDecoderContext)); |
| 198 | m_pWelsTrace = new welsCodecTrace(); |
| 199 | if (m_pWelsTrace != NULL) { |
| 200 | m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR); |
| 201 | } else { |
| 202 | free (m_pCtx); |
| 203 | m_pCtx = NULL; |
| 204 | return ERR_MALLOC_FAILED; |
| 205 | } |
| 206 | m_pCtx->pLastDecPicInfo = &m_sLastDecPicInfo; |
| 207 | m_pCtx->pDecoderStatistics = &m_sDecoderStatistics; |
| 208 | m_pCtx->pVlcTable = &m_sVlcTable; |
| 209 | WelsDecoderSpsPpsDefaults (m_pCtx->sSpsPpsCtx); |
| 210 | CM_RETURN eRet = (CM_RETURN)Initialize (&m_sDecParam, m_pCtx, &m_pWelsTrace->m_sLogCtx); |
| 211 | return (int32_t)eRet; |
| 212 | } |
| 213 | |
| 214 | void DecoderParseSyntaxTest::Uninit() { |
| 215 | if (m_pCtx) { |
nothing calls this directly
no test coverage detected