ffmpeg | branch: master | Derek Buitenhuis <derek.buitenh...@gmail.com> | Mon Apr 18 15:47:05 2016 +0100| [299d4f9428c2f4d16a1575d80d80caacdd850606] | committer: Derek Buitenhuis
Merge commit 'ccea588f831906084b8c8235222920e6984beb72' * commit 'ccea588f831906084b8c8235222920e6984beb72': avio: Add an option 'rw_timeout' Merged-by: Derek Buitenhuis <derek.buitenh...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=299d4f9428c2f4d16a1575d80d80caacdd850606 --- doc/protocols.texi | 8 ++++++++ libavformat/avio.c | 5 ++++- libavformat/version.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index 375d042..cfd7be7 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -36,6 +36,14 @@ particular protocol using the option The option "-protocols" of the ff* tools will display the list of supported protocols. +All protocols accept the following options: + +@table @option +@item rw_timeout +Maximum time to wait for (network) read/write operations to complete, +in microseconds. +@end table + A description of the currently available protocols follows. @section async diff --git a/libavformat/avio.c b/libavformat/avio.c index 4b10dd8..7e68c9a 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -56,6 +56,7 @@ static void *urlcontext_child_next(void *obj, void *prev) static const AVOption options[] = { {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, + {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM }, { NULL } }; @@ -388,8 +389,10 @@ static inline int retry_transfer_wrapper(URLContext *h, uint8_t *buf, } } else if (ret < 1) return (ret < 0 && ret != AVERROR_EOF) ? ret : len; - if (ret) + if (ret) { fast_retries = FFMAX(fast_retries, 2); + wait_since = 0; + } len += ret; } return len; diff --git a/libavformat/version.h b/libavformat/version.h index 8504468..93b87eb 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -31,7 +31,7 @@ #define LIBAVFORMAT_VERSION_MAJOR 57 #define LIBAVFORMAT_VERSION_MINOR 34 -#define LIBAVFORMAT_VERSION_MICRO 101 +#define LIBAVFORMAT_VERSION_MICRO 102 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ ====================================================================== diff --cc doc/protocols.texi index 375d042,c0663ac..cfd7be7 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@@ -33,63 -14,19 +33,71 @@@ option "--enable-protocol=@var{PROTOCOL particular protocol using the option "--disable-protocol=@var{PROTOCOL}". -The option "-protocols" of the av* tools will display the list of +The option "-protocols" of the ff* tools will display the list of supported protocols. + All protocols accept the following options: + + @table @option + @item rw_timeout + Maximum time to wait for (network) read/write operations to complete, + in microseconds. + @end table + A description of the currently available protocols follows. +@section async + +Asynchronous data filling wrapper for input stream. + +Fill data in a background thread, to decouple I/O operation from demux thread. + +@example +async:@var{URL} +async:http://host/resource +async:cache:http://host/resource +@end example + +@section bluray + +Read BluRay playlist. + +The accepted options are: +@table @option + +@item angle +BluRay angle + +@item chapter +Start chapter (1...N) + +@item playlist +Playlist to read (BDMV/PLAYLIST/?????.mpls) + +@end table + +Examples: + +Read longest playlist from BluRay mounted to /mnt/bluray: +@example +bluray:/mnt/bluray +@end example + +Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start from chapter 2: +@example +-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray +@end example + +@section cache + +Caching wrapper for input stream. + +Cache the input stream to temporary file. It brings seeking capability to live streams. + +@example +cache:@var{URL} +@end example + @section concat Physical concatenation protocol. diff --cc libavformat/avio.c index 4b10dd8,6039990..7e68c9a --- a/libavformat/avio.c +++ b/libavformat/avio.c @@@ -50,15 -49,10 +50,16 @@@ static void *urlcontext_child_next(voi return NULL; } +#define OFFSET(x) offsetof(URLContext,x) +#define E AV_OPT_FLAG_ENCODING_PARAM +#define D AV_OPT_FLAG_DECODING_PARAM static const AVOption options[] = { - { "rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM }, + {"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, + {"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, CHAR_MIN, CHAR_MAX, D }, ++ {"rw_timeout", "Timeout for IO operations (in microseconds)", offsetof(URLContext, rw_timeout), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, INT64_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_DECODING_PARAM }, { NULL } }; + const AVClass ffurl_context_class = { .class_name = "URLContext", .item_name = urlcontext_to_name, @@@ -388,9 -226,13 +389,11 @@@ static inline int retry_transfer_wrappe } } else if (ret < 1) return (ret < 0 && ret != AVERROR_EOF) ? ret : len; - if (ret) + if (ret) { fast_retries = FFMAX(fast_retries, 2); + wait_since = 0; + } len += ret; - if (ff_check_interrupt(&h->interrupt_callback)) - return AVERROR_EXIT; } return len; } diff --cc libavformat/version.h index 8504468,75d765b..93b87eb --- a/libavformat/version.h +++ b/libavformat/version.h @@@ -29,9 -29,9 +29,9 @@@ #include "libavutil/version.h" -#define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 5 -#define LIBAVFORMAT_VERSION_MICRO 1 +#define LIBAVFORMAT_VERSION_MAJOR 57 +#define LIBAVFORMAT_VERSION_MINOR 34 - #define LIBAVFORMAT_VERSION_MICRO 101 ++#define LIBAVFORMAT_VERSION_MICRO 102 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ LIBAVFORMAT_VERSION_MINOR, \ _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog