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
8c62d83f
Commit
8c62d83f
authored
Feb 14, 2012
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hlsproto: Rename the functions and context
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9cb9c6c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
hlsproto.c
libavformat/hlsproto.c
+20
-20
No files found.
libavformat/hlsproto.c
View file @
8c62d83f
...
@@ -54,7 +54,7 @@ struct variant {
...
@@ -54,7 +54,7 @@ struct variant {
char
url
[
MAX_URL_SIZE
];
char
url
[
MAX_URL_SIZE
];
};
};
typedef
struct
AppleHTTP
Context
{
typedef
struct
HLS
Context
{
char
playlisturl
[
MAX_URL_SIZE
];
char
playlisturl
[
MAX_URL_SIZE
];
int
target_duration
;
int
target_duration
;
int
start_seq_no
;
int
start_seq_no
;
...
@@ -66,7 +66,7 @@ typedef struct AppleHTTPContext {
...
@@ -66,7 +66,7 @@ typedef struct AppleHTTPContext {
int
cur_seq_no
;
int
cur_seq_no
;
URLContext
*
seg_hd
;
URLContext
*
seg_hd
;
int64_t
last_load_time
;
int64_t
last_load_time
;
}
AppleHTTP
Context
;
}
HLS
Context
;
static
int
read_chomp_line
(
AVIOContext
*
s
,
char
*
buf
,
int
maxlen
)
static
int
read_chomp_line
(
AVIOContext
*
s
,
char
*
buf
,
int
maxlen
)
{
{
...
@@ -76,7 +76,7 @@ static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
...
@@ -76,7 +76,7 @@ static int read_chomp_line(AVIOContext *s, char *buf, int maxlen)
return
len
;
return
len
;
}
}
static
void
free_segment_list
(
AppleHTTP
Context
*
s
)
static
void
free_segment_list
(
HLS
Context
*
s
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
s
->
n_segments
;
i
++
)
for
(
i
=
0
;
i
<
s
->
n_segments
;
i
++
)
...
@@ -85,7 +85,7 @@ static void free_segment_list(AppleHTTPContext *s)
...
@@ -85,7 +85,7 @@ static void free_segment_list(AppleHTTPContext *s)
s
->
n_segments
=
0
;
s
->
n_segments
=
0
;
}
}
static
void
free_variant_list
(
AppleHTTP
Context
*
s
)
static
void
free_variant_list
(
HLS
Context
*
s
)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
s
->
n_variants
;
i
++
)
for
(
i
=
0
;
i
<
s
->
n_variants
;
i
++
)
...
@@ -109,7 +109,7 @@ static void handle_variant_args(struct variant_info *info, const char *key,
...
@@ -109,7 +109,7 @@ static void handle_variant_args(struct variant_info *info, const char *key,
static
int
parse_playlist
(
URLContext
*
h
,
const
char
*
url
)
static
int
parse_playlist
(
URLContext
*
h
,
const
char
*
url
)
{
{
AppleHTTP
Context
*
s
=
h
->
priv_data
;
HLS
Context
*
s
=
h
->
priv_data
;
AVIOContext
*
in
;
AVIOContext
*
in
;
int
ret
=
0
,
duration
=
0
,
is_segment
=
0
,
is_variant
=
0
,
bandwidth
=
0
;
int
ret
=
0
,
duration
=
0
,
is_segment
=
0
,
is_variant
=
0
,
bandwidth
=
0
;
char
line
[
1024
];
char
line
[
1024
];
...
@@ -175,9 +175,9 @@ fail:
...
@@ -175,9 +175,9 @@ fail:
return
ret
;
return
ret
;
}
}
static
int
applehttp
_close
(
URLContext
*
h
)
static
int
hls
_close
(
URLContext
*
h
)
{
{
AppleHTTP
Context
*
s
=
h
->
priv_data
;
HLS
Context
*
s
=
h
->
priv_data
;
free_segment_list
(
s
);
free_segment_list
(
s
);
free_variant_list
(
s
);
free_variant_list
(
s
);
...
@@ -185,9 +185,9 @@ static int applehttp_close(URLContext *h)
...
@@ -185,9 +185,9 @@ static int applehttp_close(URLContext *h)
return
0
;
return
0
;
}
}
static
int
applehttp
_open
(
URLContext
*
h
,
const
char
*
uri
,
int
flags
)
static
int
hls
_open
(
URLContext
*
h
,
const
char
*
uri
,
int
flags
)
{
{
AppleHTTP
Context
*
s
=
h
->
priv_data
;
HLS
Context
*
s
=
h
->
priv_data
;
int
ret
,
i
;
int
ret
,
i
;
const
char
*
nested_url
;
const
char
*
nested_url
;
...
@@ -258,13 +258,13 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
...
@@ -258,13 +258,13 @@ static int applehttp_open(URLContext *h, const char *uri, int flags)
return
0
;
return
0
;
fail:
fail:
applehttp
_close
(
h
);
hls
_close
(
h
);
return
ret
;
return
ret
;
}
}
static
int
applehttp
_read
(
URLContext
*
h
,
uint8_t
*
buf
,
int
size
)
static
int
hls
_read
(
URLContext
*
h
,
uint8_t
*
buf
,
int
size
)
{
{
AppleHTTP
Context
*
s
=
h
->
priv_data
;
HLS
Context
*
s
=
h
->
priv_data
;
const
char
*
url
;
const
char
*
url
;
int
ret
;
int
ret
;
int64_t
reload_interval
;
int64_t
reload_interval
;
...
@@ -329,19 +329,19 @@ retry:
...
@@ -329,19 +329,19 @@ retry:
#if FF_API_APPLEHTTP_PROTO
#if FF_API_APPLEHTTP_PROTO
URLProtocol
ff_applehttp_protocol
=
{
URLProtocol
ff_applehttp_protocol
=
{
.
name
=
"applehttp"
,
.
name
=
"applehttp"
,
.
url_open
=
applehttp
_open
,
.
url_open
=
hls
_open
,
.
url_read
=
applehttp
_read
,
.
url_read
=
hls
_read
,
.
url_close
=
applehttp
_close
,
.
url_close
=
hls
_close
,
.
flags
=
URL_PROTOCOL_FLAG_NESTED_SCHEME
,
.
flags
=
URL_PROTOCOL_FLAG_NESTED_SCHEME
,
.
priv_data_size
=
sizeof
(
AppleHTTP
Context
),
.
priv_data_size
=
sizeof
(
HLS
Context
),
};
};
#endif
#endif
URLProtocol
ff_hls_protocol
=
{
URLProtocol
ff_hls_protocol
=
{
.
name
=
"hls"
,
.
name
=
"hls"
,
.
url_open
=
applehttp
_open
,
.
url_open
=
hls
_open
,
.
url_read
=
applehttp
_read
,
.
url_read
=
hls
_read
,
.
url_close
=
applehttp
_close
,
.
url_close
=
hls
_close
,
.
flags
=
URL_PROTOCOL_FLAG_NESTED_SCHEME
,
.
flags
=
URL_PROTOCOL_FLAG_NESTED_SCHEME
,
.
priv_data_size
=
sizeof
(
AppleHTTP
Context
),
.
priv_data_size
=
sizeof
(
HLS
Context
),
};
};
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