Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
8bf0f969
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,发现更多精彩内容 >>
提交
8bf0f969
编写于
10月 21, 2010
作者:
M
Martin Storsjö
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rtsp: Reorder functions
Originally committed as revision 25534 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
b4a6c8fb
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
38 addition
and
38 deletion
+38
-38
libavformat/rtsp.c
libavformat/rtsp.c
+38
-38
未找到文件。
libavformat/rtsp.c
浏览文件 @
8bf0f969
...
...
@@ -87,6 +87,44 @@ static void get_word(char *buf, int buf_size, const char **pp)
get_word_until_chars
(
buf
,
buf_size
,
SPACE_CHARS
,
pp
);
}
/** Parse a string p in the form of Range:npt=xx-xx, and determine the start
* and end time.
* Used for seeking in the rtp stream.
*/
static
void
rtsp_parse_range_npt
(
const
char
*
p
,
int64_t
*
start
,
int64_t
*
end
)
{
char
buf
[
256
];
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
!
av_stristart
(
p
,
"npt="
,
&
p
))
return
;
*
start
=
AV_NOPTS_VALUE
;
*
end
=
AV_NOPTS_VALUE
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
start
=
parse_date
(
buf
,
1
);
if
(
*
p
==
'-'
)
{
p
++
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
end
=
parse_date
(
buf
,
1
);
}
// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
}
static
int
get_sockaddr
(
const
char
*
buf
,
struct
sockaddr_storage
*
sock
)
{
struct
addrinfo
hints
,
*
ai
=
NULL
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_NUMERICHOST
;
if
(
getaddrinfo
(
buf
,
NULL
,
&
hints
,
&
ai
))
return
-
1
;
memcpy
(
sock
,
ai
->
ai_addr
,
FFMIN
(
sizeof
(
*
sock
),
ai
->
ai_addrlen
));
freeaddrinfo
(
ai
);
return
0
;
}
/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
static
int
sdp_parse_rtpmap
(
AVFormatContext
*
s
,
AVCodecContext
*
codec
,
RTSPStream
*
rtsp_st
,
...
...
@@ -186,44 +224,6 @@ int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
return
0
;
}
/** Parse a string p in the form of Range:npt=xx-xx, and determine the start
* and end time.
* Used for seeking in the rtp stream.
*/
static
void
rtsp_parse_range_npt
(
const
char
*
p
,
int64_t
*
start
,
int64_t
*
end
)
{
char
buf
[
256
];
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
!
av_stristart
(
p
,
"npt="
,
&
p
))
return
;
*
start
=
AV_NOPTS_VALUE
;
*
end
=
AV_NOPTS_VALUE
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
start
=
parse_date
(
buf
,
1
);
if
(
*
p
==
'-'
)
{
p
++
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
end
=
parse_date
(
buf
,
1
);
}
// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
}
static
int
get_sockaddr
(
const
char
*
buf
,
struct
sockaddr_storage
*
sock
)
{
struct
addrinfo
hints
,
*
ai
=
NULL
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_NUMERICHOST
;
if
(
getaddrinfo
(
buf
,
NULL
,
&
hints
,
&
ai
))
return
-
1
;
memcpy
(
sock
,
ai
->
ai_addr
,
FFMIN
(
sizeof
(
*
sock
),
ai
->
ai_addrlen
));
freeaddrinfo
(
ai
);
return
0
;
}
typedef
struct
SDPParseState
{
/* SDP only */
struct
sockaddr_storage
default_ip
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录