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
5125e4b5
Commit
5125e4b5
authored
Jul 03, 2015
by
Stephan Holljes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/avio: add ffurl_accept and ffurl_handshake
Signed-off-by:
Stephan Holljes
<
klaxa1337@googlemail.com
>
parent
cf6c871b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
avio.c
libavformat/avio.c
+20
-0
url.h
libavformat/url.h
+25
-0
No files found.
libavformat/avio.c
View file @
5125e4b5
...
...
@@ -211,6 +211,26 @@ int ffurl_connect(URLContext *uc, AVDictionary **options)
return
0
;
}
int
ffurl_accept
(
URLContext
*
s
,
URLContext
**
c
)
{
av_assert0
(
!*
c
);
if
(
s
->
prot
->
url_accept
)
return
s
->
prot
->
url_accept
(
s
,
c
);
return
AVERROR
(
EBADF
);
}
int
ffurl_handshake
(
URLContext
*
c
)
{
int
ret
;
if
(
c
->
prot
->
url_handshake
)
{
ret
=
c
->
prot
->
url_handshake
(
c
);
if
(
ret
)
return
ret
;
}
c
->
is_connected
=
1
;
return
0
;
}
#define URL_SCHEME_CHARS \
"abcdefghijklmnopqrstuvwxyz" \
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" \
...
...
libavformat/url.h
View file @
5125e4b5
...
...
@@ -58,6 +58,8 @@ typedef struct URLProtocol {
* for those nested protocols.
*/
int
(
*
url_open2
)(
URLContext
*
h
,
const
char
*
url
,
int
flags
,
AVDictionary
**
options
);
int
(
*
url_accept
)(
URLContext
*
s
,
URLContext
**
c
);
int
(
*
url_handshake
)(
URLContext
*
c
);
/**
* Read data from the protocol.
...
...
@@ -139,6 +141,29 @@ int ffurl_connect(URLContext *uc, AVDictionary **options);
int
ffurl_open
(
URLContext
**
puc
,
const
char
*
filename
,
int
flags
,
const
AVIOInterruptCB
*
int_cb
,
AVDictionary
**
options
);
/**
* Accept an URLContext c on an URLContext s
*
* @param s server context
* @param c client context, must be unallocated.
* @return >= 0 on success, ff_neterrno() on failure.
*/
int
ffurl_accept
(
URLContext
*
s
,
URLContext
**
c
);
/**
* Perform one step of the protocol handshake to accept a new client.
* See avio_handshake() for details.
* Implementations should try to return decreasing values.
* If the protocol uses an underlying protocol, the underlying handshake is
* usually the first step, and the return value can be:
* (largest value for this protocol) + (return value from other protocol)
*
* @param c the client context
* @return >= 0 on success or a negative value corresponding
* to an AVERROR code on failure
*/
int
ffurl_handshake
(
URLContext
*
c
);
/**
* Read up to size bytes from the resource accessed by h, and store
* the read bytes in buf.
...
...
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