Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6667eed7
提交
6667eed7
authored
3月 17, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@7908
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
b525711e
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
52 行增加
和
2 行删除
+52
-2
switch_core_pvt.h
src/include/private/switch_core_pvt.h
+1
-0
switch_core.h
src/include/switch_core.h
+2
-0
switch_core_codec.c
src/switch_core_codec.c
+31
-0
switch_core_io.c
src/switch_core_io.c
+10
-2
switch_core_media_bug.c
src/switch_core_media_bug.c
+8
-0
没有找到文件。
src/include/private/switch_core_pvt.h
浏览文件 @
6667eed7
...
@@ -138,6 +138,7 @@ struct switch_core_session {
...
@@ -138,6 +138,7 @@ struct switch_core_session {
switch_frame_t
enc_read_frame
;
switch_frame_t
enc_read_frame
;
uint8_t
raw_read_buf
[
SWITCH_RECOMMENDED_BUFFER_SIZE
];
uint8_t
raw_read_buf
[
SWITCH_RECOMMENDED_BUFFER_SIZE
];
uint8_t
enc_read_buf
[
SWITCH_RECOMMENDED_BUFFER_SIZE
];
uint8_t
enc_read_buf
[
SWITCH_RECOMMENDED_BUFFER_SIZE
];
switch_codec_t
bug_codec
;
};
};
struct
switch_media_bug
{
struct
switch_media_bug
{
...
...
src/include/switch_core.h
浏览文件 @
6667eed7
...
@@ -1025,6 +1025,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec,
...
@@ -1025,6 +1025,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_init(switch_codec_t *codec,
int
channels
,
int
channels
,
uint32_t
flags
,
const
switch_codec_settings_t
*
codec_settings
,
switch_memory_pool_t
*
pool
);
uint32_t
flags
,
const
switch_codec_settings_t
*
codec_settings
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_copy
(
switch_codec_t
*
codec
,
switch_codec_t
*
new_codec
,
switch_memory_pool_t
*
pool
);
/*!
/*!
\brief Encode data using a codec handle
\brief Encode data using a codec handle
\param codec the codec handle to use
\param codec the codec handle to use
...
...
src/switch_core_codec.c
浏览文件 @
6667eed7
...
@@ -154,6 +154,35 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_video_write_codec(switc
...
@@ -154,6 +154,35 @@ SWITCH_DECLARE(switch_codec_t *) switch_core_session_get_video_write_codec(switc
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_copy
(
switch_codec_t
*
codec
,
switch_codec_t
*
new_codec
,
switch_memory_pool_t
*
pool
)
{
switch_status_t
status
;
switch_assert
(
codec
!=
NULL
);
switch_assert
(
new_codec
!=
NULL
);
if
(
pool
)
{
new_codec
->
memory_pool
=
pool
;
}
else
{
if
((
status
=
switch_core_new_memory_pool
(
&
new_codec
->
memory_pool
))
!=
SWITCH_STATUS_SUCCESS
)
{
return
status
;
}
switch_set_flag
(
new_codec
,
SWITCH_CODEC_FLAG_FREE_POOL
);
}
new_codec
->
codec_interface
=
codec
->
codec_interface
;
new_codec
->
implementation
=
codec
->
implementation
;
new_codec
->
flags
=
codec
->
flags
;
if
(
codec
->
fmtp_in
)
{
new_codec
->
fmtp_in
=
switch_core_strdup
(
new_codec
->
memory_pool
,
codec
->
fmtp_in
);
}
new_codec
->
implementation
->
init
(
new_codec
,
new_codec
->
flags
,
NULL
);
return
SWITCH_STATUS_SUCCESS
;
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_init
(
switch_codec_t
*
codec
,
char
*
codec_name
,
char
*
fmtp
,
SWITCH_DECLARE
(
switch_status_t
)
switch_core_codec_init
(
switch_codec_t
*
codec
,
char
*
codec_name
,
char
*
fmtp
,
uint32_t
rate
,
int
ms
,
int
channels
,
uint32_t
flags
,
uint32_t
rate
,
int
ms
,
int
channels
,
uint32_t
flags
,
const
switch_codec_settings_t
*
codec_settings
,
switch_memory_pool_t
*
pool
)
const
switch_codec_settings_t
*
codec_settings
,
switch_memory_pool_t
*
pool
)
...
@@ -305,6 +334,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
...
@@ -305,6 +334,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
switch_core_destroy_memory_pool
(
&
codec
->
memory_pool
);
switch_core_destroy_memory_pool
(
&
codec
->
memory_pool
);
}
}
memset
(
codec
,
0
,
sizeof
(
*
codec
));
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
...
...
src/switch_core_io.c
浏览文件 @
6667eed7
...
@@ -194,7 +194,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
...
@@ -194,7 +194,15 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
read_frame
=
&
session
->
raw_read_frame
;
read_frame
=
&
session
->
raw_read_frame
;
status
=
SWITCH_STATUS_SUCCESS
;
status
=
SWITCH_STATUS_SUCCESS
;
}
else
{
}
else
{
status
=
switch_core_codec_decode
(
read_frame
->
codec
,
switch_codec_t
*
use_codec
=
read_frame
->
codec
;
if
(
do_bugs
)
{
if
(
!
session
->
bug_codec
.
implementation
)
{
switch_core_codec_copy
(
read_frame
->
codec
,
&
session
->
bug_codec
,
switch_core_session_get_pool
(
session
));
}
use_codec
=
&
session
->
bug_codec
;
}
status
=
switch_core_codec_decode
(
use_codec
,
session
->
read_codec
,
session
->
read_codec
,
read_frame
->
data
,
read_frame
->
data
,
read_frame
->
datalen
,
read_frame
->
datalen
,
...
...
src/switch_core_media_bug.c
浏览文件 @
6667eed7
...
@@ -288,6 +288,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_ses
...
@@ -288,6 +288,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove_all(switch_core_ses
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
if
(
session
->
bug_codec
.
implementation
)
{
switch_core_codec_destroy
(
&
session
->
bug_codec
);
}
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
...
@@ -343,6 +347,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session
...
@@ -343,6 +347,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_remove(switch_core_session
status
=
switch_core_media_bug_close
(
&
bp
);
status
=
switch_core_media_bug_close
(
&
bp
);
}
}
if
(
!
session
->
bugs
&&
session
->
bug_codec
.
implementation
)
{
switch_core_codec_destroy
(
&
session
->
bug_codec
);
}
return
status
;
return
status
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论