X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fnetwork.h;h=efaa7893a40e3efa1ef2a97ee1c86e178587f120;hb=d25c945247979a88fac6bb3b7a26370262b96ef1;hp=b78e3ad6ed88816a661411a843c342184ab510e7;hpb=aa6f43c2e959a960792f76d006b8699d733f258f;p=ffmpeg diff --git a/libavformat/network.h b/libavformat/network.h index b78e3ad6ed8..efaa7893a40 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -75,7 +75,6 @@ int ff_neterrno(void); int ff_socket_nonblock(int socket, int enable); -extern int ff_network_inited_globally; int ff_network_init(void); void ff_network_close(void); @@ -88,15 +87,22 @@ 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 fd Socket descriptor + * @param write Set 1 to wait for socket able to be read, 0 to be written + * @param timeout Timeout interval, in microseconds. Actual precision is 100000 mcs, due to ff_network_wait_fd usage * @param int_cb Interrupt callback, is checked before 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); +/** + * Waits for up to 'timeout' microseconds. If the usert's int_cb is set and + * triggered, return before that. + * @param timeout Timeout in microseconds. Maybe have lower actual precision. + * @param int_cb Interrupt callback, is checked regularly. + * @return AVERROR(ETIMEDOUT) if timeout expirted, AVERROR_EXIT if interrupted by int_cb + */ +int ff_network_sleep_interruptible(int64_t timeout, AVIOInterruptCB *int_cb); #if !HAVE_STRUCT_SOCKADDR_STORAGE struct sockaddr_storage {