Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
1f259520
提交
1f259520
authored
6月 04, 2015
作者:
Seven Du
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7585 add bandwidth settings to flash video
上级
f8663138
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
18 行增加
和
3 行删除
+18
-3
freeswitch-video.html
clients/flex/freeswitch-video.html
+1
-1
mod_rtmp.c
src/mod/endpoints/mod_rtmp/mod_rtmp.c
+16
-2
mod_rtmp.h
src/mod/endpoints/mod_rtmp/mod_rtmp.h
+1
-0
没有找到文件。
clients/flex/freeswitch-video.html
浏览文件 @
1f259520
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
}
}
function
makeCall
()
{
function
makeCall
()
{
flash
.
makeCall
(
$
(
'#dest'
).
val
(),
''
,
{
want
_video
:
"true
"
});
flash
.
makeCall
(
$
(
'#dest'
).
val
(),
''
,
{
want
Video
:
"true"
,
incomingBandwidth
:
"1mb
"
});
}
}
function
hangup
()
{
function
hangup
()
{
...
...
src/mod/endpoints/mod_rtmp/mod_rtmp.c
浏览文件 @
1f259520
...
@@ -139,6 +139,8 @@ switch_status_t rtmp_tech_init(rtmp_private_t *tech_pvt, rtmp_session_t *rsessio
...
@@ -139,6 +139,8 @@ switch_status_t rtmp_tech_init(rtmp_private_t *tech_pvt, rtmp_session_t *rsessio
tech_pvt
->
audio_codec
=
0xB2
;
//rtmp_audio_codec(1, 16, 0 /* speex is always 8000 */, RTMP_AUDIO_SPEEX);
tech_pvt
->
audio_codec
=
0xB2
;
//rtmp_audio_codec(1, 16, 0 /* speex is always 8000 */, RTMP_AUDIO_SPEEX);
if
(
tech_pvt
->
has_video
)
{
if
(
tech_pvt
->
has_video
)
{
switch_codec_settings_t
codec_settings
=
{{
0
}};
/* Initialize video read & write codecs */
/* Initialize video read & write codecs */
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_read_codec
,
/* name */
"H264"
,
/* modname */
NULL
,
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_read_codec
,
/* name */
"H264"
,
/* modname */
NULL
,
/* fmtp */
NULL
,
/* rate */
90000
,
/* ms */
0
,
/* channels */
1
,
/* fmtp */
NULL
,
/* rate */
90000
,
/* ms */
0
,
/* channels */
1
,
...
@@ -149,10 +151,16 @@ switch_status_t rtmp_tech_init(rtmp_private_t *tech_pvt, rtmp_session_t *rsessio
...
@@ -149,10 +151,16 @@ switch_status_t rtmp_tech_init(rtmp_private_t *tech_pvt, rtmp_session_t *rsessio
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
}
}
if
(
!
zstr
(
tech_pvt
->
video_max_bandwidth_out
))
{
codec_settings
.
video
.
bandwidth
=
switch_parse_bandwidth_string
(
tech_pvt
->
video_max_bandwidth_out
);
}
else
{
codec_settings
.
video
.
bandwidth
=
switch_parse_bandwidth_string
(
"1mb"
);
}
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_write_codec
,
/* name */
"H264"
,
/* modname */
NULL
,
if
(
switch_core_codec_init
(
&
tech_pvt
->
video_write_codec
,
/* name */
"H264"
,
/* modname */
NULL
,
/* fmtp */
NULL
,
/* rate */
90000
,
/* ms */
0
,
/* channels */
1
,
/* fmtp */
NULL
,
/* rate */
90000
,
/* ms */
0
,
/* channels */
1
,
/* flags */
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
/* flags */
SWITCH_CODEC_FLAG_ENCODE
|
SWITCH_CODEC_FLAG_DECODE
,
/* codec settings */
NULL
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
/* codec settings */
&
codec_settings
,
switch_core_session_get_pool
(
session
))
!=
SWITCH_STATUS_SUCCESS
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Can't initialize write codec
\n
"
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Can't initialize write codec
\n
"
);
return
SWITCH_STATUS_FALSE
;
return
SWITCH_STATUS_FALSE
;
...
@@ -1102,12 +1110,18 @@ switch_call_cause_t rtmp_session_create_call(rtmp_session_t *rsession, switch_co
...
@@ -1102,12 +1110,18 @@ switch_call_cause_t rtmp_session_create_call(rtmp_session_t *rsession, switch_co
switch_core_session_add_stream
(
*
newsession
,
NULL
);
switch_core_session_add_stream
(
*
newsession
,
NULL
);
if
(
event
)
{
if
(
event
)
{
const
char
*
want_video
=
switch_event_get_header
(
event
,
"want_video"
);
const
char
*
want_video
=
switch_event_get_header
(
event
,
"wantVideo"
);
const
char
*
bandwidth
=
switch_event_get_header
(
event
,
"incomingBandwidth"
);
if
(
want_video
&&
switch_true
(
want_video
))
{
if
(
want_video
&&
switch_true
(
want_video
))
{
tech_pvt
->
has_video
=
1
;
tech_pvt
->
has_video
=
1
;
switch_channel_set_variable
(
channel
,
"video_possible"
,
"true"
);
switch_channel_set_variable
(
channel
,
"video_possible"
,
"true"
);
}
}
if
(
!
zstr
(
bandwidth
))
{
tech_pvt
->
video_max_bandwidth_out
=
switch_core_strdup
(
pool
,
bandwidth
);
}
}
}
if
(
rtmp_tech_init
(
tech_pvt
,
rsession
,
*
newsession
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
rtmp_tech_init
(
tech_pvt
,
rsession
,
*
newsession
)
!=
SWITCH_STATUS_SUCCESS
)
{
...
...
src/mod/endpoints/mod_rtmp/mod_rtmp.h
浏览文件 @
1f259520
...
@@ -559,6 +559,7 @@ struct rtmp_private {
...
@@ -559,6 +559,7 @@ struct rtmp_private {
//video
//video
int
has_video
;
int
has_video
;
char
*
video_max_bandwidth_out
;
switch_codec_t
video_read_codec
;
switch_codec_t
video_read_codec
;
switch_codec_t
video_write_codec
;
switch_codec_t
video_write_codec
;
rtp2rtmp_helper_t
video_write_helper
;
rtp2rtmp_helper_t
video_write_helper
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论