X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Furl.h;h=391e3bca2afc0492f0b0683416ffc910bfbac08b;hb=94a4be85a1fcd57fdfd45dc291813d6afef8a87b;hp=99a3201cf6c8d9da961662aab4e7c721603e3d92;hpb=8e67599505e3b0a968227a1dcd40020dff874001;p=ffmpeg diff --git a/libavformat/url.h b/libavformat/url.h index 99a3201cf6c..391e3bca2af 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. @@ -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.