Beispiel #1
0
srtpw_err_status_t srtpw_srtp_init()
{
    if (g_init_done)
    {
        return -1;
    }
    if (srtp_init() != err_status_ok)
    {
        return -1;
    }
    srtp_install_event_handler(srtpw_srtp_event_cb);
    srtpw_log(err_level_info, "srtpw_srtp_init from srtp_wrapper");
    g_init_done =1;
    return err_status_ok;
}
Beispiel #2
0
nsresult SrtpFlow::Init() {
  if (!initialized) {
    srtp_err_status_t r = srtp_init();
    if (r != srtp_err_status_ok) {
      CSFLogError(LOGTAG, "Could not initialize SRTP");
      MOZ_ASSERT(PR_FALSE);
      return NS_ERROR_FAILURE;
    }

    r = srtp_install_event_handler(&SrtpFlow::srtp_event_handler);
    if (r != srtp_err_status_ok) {
      CSFLogError(LOGTAG, "Could not install SRTP event handler");
      MOZ_ASSERT(PR_FALSE);
      return NS_ERROR_FAILURE;
    }

    initialized = true;
  }

  return NS_OK;
}