Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
63c07a95
Commit
63c07a95
authored
Jul 03, 2015
by
Stephan Holljes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/avio: add avio_accept and avio_handshake
Signed-off-by:
Stephan Holljes
<
klaxa1337@googlemail.com
>
parent
5125e4b5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
avio.h
libavformat/avio.h
+29
-0
aviobuf.c
libavformat/aviobuf.c
+17
-0
No files found.
libavformat/avio.h
View file @
63c07a95
...
...
@@ -648,4 +648,33 @@ struct AVBPrint;
*/
int
avio_read_to_bprint
(
AVIOContext
*
h
,
struct
AVBPrint
*
pb
,
size_t
max_size
);
/**
* Accept and allocate a client context on a server context.
* @param s the server context
* @param c the client context, must be unallocated
* @return >= 0 on success or a negative value corresponding
* to an AVERROR on failure
*/
int
avio_accept
(
AVIOContext
*
s
,
AVIOContext
**
c
);
/**
* Perform one step of the protocol handshake to accept a new client.
* This function must be called on a client returned by avio_accept() before
* using it as a read/write context.
* It is separate from avio_accept() because it may block.
* A step of the handshake is defined by places where the application may
* decide to change the proceedings.
* For example, on a protocol with a request header and a reply header, each
* one can constitute a step because the application may use the parameters
* from the request to change parameters in the reply; or each individual
* chunk of the request can constitute a step.
* If the handshake is already finished, avio_handshake() does nothing and
* returns 0 immediately.
*
* @param c the client context to perform the handshake on
* @return 0 on a complete and successful handshake
* > 0 if the handshake progressed, but is not complete
* < 0 for an AVERROR code
*/
int
avio_handshake
(
AVIOContext
*
c
);
#endif
/* AVFORMAT_AVIO_H */
libavformat/aviobuf.c
View file @
63c07a95
...
...
@@ -1021,6 +1021,23 @@ int avio_read_to_bprint(AVIOContext *h, AVBPrint *pb, size_t max_size)
return
0
;
}
int
avio_accept
(
AVIOContext
*
s
,
AVIOContext
**
c
)
{
int
ret
;
URLContext
*
sc
=
s
->
opaque
;
URLContext
*
cc
=
NULL
;
ret
=
ffurl_accept
(
sc
,
&
cc
);
if
(
ret
<
0
)
return
ret
;
return
ffio_fdopen
(
c
,
cc
);
}
int
avio_handshake
(
AVIOContext
*
c
)
{
URLContext
*
cc
=
c
->
opaque
;
return
ffurl_handshake
(
cc
);
}
/* output in a dynamic buffer */
typedef
struct
DynBuffer
{
...
...
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