! * \brief uninitialize Wels encoder core library * \pParam pEncCtx sWelsEncCtx* * \return none */
| 2237 | * \return none |
| 2238 | */ |
| 2239 | void 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 |
no test coverage detected