Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
dbb06b8c
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dbb06b8c
编写于
1月 21, 2012
作者:
M
Martin Storsjö
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rtsp: Allow specifying the UDP port range via AVOptions
Signed-off-by:
N
Martin Storsjö
<
martin@martin.st
>
上级
bc495bad
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
2 deletion
+16
-2
libavformat/rtsp.c
libavformat/rtsp.c
+11
-2
libavformat/rtsp.h
libavformat/rtsp.h
+5
-0
未找到文件。
libavformat/rtsp.c
浏览文件 @
dbb06b8c
...
...
@@ -81,6 +81,8 @@ const AVOption ff_rtsp_options[] = {
{
"http"
,
"HTTP tunneling"
,
0
,
AV_OPT_TYPE_CONST
,
{(
1
<<
RTSP_LOWER_TRANSPORT_HTTP
)},
0
,
0
,
DEC
,
"rtsp_transport"
},
RTSP_FLAG_OPTS
(
"rtsp_flags"
,
"RTSP flags"
),
RTSP_MEDIATYPE_OPTS
(
"allowed_media_types"
,
"Media types to accept from the server"
),
{
"min_port"
,
"Minimum local UDP port"
,
OFFSET
(
rtp_port_min
),
AV_OPT_TYPE_INT
,
{
RTSP_RTP_PORT_MIN
},
0
,
65535
,
DEC
|
ENC
},
{
"max_port"
,
"Maximum local UDP port"
,
OFFSET
(
rtp_port_max
),
AV_OPT_TYPE_INT
,
{
RTSP_RTP_PORT_MAX
},
0
,
65535
,
DEC
|
ENC
},
{
NULL
},
};
...
...
@@ -1121,7 +1123,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
/* XXX: we assume the same server is used for the control of each
* RTSP stream */
for
(
j
=
RTSP_RTP_PORT_MIN
,
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
++
i
)
{
for
(
j
=
rt
->
rtp_port_min
,
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
++
i
)
{
char
transport
[
2048
];
/*
...
...
@@ -1158,7 +1160,7 @@ int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
}
/* first try in specified port range */
while
(
j
<=
RTSP_RTP_PORT_MAX
)
{
while
(
j
<=
rt
->
rtp_port_max
)
{
ff_url_join
(
buf
,
sizeof
(
buf
),
"rtp"
,
NULL
,
host
,
-
1
,
"?localport=%d"
,
j
);
/* we will use two ports per rtp stream (rtp and rtcp) */
...
...
@@ -1356,6 +1358,13 @@ int ff_rtsp_connect(AVFormatContext *s)
struct
sockaddr_storage
peer
;
socklen_t
peer_len
=
sizeof
(
peer
);
if
(
rt
->
rtp_port_max
<
rt
->
rtp_port_min
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Invalid UDP port range, max port %d less "
"than min port %d
\n
"
,
rt
->
rtp_port_max
,
rt
->
rtp_port_min
);
return
AVERROR
(
EINVAL
);
}
if
(
!
ff_network_init
())
return
AVERROR
(
EIO
);
...
...
libavformat/rtsp.h
浏览文件 @
dbb06b8c
...
...
@@ -359,6 +359,11 @@ typedef struct RTSPState {
* Mask of all requested media types
*/
int
media_type_mask
;
/**
* Minimum and maximum local UDP ports.
*/
int
rtp_port_min
,
rtp_port_max
;
}
RTSPState
;
#define RTSP_FLAG_FILTER_SRC 0x1
/**< Filter incoming UDP packets -
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录