Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
ee7a298f
提交
ee7a298f
authored
3月 08, 2016
作者:
Anthony Minessale
提交者:
Brian West
3月 08, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8868 #resolve [recording app to respect bandwidth set in SDP]
上级
b7227465
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
58 行增加
和
26 行删除
+58
-26
sdp_parse.c
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
+4
-4
avcodec.c
src/mod/applications/mod_av/avcodec.c
+6
-4
switch_core_media.c
src/switch_core_media.c
+34
-12
switch_ivr_play_say.c
src/switch_ivr_play_say.c
+14
-6
没有找到文件。
libs/sofia-sip/libsofia-sip-ua/sdp/sdp_parse.c
浏览文件 @
ee7a298f
...
...
@@ -921,13 +921,13 @@ static void parse_bandwidth(sdp_parser_t *p, char *r, sdp_bandwidth_t **result)
}
if
(
su_casematch
(
name
,
"CT"
))
modifier
=
sdp_bw_ct
,
name
=
NULL
;
modifier
=
sdp_bw_ct
,
name
=
"CT"
;
else
if
(
su_casematch
(
name
,
"TIAS"
)
==
1
)
modifier
=
sdp_bw_tias
,
name
=
NULL
;
modifier
=
sdp_bw_tias
,
name
=
"TIAS"
;
else
if
(
su_casematch
(
name
,
"AS"
)
==
1
)
modifier
=
sdp_bw_as
,
name
=
NULL
;
modifier
=
sdp_bw_as
,
name
=
"AS"
;
else
modifier
=
sdp_bw_x
;
modifier
=
sdp_bw_x
,
name
=
"BW-X"
;
if
(
STRICT
(
p
))
PARSE_CHECK_REST
(
p
,
r
,
"b"
);
...
...
src/mod/applications/mod_av/avcodec.c
浏览文件 @
ee7a298f
...
...
@@ -843,17 +843,19 @@ static switch_status_t open_encoder(h264_codec_context_t *context, uint32_t widt
}
if
(
context
->
codec_settings
.
video
.
bandwidth
)
{
context
->
bandwidth
=
context
->
codec_settings
.
video
.
bandwidth
*
8
;
context
->
bandwidth
=
context
->
codec_settings
.
video
.
bandwidth
;
}
else
{
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
1
,
15
)
*
8
;
context
->
bandwidth
=
switch_calc_bitrate
(
context
->
codec_settings
.
video
.
width
,
context
->
codec_settings
.
video
.
height
,
1
,
15
);
}
sane
=
switch_calc_bitrate
(
1920
,
1080
,
2
,
30
);
if
(
context
->
bandwidth
/
8
>
sane
)
{
if
(
context
->
bandwidth
>
sane
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_WARNING
,
"BITRATE TRUNCATED TO %d
\n
"
,
sane
);
context
->
bandwidth
=
sane
*
8
;
context
->
bandwidth
=
sane
;
}
context
->
bandwidth
*=
3
;
//context->encoder_ctx->bit_rate = context->bandwidth * 1024;
context
->
encoder_ctx
->
width
=
context
->
codec_settings
.
video
.
width
;
...
...
src/switch_core_media.c
浏览文件 @
ee7a298f
...
...
@@ -173,6 +173,7 @@ typedef struct switch_rtp_engine_s {
switch_thread_id_t
thread_id
;
uint8_t
new_ice
;
uint8_t
new_dtls
;
uint32_t
sdp_bw
;
}
switch_rtp_engine_t
;
struct
switch_media_handle_s
{
...
...
@@ -2646,20 +2647,29 @@ static void switch_core_session_parse_codec_settings(switch_core_session_t *sess
switch
(
type
)
{
case
SWITCH_MEDIA_TYPE_AUDIO
:
break
;
case
SWITCH_MEDIA_TYPE_VIDEO
:
{
const
char
*
bwv
=
switch_channel_get_variable
(
session
->
channel
,
"rtp_video_max_bandwidth"
);
case
SWITCH_MEDIA_TYPE_VIDEO
:
{
uint32_t
system_bw
=
0
;
if
(
!
bwv
)
{
bwv
=
switch_channel_get_variable
(
session
->
channel
,
"rtp_video_max_bandwidth_out"
);
}
const
char
*
bwv
=
switch_channel_get_variable
(
session
->
channel
,
"rtp_video_max_bandwidth"
);
if
(
!
bwv
)
{
bwv
=
switch_channel_get_variable
(
session
->
channel
,
"rtp_video_max_bandwidth_out"
);
}
if
(
!
bwv
)
{
bwv
=
"1mb"
;
}
system_bw
=
switch_parse_bandwidth_string
(
bwv
);
if
(
!
bwv
)
{
bwv
=
"1mb"
;
}
engine
->
codec_settings
.
video
.
bandwidth
=
switch_parse_bandwidth_string
(
bwv
);
printf
(
"%d %d
\n
"
,
engine
->
sdp_bw
,
system_bw
);
if
(
engine
->
sdp_bw
&&
engine
->
sdp_bw
<=
system_bw
)
{
engine
->
codec_settings
.
video
.
bandwidth
=
engine
->
sdp_bw
;
}
else
{
engine
->
codec_settings
.
video
.
bandwidth
=
system_bw
;
}
}
break
;
default
:
break
;
...
...
@@ -4039,7 +4049,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
maxptime
=
atoi
(
attr
->
a_value
);
}
else
if
(
got_crypto
<
1
&&
!
strcasecmp
(
attr
->
a_name
,
"crypto"
)
&&
!
zstr
(
attr
->
a_value
))
{
int
crypto_tag
;
if
(
!
(
smh
->
mparams
->
ndlb
&
SM_NDLB_ALLOW_CRYPTO_IN_AVP
)
&&
!
switch_true
(
switch_channel_get_variable
(
session
->
channel
,
"rtp_allow_crypto_in_avp"
)))
{
if
(
m
->
m_proto
!=
sdp_proto_srtp
&&
!
got_webrtc
)
{
...
...
@@ -4547,6 +4557,18 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
v_engine
->
rmode
=
sdp_media_flow
(
m
->
m_mode
);
if
(
sdp_type
==
SDP_TYPE_REQUEST
)
{
sdp_bandwidth_t
*
bw
;
int
tias
=
0
;
for
(
bw
=
m
->
m_bandwidths
;
bw
;
bw
=
bw
->
b_next
)
{
if
(
bw
->
b_modifier
==
sdp_bw_as
&&
!
tias
)
{
v_engine
->
sdp_bw
=
bw
->
b_value
/
1024
;
}
else
if
(
bw
->
b_modifier
==
sdp_bw_tias
)
{
tias
=
1
;
v_engine
->
sdp_bw
=
bw
->
b_value
/
1024
;
}
}
switch
(
v_engine
->
rmode
)
{
case
SWITCH_MEDIA_FLOW_RECVONLY
:
switch_channel_set_variable
(
smh
->
session
->
channel
,
"video_media_flow"
,
"sendonly"
);
...
...
src/switch_ivr_play_say.c
浏览文件 @
ee7a298f
...
...
@@ -380,7 +380,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
int
restart_limit_on_dtmf
=
0
;
const
char
*
prefix
,
*
var
,
*
video_file
=
NULL
;
int
vid_play_file_flags
=
SWITCH_FILE_FLAG_READ
|
SWITCH_FILE_DATA_SHORT
|
SWITCH_FILE_FLAG_VIDEO
;
int
echo_on
=
0
;
if
(
switch_channel_pre_answer
(
channel
)
!=
SWITCH_STATUS_SUCCESS
)
{
return
SWITCH_STATUS_FALSE
;
...
...
@@ -575,6 +575,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
}
if
(
!
switch_test_flag
(
&
vfh
,
SWITCH_FILE_OPEN
))
{
echo_on
=
1
;
switch_channel_set_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
switch_channel_set_flag
(
channel
,
CF_VIDEO_ECHO
);
}
...
...
@@ -654,8 +656,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
"Raw Codec Activation Failed %s@%uhz %u channels %dms
\n
"
,
codec_name
,
fh
->
samplerate
,
fh
->
channels
,
read_impl
.
microseconds_per_packet
/
1000
);
if
(
switch_core_file_has_video
(
fh
))
{
switch_channel_clear_flag
(
channel
,
CF_VIDEO_ECHO
);
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
if
(
echo_on
)
{
switch_channel_clear_flag
(
channel
,
CF_VIDEO_ECHO
);
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
echo_on
=
0
;
}
switch_core_media_set_video_file
(
session
,
NULL
,
SWITCH_RW_READ
);
if
(
switch_test_flag
(
&
vfh
,
SWITCH_FILE_OPEN
))
{
switch_core_media_set_video_file
(
session
,
NULL
,
SWITCH_RW_WRITE
);
...
...
@@ -867,10 +872,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_record_file(switch_core_session_t *se
if
(
fill_cng
||
waste_resources
)
{
switch_core_codec_destroy
(
&
write_codec
);
}
if
(
switch_core_file_has_video
(
fh
))
{
switch_channel_clear_flag
(
channel
,
CF_VIDEO_ECHO
);
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
if
(
echo_on
)
{
switch_channel_clear_flag
(
channel
,
CF_VIDEO_ECHO
);
switch_channel_clear_flag_recursive
(
channel
,
CF_VIDEO_DECODED_READ
);
echo_on
=
0
;
}
switch_core_media_set_video_file
(
session
,
NULL
,
SWITCH_RW_READ
);
if
(
switch_test_flag
(
&
vfh
,
SWITCH_FILE_OPEN
))
{
switch_core_media_set_video_file
(
session
,
NULL
,
SWITCH_RW_WRITE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论