aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/url.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-08-01 03:00:01 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-08-01 03:08:04 +0200
commit55ea31ab8981716a3ba1d2ae5521e62ff4494791 (patch)
tree32357f472fffb499f40cc28861881c1d425daf87 /libavformat/url.h
parent6d175158e914f042d4dc3a67688456cd0b9d8c62 (diff)
parent25410c524ddee98c579c7a9ddaf0535278a6dae0 (diff)
downloadffmpeg-55ea31ab8981716a3ba1d2ae5521e62ff4494791.tar.gz
Merge branch 'simple_http_server_api_implementation' of http://git.klaxa.eu/git/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org> Merged-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/url.h')
-rw-r--r--libavformat/url.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/libavformat/url.h b/libavformat/url.h
index 99a3201cf6..391e3bca2a 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -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.
@@ -140,6 +142,29 @@ 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.
*