MCPcopy Create free account
hub / github.com/cisco/openh264 / WelsUninitEncoderExt

Function WelsUninitEncoderExt

codec/encoder/core/src/encoder_ext.cpp:2239–2275  ·  view source on GitHub ↗

! * \brief uninitialize Wels encoder core library * \pParam pEncCtx sWelsEncCtx* * \return none */

Source from the content-addressed store, hash-verified

2237 * \return none
2238 */
2239void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) {
2240 if (NULL == ppCtx || NULL == *ppCtx)
2241 return;
2242
2243 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO,
2244 "WelsUninitEncoderExt(), pCtx= %p, iMultipleThreadIdc= %d.",
2245 (void*) (*ppCtx), (*ppCtx)->pSvcParam->iMultipleThreadIdc);
2246
2247#if defined(STAT_OUTPUT)
2248 StatOverallEncodingExt (*ppCtx);
2249#endif
2250
2251 if ((*ppCtx)->pSvcParam->iMultipleThreadIdc > 1 && (*ppCtx)->pSliceThreading != NULL) {
2252 const int32_t iThreadCount = (*ppCtx)->pSvcParam->iMultipleThreadIdc;
2253 int32_t iThreadIdx = 0;
2254
2255 while (iThreadIdx < iThreadCount) {
2256 int res = 0;
2257 if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) {
2258
2259 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit
2260 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..",
2261 iThreadIdx,
2262 res);
2263 (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0;
2264 }
2265 ++ iThreadIdx;
2266 }
2267 }
2268
2269 if ((*ppCtx)->pVpp) {
2270 (*ppCtx)->pVpp->FreeSpatialPictures (*ppCtx);
2271 WELS_DELETE_OP ((*ppCtx)->pVpp);
2272 }
2273 FreeMemorySvc (ppCtx);
2274 *ppCtx = NULL;
2275}
2276
2277/*!
2278 * \brief initialize Wels avc encoder core library

Callers 4

UninitializeMethod · 0.85
EncodeFrameInternalMethod · 0.85
WelsInitEncoderExtFunction · 0.85
WelsEncoderParamAdjustFunction · 0.85

Calls 5

WelsLogFunction · 0.85
StatOverallEncodingExtFunction · 0.85
WelsThreadJoinFunction · 0.85
FreeMemorySvcFunction · 0.85
FreeSpatialPicturesMethod · 0.80

Tested by

no test coverage detected