ortp代码简析

ortp初始化

/**
 *    Initialize the oRTP library. You should call this function first before using
 *    oRTP API.
**/
void
ortp_init() { if (ortp_initialized++) return;  //全局初始化标志 #ifdef _WIN32 win32_init_sockets();   //初始化socket #endif av_profile_init(&av_profile);    //注册所需的payload类型 ortp_global_stats_reset();     init_random_number_generator(); ortp_message("oRTP-" ORTP_VERSION " initialized."); }

ortp退出

/**
 * Gracefully uninitialize the library, including shutdowning the scheduler if it was started.
 *
**/
void ortp_exit()
{
    if (ortp_initialized==0) {
        ortp_warning("ortp_exit() called without prior call to ortp_init(), ignored.");
        return;
    }
    ortp_initialized--;
    if (ortp_initialized==0){
        if (__ortp_scheduler!=NULL)
        {
            rtp_scheduler_destroy(__ortp_scheduler);
            __ortp_scheduler=NULL;
        }
    }
}

外部调用ortp初始化

int init_rtpservice()
{
    ortp_set_log_level_mask(ORTP_MESSAGE|ORTP_WARNING|ORTP_ERROR|ORTP_FATAL);
    ortp_set_log_handler(__logv_out);        //orpt LOG, 设置orpt日志
    ortp_init();
    return RESULT_SUCCESS;
}

外部调用ortp反初始化

int uninit_rtpservice()
{
    rtp_profile_clear_all(p_RtpProfile);
    rtp_profile_destroy(p_RtpProfile);
    ortp_exit();
return RESULT_SUCCESS; }

 

转载于:https://www.cnblogs.com/samaritan/p/5025506.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值