Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
65cd7bf3
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,发现更多精彩内容 >>
提交
65cd7bf3
编写于
2月 14, 2012
作者:
M
Martin Storsjö
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
hls: Rename the functions and context
Signed-off-by:
N
Martin Storsjö
<
martin@martin.st
>
上级
2772258a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
22 deletion
+22
-22
libavformat/hls.c
libavformat/hls.c
+22
-22
未找到文件。
libavformat/hls.c
浏览文件 @
65cd7bf3
...
...
@@ -93,7 +93,7 @@ struct variant {
uint8_t
key
[
16
];
};
typedef
struct
AppleHTTP
Context
{
typedef
struct
HLS
Context
{
int
n_variants
;
struct
variant
**
variants
;
int
cur_seq_no
;
...
...
@@ -101,7 +101,7 @@ typedef struct AppleHTTPContext {
int
first_packet
;
int64_t
first_timestamp
;
AVIOInterruptCB
*
interrupt_callback
;
}
AppleHTTP
Context
;
}
HLS
Context
;
static
int
read_chomp_line
(
AVIOContext
*
s
,
char
*
buf
,
int
maxlen
)
{
...
...
@@ -120,7 +120,7 @@ static void free_segment_list(struct variant *var)
var
->
n_segments
=
0
;
}
static
void
free_variant_list
(
AppleHTTP
Context
*
c
)
static
void
free_variant_list
(
HLS
Context
*
c
)
{
int
i
;
for
(
i
=
0
;
i
<
c
->
n_variants
;
i
++
)
{
...
...
@@ -150,7 +150,7 @@ static void reset_packet(AVPacket *pkt)
pkt
->
data
=
NULL
;
}
static
struct
variant
*
new_variant
(
AppleHTTP
Context
*
c
,
int
bandwidth
,
static
struct
variant
*
new_variant
(
HLS
Context
*
c
,
int
bandwidth
,
const
char
*
url
,
const
char
*
base
)
{
struct
variant
*
var
=
av_mallocz
(
sizeof
(
struct
variant
));
...
...
@@ -197,7 +197,7 @@ static void handle_key_args(struct key_info *info, const char *key,
}
}
static
int
parse_playlist
(
AppleHTTP
Context
*
c
,
const
char
*
url
,
static
int
parse_playlist
(
HLS
Context
*
c
,
const
char
*
url
,
struct
variant
*
var
,
AVIOContext
*
in
)
{
int
ret
=
0
,
duration
=
0
,
is_segment
=
0
,
is_variant
=
0
,
bandwidth
=
0
;
...
...
@@ -371,7 +371,7 @@ static int open_input(struct variant *var)
static
int
read_data
(
void
*
opaque
,
uint8_t
*
buf
,
int
buf_size
)
{
struct
variant
*
v
=
opaque
;
AppleHTTP
Context
*
c
=
v
->
parent
->
priv_data
;
HLS
Context
*
c
=
v
->
parent
->
priv_data
;
int
ret
,
i
;
restart:
...
...
@@ -443,9 +443,9 @@ reload:
goto
restart
;
}
static
int
applehttp
_read_header
(
AVFormatContext
*
s
)
static
int
hls
_read_header
(
AVFormatContext
*
s
)
{
AppleHTTP
Context
*
c
=
s
->
priv_data
;
HLS
Context
*
c
=
s
->
priv_data
;
int
ret
=
0
,
i
,
j
,
stream_offset
=
0
;
c
->
interrupt_callback
=
&
s
->
interrupt_callback
;
...
...
@@ -554,7 +554,7 @@ fail:
static
int
recheck_discard_flags
(
AVFormatContext
*
s
,
int
first
)
{
AppleHTTP
Context
*
c
=
s
->
priv_data
;
HLS
Context
*
c
=
s
->
priv_data
;
int
i
,
changed
=
0
;
/* Check if any new streams are needed */
...
...
@@ -587,9 +587,9 @@ static int recheck_discard_flags(AVFormatContext *s, int first)
return
changed
;
}
static
int
applehttp
_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
hls
_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
AppleHTTP
Context
*
c
=
s
->
priv_data
;
HLS
Context
*
c
=
s
->
priv_data
;
int
ret
,
i
,
minvariant
=
-
1
;
if
(
c
->
first_packet
)
{
...
...
@@ -635,18 +635,18 @@ start:
return
AVERROR_EOF
;
}
static
int
applehttp
_close
(
AVFormatContext
*
s
)
static
int
hls
_close
(
AVFormatContext
*
s
)
{
AppleHTTP
Context
*
c
=
s
->
priv_data
;
HLS
Context
*
c
=
s
->
priv_data
;
free_variant_list
(
c
);
return
0
;
}
static
int
applehttp
_read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
static
int
hls
_read_seek
(
AVFormatContext
*
s
,
int
stream_index
,
int64_t
timestamp
,
int
flags
)
{
AppleHTTP
Context
*
c
=
s
->
priv_data
;
HLS
Context
*
c
=
s
->
priv_data
;
int
i
,
j
,
ret
;
if
((
flags
&
AVSEEK_FLAG_BYTE
)
||
!
c
->
variants
[
0
]
->
finished
)
...
...
@@ -686,7 +686,7 @@ static int applehttp_read_seek(AVFormatContext *s, int stream_index,
return
ret
;
}
static
int
applehttp
_probe
(
AVProbeData
*
p
)
static
int
hls
_probe
(
AVProbeData
*
p
)
{
/* Require #EXTM3U at the start, and either one of the ones below
* somewhere for a proper match. */
...
...
@@ -702,10 +702,10 @@ static int applehttp_probe(AVProbeData *p)
AVInputFormat
ff_hls_demuxer
=
{
.
name
=
"hls"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"Apple HTTP Live Streaming format"
),
.
priv_data_size
=
sizeof
(
AppleHTTP
Context
),
.
read_probe
=
applehttp
_probe
,
.
read_header
=
applehttp
_read_header
,
.
read_packet
=
applehttp
_read_packet
,
.
read_close
=
applehttp
_close
,
.
read_seek
=
applehttp
_read_seek
,
.
priv_data_size
=
sizeof
(
HLS
Context
),
.
read_probe
=
hls
_probe
,
.
read_header
=
hls
_read_header
,
.
read_packet
=
hls
_read_packet
,
.
read_close
=
hls
_close
,
.
read_seek
=
hls
_read_seek
,
};
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录