extern "C" __declspec(dllexport) void closeEncoder(IntelEncoderHandle *pHandle) { MFXVideoENCODE_Close(pHandle->session); for (int i = 0; i < pHandle->nEncSurfNum; i++) free(pHandle->ppEncSurfaces); free(pHandle->pSurfaceBuffers); free(pHandle->ppEncSurfaces); free(pHandle); }
int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q) { QSVFrame *cur; MFXVideoENCODE_Close(q->session); if (q->internal_session) MFXClose(q->internal_session); q->session = NULL; q->internal_session = NULL; cur = q->work_frames; while (cur) { q->work_frames = cur->next; av_frame_free(&cur->frame); av_freep(&cur); cur = q->work_frames; } av_frame_free(&avctx->coded_frame); return 0; }