Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
4dda1b7b
提交
4dda1b7b
authored
4月 10, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1108
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
e28a9ee8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
32 行增加
和
14 行删除
+32
-14
switch_rtp.h
src/include/switch_rtp.h
+4
-3
mod_dingaling.c
src/mod/endpoints/mod_dingaling/mod_dingaling.c
+9
-2
mod_exosip.c
src/mod/endpoints/mod_exosip/mod_exosip.c
+6
-3
switch_rtp.c
src/switch_rtp.c
+13
-6
没有找到文件。
src/include/switch_rtp.h
浏览文件 @
4dda1b7b
...
...
@@ -202,22 +202,23 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, swit
\brief Read data from a given RTP session
\param rtp_session the RTP session to read from
\param data the data to read
\param datalen
the length of the data
\param datalen
a pointer to the datalen
\param payload_type the IANA payload of the packet
\param flags flags
\return the number of bytes read
*/
SWITCH_DECLARE
(
int
)
switch_rtp_read
(
switch_rtp
*
rtp_session
,
void
*
data
,
uint32_t
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
);
SWITCH_DECLARE
(
switch_status
)
switch_rtp_read
(
switch_rtp
*
rtp_session
,
void
*
data
,
uint32_t
*
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
);
/*!
\brief Read data from a given RTP session without copying
\param rtp_session the RTP session to read from
\param data a pointer to point directly to the RTP read buffer
\param datalen a pointer to the datalen
\param payload_type the IANA payload of the packet
\param flags flags
\return the number of bytes read
*/
SWITCH_DECLARE
(
int
)
switch_rtp_zerocopy_read
(
switch_rtp
*
rtp_session
,
void
**
data
,
int
*
payload_type
,
switch_frame_flag
*
flags
);
SWITCH_DECLARE
(
switch_status
)
switch_rtp_zerocopy_read
(
switch_rtp
*
rtp_session
,
void
**
data
,
uint32_t
*
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
);
/*!
\brief Write data to a given RTP session
...
...
src/mod/endpoints/mod_dingaling/mod_dingaling.c
浏览文件 @
4dda1b7b
...
...
@@ -573,8 +573,15 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
while
(
!
switch_test_flag
(
tech_pvt
,
TFLAG_BYE
)
&&
switch_test_flag
(
tech_pvt
,
TFLAG_IO
)
&&
tech_pvt
->
read_frame
.
datalen
==
0
)
{
payload
=
-
1
;
tech_pvt
->
read_frame
.
flags
=
0
;
tech_pvt
->
read_frame
.
datalen
=
switch_rtp_zerocopy_read
(
tech_pvt
->
rtp_session
,
&
tech_pvt
->
read_frame
.
data
,
&
payload
,
&
tech_pvt
->
read_frame
.
flags
);
if
(
switch_rtp_zerocopy_read
(
tech_pvt
->
rtp_session
,
&
tech_pvt
->
read_frame
.
data
,
&
tech_pvt
->
read_frame
.
datalen
,
&
payload
,
&
tech_pvt
->
read_frame
.
flags
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
/* RFC2833 ... TBD try harder to honor the duration etc.*/
if
(
payload
==
101
)
{
...
...
src/mod/endpoints/mod_exosip/mod_exosip.c
浏览文件 @
4dda1b7b
...
...
@@ -584,9 +584,12 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
&&
tech_pvt
->
read_frame
.
datalen
==
0
)
{
now
=
switch_time_now
();
tech_pvt
->
read_frame
.
flags
=
0
;
tech_pvt
->
read_frame
.
datalen
=
switch_rtp_zerocopy_read
(
tech_pvt
->
rtp_session
,
&
tech_pvt
->
read_frame
.
data
,
&
payload
,
&
tech_pvt
->
read_frame
.
flags
);
if
(
tech_pvt
->
read_frame
.
datalen
<
0
)
{
if
(
switch_rtp_zerocopy_read
(
tech_pvt
->
rtp_session
,
&
tech_pvt
->
read_frame
.
data
,
&
tech_pvt
->
read_frame
.
datalen
,
&
payload
,
&
tech_pvt
->
read_frame
.
flags
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
}
...
...
src/switch_rtp.c
浏览文件 @
4dda1b7b
...
...
@@ -534,29 +534,36 @@ static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_typ
return
(
int
)(
bytes
-
rtp_header_len
);
}
SWITCH_DECLARE
(
int
)
switch_rtp_read
(
switch_rtp
*
rtp_session
,
void
*
data
,
uint32_t
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
)
SWITCH_DECLARE
(
switch_status
)
switch_rtp_read
(
switch_rtp
*
rtp_session
,
void
*
data
,
uint32_t
*
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
)
{
int
bytes
=
rtp_common_read
(
rtp_session
,
data
,
payload_type
,
flags
);
if
(
bytes
<=
0
)
{
return
bytes
;
*
datalen
=
0
;
return
SWITCH_STATUS_GENERR
;
}
*
datalen
=
bytes
;
memcpy
(
data
,
rtp_session
->
recv_msg
.
body
,
bytes
);
return
bytes
;
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
int
)
switch_rtp_zerocopy_read
(
switch_rtp
*
rtp_session
,
void
**
data
,
int
*
payload_type
,
switch_frame_flag
*
flags
)
SWITCH_DECLARE
(
switch_status
)
switch_rtp_zerocopy_read
(
switch_rtp
*
rtp_session
,
void
**
data
,
uint32_t
*
datalen
,
int
*
payload_type
,
switch_frame_flag
*
flags
)
{
int
bytes
=
rtp_common_read
(
rtp_session
,
data
,
payload_type
,
flags
);
*
data
=
rtp_session
->
recv_msg
.
body
;
if
(
bytes
<=
0
)
{
return
bytes
;
*
datalen
=
0
;
return
SWITCH_STATUS_GENERR
;
}
return
bytes
;
*
datalen
=
bytes
;
return
SWITCH_STATUS_SUCCESS
;
}
static
int
rtp_common_write
(
switch_rtp
*
rtp_session
,
void
*
data
,
uint32_t
datalen
,
uint8_t
payload
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论