Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
d69cde63
提交
d69cde63
authored
3月 15, 2007
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@4598
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
84e012c0
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
28 行增加
和
4 行删除
+28
-4
switch_core.h
src/include/switch_core.h
+6
-2
switch_module_interfaces.h
src/include/switch_module_interfaces.h
+2
-0
mod_conference.c
src/mod/applications/mod_conference/mod_conference.c
+3
-0
mod_portaudio.c
src/mod/endpoints/mod_portaudio/mod_portaudio.c
+2
-0
switch_core.c
src/switch_core.c
+11
-2
switch_ivr.c
src/switch_ivr.c
+4
-0
没有找到文件。
src/include/switch_core.h
浏览文件 @
d69cde63
...
@@ -1109,14 +1109,18 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
...
@@ -1109,14 +1109,18 @@ SWITCH_DECLARE(void) switch_core_db_test_reactive(switch_core_db_t *db, char *te
/*!
/*!
\brief Open a media file using file format modules
\brief Open a media file using file format modules
\param fh a file handle to use
\param fh a file handle to use
\param codec_imp the codec implementation being used
\param file_path the path to the file
\param file_path the path to the file
\param flags read/write flags
\param flags read/write flags
\param pool the pool to use (NULL for new pool)
\param pool the pool to use (NULL for new pool)
\return SWITCH_STATUS_SUCCESS if the file is opened
\return SWITCH_STATUS_SUCCESS if the file is opened
\note the loadable module used is chosen based on the file extension
\note the loadable module used is chosen based on the file extension
*/
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_open
(
switch_file_handle_t
*
fh
,
char
*
file_path
,
unsigned
int
flags
,
switch_memory_pool_t
*
pool
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_open
(
switch_file_handle_t
*
fh
,
const
switch_codec_implementation_t
*
codec_imp
,
char
*
file_path
,
unsigned
int
flags
,
switch_memory_pool_t
*
pool
);
/*!
/*!
\brief Read media from a file handle
\brief Read media from a file handle
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
\param fh the file handle to read from (must be initilized by you memset all 0 for read, fill in channels and rate for write)
...
...
src/include/switch_module_interfaces.h
浏览文件 @
d69cde63
...
@@ -311,6 +311,8 @@ struct switch_file_handle {
...
@@ -311,6 +311,8 @@ struct switch_file_handle {
switch_memory_pool_t
*
memory_pool
;
switch_memory_pool_t
*
memory_pool
;
/*! private data for the format module to store handle specific info */
/*! private data for the format module to store handle specific info */
void
*
private_info
;
void
*
private_info
;
char
*
handler
;
const
switch_codec_implementation_t
*
codec_imp
;
int64_t
pos
;
int64_t
pos
;
switch_buffer_t
*
audio_buffer
;
switch_buffer_t
*
audio_buffer
;
uint32_t
thresh
;
uint32_t
thresh
;
...
...
src/mod/applications/mod_conference/mod_conference.c
浏览文件 @
d69cde63
...
@@ -1781,6 +1781,7 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
...
@@ -1781,6 +1781,7 @@ static void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *th
}
}
if
(
switch_core_file_open
(
&
fh
,
if
(
switch_core_file_open
(
&
fh
,
NULL
,
rec
->
path
,
rec
->
path
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
rec
->
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
rec
->
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -1957,6 +1958,7 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
...
@@ -1957,6 +1958,7 @@ static switch_status_t conference_play_file(conference_obj_t *conference, char *
/* Open the file */
/* Open the file */
if
(
switch_core_file_open
(
&
fnode
->
fh
,
if
(
switch_core_file_open
(
&
fnode
->
fh
,
NULL
,
file
,
file
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -2042,6 +2044,7 @@ static switch_status_t conference_member_play_file(conference_member_t *member,
...
@@ -2042,6 +2044,7 @@ static switch_status_t conference_member_play_file(conference_member_t *member,
/* Open the file */
/* Open the file */
if
(
switch_core_file_open
(
&
fnode
->
fh
,
if
(
switch_core_file_open
(
&
fnode
->
fh
,
switch_core_session_get_read_codec
(
member
->
session
)
->
implementation
,
file
,
file
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
pool
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
src/mod/endpoints/mod_portaudio/mod_portaudio.c
浏览文件 @
d69cde63
...
@@ -225,6 +225,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
...
@@ -225,6 +225,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session)
switch_set_flag_locked
((
&
globals
),
GFLAG_RING
);
switch_set_flag_locked
((
&
globals
),
GFLAG_RING
);
if
(
ring_file
)
{
if
(
ring_file
)
{
if
(
switch_core_file_open
(
&
fh
,
if
(
switch_core_file_open
(
&
fh
,
globals
.
read_codec
.
implementation
,
ring_file
,
ring_file
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
NULL
)
==
SWITCH_STATUS_SUCCESS
)
{
NULL
)
==
SWITCH_STATUS_SUCCESS
)
{
...
@@ -588,6 +589,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
...
@@ -588,6 +589,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
}
}
if
(
switch_core_file_open
(
&
tech_pvt
->
fh
,
if
(
switch_core_file_open
(
&
tech_pvt
->
fh
,
globals
.
read_codec
.
implementation
,
tech_pvt
->
hold_file
,
tech_pvt
->
hold_file
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
tech_pvt
->
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
src/switch_core.c
浏览文件 @
d69cde63
...
@@ -1014,8 +1014,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
...
@@ -1014,8 +1014,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
return
SWITCH_STATUS_SUCCESS
;
return
SWITCH_STATUS_SUCCESS
;
}
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_open
(
switch_file_handle_t
*
fh
,
char
*
file_path
,
unsigned
int
flags
,
SWITCH_DECLARE
(
switch_status_t
)
switch_core_file_open
(
switch_file_handle_t
*
fh
,
switch_memory_pool_t
*
pool
)
const
switch_codec_implementation_t
*
codec_imp
,
char
*
file_path
,
unsigned
int
flags
,
switch_memory_pool_t
*
pool
)
{
{
char
*
ext
;
char
*
ext
;
switch_status_t
status
;
switch_status_t
status
;
...
@@ -1049,6 +1052,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
...
@@ -1049,6 +1052,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_open(switch_file_handle_t *fh,
switch_set_flag
(
fh
,
SWITCH_FILE_FLAG_FREE_POOL
);
switch_set_flag
(
fh
,
SWITCH_FILE_FLAG_FREE_POOL
);
}
}
if
(
rhs
)
{
fh
->
handler
=
switch_core_strdup
(
fh
->
memory_pool
,
rhs
);
}
fh
->
codec_imp
=
codec_imp
;
return
fh
->
file_interface
->
file_open
(
fh
,
file_path
);
return
fh
->
file_interface
->
file_open
(
fh
,
file_path
);
}
}
...
...
src/switch_ivr.c
浏览文件 @
d69cde63
...
@@ -390,6 +390,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
...
@@ -390,6 +390,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
if
(
switch_core_file_open
(
fh
,
if
(
switch_core_file_open
(
fh
,
read_codec
->
implementation
,
file
,
file
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -628,6 +629,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
...
@@ -628,6 +629,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_session(switch_core_session_t
if
(
switch_core_file_open
(
fh
,
if
(
switch_core_file_open
(
fh
,
read_codec
->
implementation
,
file
,
file
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_WRITE
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -1155,6 +1157,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
...
@@ -1155,6 +1157,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess
}
}
if
(
switch_core_file_open
(
fh
,
if
(
switch_core_file_open
(
fh
,
read_codec
->
implementation
,
file
,
file
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
...
@@ -2854,6 +2857,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
...
@@ -2854,6 +2857,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
ringback
.
fhb
.
channels
=
read_codec
->
implementation
->
number_of_channels
;
ringback
.
fhb
.
channels
=
read_codec
->
implementation
->
number_of_channels
;
ringback
.
fhb
.
samplerate
=
read_codec
->
implementation
->
samples_per_second
;
ringback
.
fhb
.
samplerate
=
read_codec
->
implementation
->
samples_per_second
;
if
(
switch_core_file_open
(
&
ringback
.
fhb
,
if
(
switch_core_file_open
(
&
ringback
.
fhb
,
read_codec
->
implementation
,
ringback_data
,
ringback_data
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论