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
163a3113
Commit
163a3113
authored
Nov 05, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avio: add and use ffurl_protocol_next().
parent
6ef350c1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
8 deletions
+18
-8
avio.c
libavformat/avio.c
+11
-8
url.h
libavformat/url.h
+7
-0
No files found.
libavformat/avio.c
View file @
163a3113
...
...
@@ -30,6 +30,13 @@
#endif
#include "url.h"
static
URLProtocol
*
first_protocol
=
NULL
;
URLProtocol
*
ffurl_protocol_next
(
URLProtocol
*
prev
)
{
return
prev
?
prev
->
next
:
first_protocol
;
}
/** @name Logging context. */
/*@{*/
static
const
char
*
urlcontext_to_name
(
void
*
ptr
)
...
...
@@ -49,21 +56,19 @@ static const AVClass urlcontext_class = {
static
int
default_interrupt_cb
(
void
);
URLProtocol
*
first_protocol
=
NULL
;
int
(
*
url_interrupt_cb
)(
void
)
=
default_interrupt_cb
;
#if FF_API_OLD_AVIO
URLProtocol
*
av_protocol_next
(
URLProtocol
*
p
)
{
if
(
p
)
return
p
->
next
;
else
return
first_protocol
;
return
ffurl_protocol_next
(
p
);
}
#endif
const
char
*
avio_enum_protocols
(
void
**
opaque
,
int
output
)
{
URLProtocol
**
p
=
opaque
;
*
p
=
*
p
?
(
*
p
)
->
next
:
first_protocol
;
*
p
=
ffurl_protocol_next
(
*
p
)
;
if
(
!*
p
)
return
NULL
;
if
((
output
&&
(
*
p
)
->
url_write
)
||
(
!
output
&&
(
*
p
)
->
url_read
))
return
(
*
p
)
->
name
;
...
...
@@ -225,7 +230,7 @@ int av_register_protocol2(URLProtocol *protocol, int size)
int
ffurl_alloc
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
,
const
AVIOInterruptCB
*
int_cb
)
{
URLProtocol
*
up
;
URLProtocol
*
up
=
NULL
;
char
proto_str
[
128
],
proto_nested
[
128
],
*
ptr
;
size_t
proto_len
=
strspn
(
filename
,
URL_SCHEME_CHARS
);
...
...
@@ -238,14 +243,12 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
if
((
ptr
=
strchr
(
proto_nested
,
'+'
)))
*
ptr
=
'\0'
;
up
=
first_protocol
;
while
(
up
!=
NULL
)
{
while
(
up
=
ffurl_protocol_next
(
up
))
{
if
(
!
strcmp
(
proto_str
,
up
->
name
))
return
url_alloc_for_protocol
(
puc
,
up
,
filename
,
flags
,
int_cb
);
if
(
up
->
flags
&
URL_PROTOCOL_FLAG_NESTED_SCHEME
&&
!
strcmp
(
proto_nested
,
up
->
name
))
return
url_alloc_for_protocol
(
puc
,
up
,
filename
,
flags
,
int_cb
);
up
=
up
->
next
;
}
*
puc
=
NULL
;
return
AVERROR
(
ENOENT
);
...
...
libavformat/url.h
View file @
163a3113
...
...
@@ -182,6 +182,13 @@ int ffurl_register_protocol(URLProtocol *protocol, int size);
*/
int
ff_check_interrupt
(
AVIOInterruptCB
*
cb
);
/**
* Iterate over all available protocols.
*
* @param prev result of the previous call to this functions or NULL.
*/
URLProtocol
*
ffurl_protocol_next
(
URLProtocol
*
prev
);
/* udp.c */
int
ff_udp_set_remote_url
(
URLContext
*
h
,
const
char
*
uri
);
int
ff_udp_get_local_port
(
URLContext
*
h
);
...
...
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