Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
38621e47
提交
38621e47
authored
4月 04, 2017
作者:
Anthony Minessale
提交者:
Mike Jerris
4月 11, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-10209: [freeswitch-core,mod_av] Add auth params to file handles
上级
ae1cdced
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
4 行删除
+29
-4
switch_module_interfaces.h
src/include/switch_module_interfaces.h
+5
-0
avformat.c
src/mod/applications/mod_av/avformat.c
+15
-3
mod_av.c
src/mod/applications/mod_av/mod_av.c
+1
-1
switch_core_file.c
src/switch_core_file.c
+8
-0
没有找到文件。
src/include/switch_module_interfaces.h
浏览文件 @
38621e47
...
...
@@ -329,6 +329,11 @@ typedef struct switch_mm_s {
switch_video_profile_t
vprofile
;
switch_video_encode_speed_t
vencspd
;
uint8_t
try_hardware_encoder
;
int
scale_w
;
int
scale_h
;
switch_img_fmt_t
fmt
;
char
*
auth_username
;
char
*
auth_password
;
}
switch_mm_t
;
/*! an abstract representation of a file handle (some parameters based on compat with libsndfile) */
...
...
src/mod/applications/mod_av/avformat.c
浏览文件 @
38621e47
...
...
@@ -906,7 +906,7 @@ SWITCH_STANDARD_APP(record_av_function)
char
codec_str
[
256
];
const
AVCodecDescriptor
*
desc
;
if
(
!
strncmp
(
data
,
"rtmp://"
,
7
))
{
if
(
!
strncmp
(
data
,
"rtmp://"
,
7
)
||
!
strncmp
(
data
,
"rtsp://"
,
7
)
)
{
fmt
->
video_codec
=
AV_CODEC_ID_H264
;
fmt
->
audio_codec
=
AV_CODEC_ID_AAC
;
}
...
...
@@ -1694,9 +1694,20 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
return
SWITCH_STATUS_GENERR
;
}
else
if
(
handle
->
stream_name
&&
(
!
strcasecmp
(
handle
->
stream_name
,
"rtmp"
)
||
!
strcasecmp
(
handle
->
stream_name
,
"youtube"
)))
{
format
=
"flv"
;
switch_snprintf
(
file
,
sizeof
(
file
),
"rtmp://%s"
,
path
);
// meh really silly format for the user / pass libav.....
if
(
handle
->
mm
.
auth_username
&&
handle
->
mm
.
auth_password
)
{
switch_snprintf
(
file
,
sizeof
(
file
),
"rtmp://%s pubUser=%s pubPasswd=%s flashver=FMLE/3.0"
,
path
,
handle
->
mm
.
auth_username
,
handle
->
mm
.
auth_password
);
}
else
{
switch_snprintf
(
file
,
sizeof
(
file
),
"rtmp://%s"
,
path
);
}
}
else
if
(
handle
->
stream_name
&&
!
strcasecmp
(
handle
->
stream_name
,
"rtsp"
))
{
format
=
"rtsp"
;
switch_snprintf
(
file
,
sizeof
(
file
),
"rtsp://%s"
,
path
);
}
ext
++
;
if
((
context
=
(
av_file_context_t
*
)
switch_core_alloc
(
handle
->
memory_pool
,
sizeof
(
av_file_context_t
)))
==
0
)
{
...
...
@@ -1783,7 +1794,7 @@ static switch_status_t av_file_open(switch_file_handle_t *handle, const char *pa
if
(
fmt
->
video_codec
!=
AV_CODEC_ID_NONE
)
{
const
AVCodecDescriptor
*
desc
;
if
((
handle
->
stream_name
&&
(
!
strcasecmp
(
handle
->
stream_name
,
"rtmp"
)
||
!
strcasecmp
(
handle
->
stream_name
,
"youtube"
))))
{
if
((
handle
->
stream_name
&&
(
!
strcasecmp
(
handle
->
stream_name
,
"rtmp"
)
||
!
strcasecmp
(
handle
->
stream_name
,
"
rtsp"
)
||
!
strcasecmp
(
handle
->
stream_name
,
"
youtube"
))))
{
if
(
fmt
->
video_codec
!=
AV_CODEC_ID_H264
)
{
fmt
->
video_codec
=
AV_CODEC_ID_H264
;
// force H264
...
...
@@ -2525,6 +2536,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avformat_load)
supported_formats
[
i
++
]
=
"av"
;
supported_formats
[
i
++
]
=
"rtmp"
;
supported_formats
[
i
++
]
=
"rtsp"
;
supported_formats
[
i
++
]
=
"mp4"
;
supported_formats
[
i
++
]
=
"m4a"
;
supported_formats
[
i
++
]
=
"mov"
;
...
...
src/mod/applications/mod_av/mod_av.c
浏览文件 @
38621e47
...
...
@@ -93,7 +93,7 @@ int mod_av_lockmgr_cb(void **m, enum AVLockOp op)
static
void
log_callback
(
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vl
)
{
switch_log_level_t
switch_level
=
SWITCH_LOG_DEBUG
;
return
;
/* naggy messages */
if
(
level
==
AV_LOG_DEBUG
||
level
==
AV_LOG_WARNING
)
return
;
...
...
src/switch_core_file.c
浏览文件 @
38621e47
...
...
@@ -177,6 +177,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_perform_file_open(const char *file,
fh
->
mm
.
try_hardware_encoder
=
switch_true
(
val
);
}
if
((
val
=
switch_event_get_header
(
fh
->
params
,
"auth_username"
)))
{
fh
->
mm
.
auth_username
=
switch_core_strdup
(
fh
->
memory_pool
,
val
);
}
if
((
val
=
switch_event_get_header
(
fh
->
params
,
"auth_password"
)))
{
fh
->
mm
.
auth_password
=
switch_core_strdup
(
fh
->
memory_pool
,
val
);
}
if
((
val
=
switch_event_get_header
(
fh
->
params
,
"fps"
)))
{
float
ftmp
=
atof
(
val
);
if
(
ftmp
>
0
.
0
f
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论