Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
b4f477c2
提交
b4f477c2
authored
11月 19, 2015
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8293 fix some regressions where speed test caused excessive downlink bandwidth
上级
cd8901bf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
42 行增加
和
9 行删除
+42
-9
avcodec.c
src/mod/applications/mod_av/avcodec.c
+7
-1
mod_vpx.c
src/mod/codecs/mod_vpx/mod_vpx.c
+9
-4
mod_verto.c
src/mod/endpoints/mod_verto/mod_verto.c
+26
-4
没有找到文件。
src/mod/applications/mod_av/avcodec.c
浏览文件 @
b4f477c2
...
@@ -800,7 +800,8 @@ static switch_status_t consume_nalu(h264_codec_context_t *context, switch_frame_
...
@@ -800,7 +800,8 @@ static switch_status_t consume_nalu(h264_codec_context_t *context, switch_frame_
static
switch_status_t
open_encoder
(
h264_codec_context_t
*
context
,
uint32_t
width
,
uint32_t
height
)
static
switch_status_t
open_encoder
(
h264_codec_context_t
*
context
,
uint32_t
width
,
uint32_t
height
)
{
{
int
sane
=
0
;
if
(
!
context
->
encoder
)
context
->
encoder
=
avcodec_find_encoder
(
context
->
av_codec_id
);
if
(
!
context
->
encoder
)
context
->
encoder
=
avcodec_find_encoder
(
context
->
av_codec_id
);
if
(
!
context
->
encoder
)
{
if
(
!
context
->
encoder
)
{
...
@@ -847,6 +848,11 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
...
@@ -847,6 +848,11 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
0
,
0
)
*
8
;
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
0
,
0
)
*
8
;
}
}
if
(
context
->
bandwidth
>
sane
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"BITRATE TRUNCATED TO %d
\n
"
,
sane
);
context
->
bandwidth
=
sane
*
8
;
}
//context->encoder_ctx->bit_rate = context->bandwidth * 1024;
//context->encoder_ctx->bit_rate = context->bandwidth * 1024;
context
->
encoder_ctx
->
width
=
context
->
codec_settings
.
video
.
width
;
context
->
encoder_ctx
->
width
=
context
->
codec_settings
.
video
.
width
;
context
->
encoder_ctx
->
height
=
context
->
codec_settings
.
video
.
height
;
context
->
encoder_ctx
->
height
=
context
->
codec_settings
.
video
.
height
;
...
...
src/mod/codecs/mod_vpx/mod_vpx.c
浏览文件 @
b4f477c2
...
@@ -300,7 +300,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
...
@@ -300,7 +300,8 @@ static switch_status_t init_encoder(switch_codec_t *codec)
vpx_codec_enc_cfg_t
*
config
=
&
context
->
config
;
vpx_codec_enc_cfg_t
*
config
=
&
context
->
config
;
int
token_parts
=
1
;
int
token_parts
=
1
;
int
cpus
=
switch_core_cpu_count
();
int
cpus
=
switch_core_cpu_count
();
int
sane
;
if
(
!
context
->
codec_settings
.
video
.
width
)
{
if
(
!
context
->
codec_settings
.
video
.
width
)
{
context
->
codec_settings
.
video
.
width
=
1280
;
context
->
codec_settings
.
video
.
width
=
1280
;
}
}
...
@@ -312,15 +313,19 @@ static switch_status_t init_encoder(switch_codec_t *codec)
...
@@ -312,15 +313,19 @@ static switch_status_t init_encoder(switch_codec_t *codec)
if
(
context
->
codec_settings
.
video
.
bandwidth
==
-
1
)
{
if
(
context
->
codec_settings
.
video
.
bandwidth
==
-
1
)
{
context
->
codec_settings
.
video
.
bandwidth
=
0
;
context
->
codec_settings
.
video
.
bandwidth
=
0
;
}
}
if
(
context
->
codec_settings
.
video
.
bandwidth
)
{
if
(
context
->
codec_settings
.
video
.
bandwidth
)
{
context
->
bandwidth
=
context
->
codec_settings
.
video
.
bandwidth
;
context
->
bandwidth
=
context
->
codec_settings
.
video
.
bandwidth
;
}
else
{
}
else
{
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
0
,
0
);
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
0
,
0
);
}
}
if
(
context
->
bandwidth
>
40960
)
{
sane
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
4
,
30
);
context
->
bandwidth
=
40960
;
if
(
context
->
bandwidth
>
sane
)
{
switch_log_printf
(
SWITCH_CHANNEL_SESSION_LOG
(
codec
->
session
),
SWITCH_LOG_WARNING
,
"BITRATE TRUNCATED TO %d
\n
"
,
sane
);
context
->
bandwidth
=
sane
;
}
}
context
->
pkt
=
NULL
;
context
->
pkt
=
NULL
;
...
...
src/mod/endpoints/mod_verto/mod_verto.c
浏览文件 @
b4f477c2
...
@@ -3429,18 +3429,40 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
...
@@ -3429,18 +3429,40 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
}
}
if
((
bandwidth
=
cJSON_GetObjectItem
(
dialog
,
"outgoingBandwidth"
)))
{
if
((
bandwidth
=
cJSON_GetObjectItem
(
dialog
,
"outgoingBandwidth"
)))
{
int
core_bw
=
0
,
bwval
=
0
;
const
char
*
val
;
if
((
val
=
switch_channel_get_variable_dup
(
channel
,
"rtp_video_max_bandwidth_in"
,
SWITCH_FALSE
,
-
1
)))
{
core_bw
=
switch_parse_bandwidth_string
(
val
);
}
if
(
!
zstr
(
bandwidth
->
valuestring
)
&&
strcasecmp
(
bandwidth
->
valuestring
,
"default"
))
{
if
(
!
zstr
(
bandwidth
->
valuestring
)
&&
strcasecmp
(
bandwidth
->
valuestring
,
"default"
))
{
switch_channel_set_variable
(
channel
,
"rtp_video_max_bandwidth_in"
,
bandwidth
->
valuestring
);
bwval
=
atoi
(
bandwidth
->
valuestring
);
}
else
if
(
bandwidth
->
valueint
)
{
}
else
if
(
bandwidth
->
valueint
)
{
switch_channel_set_variable_printf
(
channel
,
"rtp_video_max_bandwidth_in"
,
"%d"
,
bandwidth
->
valueint
);
bwval
=
bandwidth
->
valueint
;
}
if
(
bwval
<=
0
||
(
core_bw
&&
bwval
<
core_bw
))
{
switch_channel_set_variable_printf
(
channel
,
"rtp_video_max_bandwidth_in"
,
"%d"
,
bwval
);
}
}
}
}
if
((
bandwidth
=
cJSON_GetObjectItem
(
dialog
,
"incomingBandwidth"
)))
{
if
((
bandwidth
=
cJSON_GetObjectItem
(
dialog
,
"incomingBandwidth"
)))
{
int
core_bw
=
0
,
bwval
=
0
;
const
char
*
val
;
if
((
val
=
switch_channel_get_variable_dup
(
channel
,
"rtp_video_max_bandwidth_out"
,
SWITCH_FALSE
,
-
1
)))
{
core_bw
=
switch_parse_bandwidth_string
(
val
);
}
if
(
!
zstr
(
bandwidth
->
valuestring
)
&&
strcasecmp
(
bandwidth
->
valuestring
,
"default"
))
{
if
(
!
zstr
(
bandwidth
->
valuestring
)
&&
strcasecmp
(
bandwidth
->
valuestring
,
"default"
))
{
switch_channel_set_variable
(
channel
,
"rtp_video_max_bandwidth_out"
,
bandwidth
->
valuestring
);
bwval
=
atoi
(
bandwidth
->
valuestring
);
}
else
if
(
bandwidth
->
valueint
)
{
}
else
if
(
bandwidth
->
valueint
)
{
switch_channel_set_variable_printf
(
channel
,
"rtp_video_max_bandwidth_out"
,
"%d"
,
bandwidth
->
valueint
);
bwval
=
bandwidth
->
valueint
;
}
if
(
bwval
<=
0
||
(
core_bw
&&
bwval
<
core_bw
))
{
switch_channel_set_variable_printf
(
channel
,
"rtp_video_max_bandwidth_out"
,
"%d"
,
bwval
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论