summaryrefslogtreecommitdiff
path: root/libavformat/network.h
diff options
context:
space:
mode:
authorAndrey Utkin <andrey.krieger.utkin@gmail.com>2012-10-09 15:26:02 +0300
committerMichael Niedermayer <michaelni@gmx.at>2012-10-09 17:17:05 +0200
commitd2b18c8f5b085d753bba315ce0d8d8da7c35e433 (patch)
treefe7dd54dc1316ceec7c0b40da8fe398516416da5 /libavformat/network.h
parent3a45688abc5c98c91fc6a1b0b8b68f0eca641aec (diff)
downloadffmpeg-d2b18c8f5b085d753bba315ce0d8d8da7c35e433.tar.gz
Introduce ff_network_wait_fd_timeout()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/network.h')
-rw-r--r--libavformat/network.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/network.h b/libavformat/network.h
index cce188f464..51d855daf9 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -26,6 +26,7 @@
#include "config.h"
#include "libavutil/error.h"
#include "os_support.h"
+#include "avio.h"
#if HAVE_UNISTD_H
#include <unistd.h>
@@ -80,6 +81,18 @@ void ff_tls_deinit(void);
int ff_network_wait_fd(int fd, int write);
+/**
+ * This works similarly to ff_network_wait_fd, but waits up to 'timeout' microseconds
+ * Uses ff_network_wait_fd in a loop
+ *
+ * @fd Socket descriptor
+ * @write Set 1 to wait for socket able to be read, 0 to be written
+ * @timeout Timeout interval, in microseconds. Actual precision is 100000 mcs, due to ff_network_wait_fd usage
+ * @param int_cb Interrupt callback, is checked after each ff_network_wait_fd call
+ * @return 0 if data can be read/written, AVERROR(ETIMEDOUT) if timeout expired, or negative error code
+ */
+int ff_network_wait_fd_timeout(int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb);
+
int ff_inet_aton (const char * str, struct in_addr * add);
#if !HAVE_STRUCT_SOCKADDR_STORAGE