/* * Close codec. */ static pj_status_t openh264_codec_close( pjmedia_vid_codec *codec ) { openh264_private *ff; pj_mutex_t *ff_mutex; PJ_ASSERT_RETURN(codec, PJ_EINVAL); ff = (openh264_private*)codec->codec_data; ff_mutex = ((struct openh264_factory*)codec->factory)->mutex; pj_mutex_lock(ff_mutex); if ((ff->enc != NULL) && (ff->param.dir & PJMEDIA_DIR_ENCODING)) { DestroySVCEncoder(ff->enc); ff->enc = NULL; } if ((ff->dec != NULL) && (ff->param.dir & PJMEDIA_DIR_DECODING)) { DestroyDecoder(ff->dec); ff->dec = NULL; } if (ff->srcPic != NULL) { free(ff->srcPic); ff->srcPic = NULL; } pj_mutex_unlock(ff_mutex); return PJ_SUCCESS; }
JNIEXPORT void JNICALL Java_co_splots_recorder_H264Encoder_release(JNIEnv* env, jobject thiz) { if (encoder) { (*encoder)->Uninitialize(encoder); DestroySVCEncoder(encoder); } if (outfile != NULL) fclose(outfile); }
virtual void TearDown() { if (encoder_) { encoder_->Uninitialize(); DestroySVCEncoder(encoder_); } }
WebrtcOpenH264VideoEncoder::~WebrtcOpenH264VideoEncoder() { if (encoder_) { DestroySVCEncoder(encoder_); } }