ortp分析之二 主要结构体 (未完)

本文详细分析了ORTP库的主要结构体,包括_RtpProfile、rtp_stats和_RtpScheduler,以及RtpSession的创建过程。RtpProfile用于负载类型匹配,rtp_stats用于全局统计RTP数据,RtpScheduler管理会话调度,RtpSession作为实际编程中操作的核心对象,包含了会话所需的各类信息和接口。
摘要由CSDN通过智能技术生成

头文件分析

从例子源码rtpsend.c看,主要的初始话步骤是:

         ortp_init();

         ortp_scheduler_init();

         session=rtp_session_new(RTP_SESSION_SENDONLY); 

这三步中涉及到了主要的结构体,具体如下:

1.1 ortp_init()涉及_RtpProfilertp_stats

void ortp_init()

{

         static bool_t initialized=FALSE;

         if (initialized) return;

         initialized=TRUE;

 

#ifdef WIN32

         win32_init_sockets();

#endif

 

         av_profile_init(&av_profile);

         ortp_global_stats_reset();//重置rtp_stats结构

         init_random_number_generator();

         ortp_message("oRTP-" ORTP_VERSION " initialized.");

}

 

主要涉及结构体:RtpProfile av_profile; RtpProfilepayloadtype.h

/**

 * The RTP profile is a table RTP_PROFILE_MAX_PAYLOADS entries to make the matching

 * between RTP payload type number and the PayloadType that defines the type of

 * media.

**/

/*这个结构是用于将RTP负载类型数字与具体的负载类型定义关联

例如,  

 rtp_profile_set_payload(&av_profile, 96, &payload_type_h264);

rtp_session_set_payload_type(session, 96);

就是将96h264关联起来

*/

struct _RtpProfile

{

         char *name;

         PayloadType *payload[RTP_PROFILE_MAX_PAYLOADS];

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值