Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
65cd7bf3
Commit
65cd7bf3
authored
Feb 14, 2012
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hls: Rename the functions and context
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
2772258a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
hls.c
libavformat/hls.c
+22
-22
No files found.
libavformat/hls.c
View file @
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
,
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment