static int processing_state_destructor(struct mgcp_process_rtp_state *state) { switch (state->src_fmt) { case AF_GSM: if (state->src.gsm_handle) gsm_destroy(state->src.gsm_handle); break; #ifdef HAVE_BCG729 case AF_G729: if (state->src.g729_dec) closeBcg729DecoderChannel(state->src.g729_dec); break; #endif default: break; } switch (state->dst_fmt) { case AF_GSM: if (state->dst.gsm_handle) gsm_destroy(state->dst.gsm_handle); break; #ifdef HAVE_BCG729 case AF_G729: if (state->dst.g729_enc) closeBcg729EncoderChannel(state->dst.g729_enc); break; #endif default: break; } return 0; }
static void codec_drv_stop(ErlDrvData handle) { codec_data *d = (codec_data *) handle; closeBcg729EncoderChannel(d->estate); closeBcg729DecoderChannel(d->dstate); driver_free((char*)handle); }
static switch_status_t switch_bcg729_destroy(switch_codec_t *codec) { struct bcg729_context *context = codec->private_info; closeBcg729EncoderChannel(context->encoder_object); closeBcg729DecoderChannel(context->decoder_object); codec->private_info = NULL; return SWITCH_STATUS_SUCCESS; }