[FFmpeg-cvslog] doc/protocols/tcp, lavf/tcp: apply minor fixes to TCP protocol documentation
Stefano Sabatini
git at videolan.org
Wed Dec 25 18:53:01 CET 2013
ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Tue Dec 24 16:27:34 2013 +0100| [1b4da43ce02452843a1e9bb976da1a39e18a945c] | committer: Stefano Sabatini
doc/protocols/tcp,lavf/tcp: apply minor fixes to TCP protocol documentation
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b4da43ce02452843a1e9bb976da1a39e18a945c
---
doc/protocols.texi | 25 +++++++++++++++++--------
libavformat/tcp.c | 4 ++--
2 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/doc/protocols.texi b/doc/protocols.texi
index 211e125..20ab8e6 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -897,23 +897,32 @@ The required syntax for a TCP url is:
tcp://@var{hostname}:@var{port}[?@var{options}]
@end example
- at table @option
+ at var{options} contains a list of &-separated options of the form
+ at var{key}=@var{val}.
- at item listen
-Listen for an incoming connection
+The list of supported options follows.
+
+ at table @option
+ at item listen=@var{1|0}
+Listen for an incoming connection. Default value is 0.
@item timeout=@var{microseconds}
-In read mode: if no data arrived in more than this time interval, raise error.
-In write mode: if socket cannot be written in more than this time interval, raise error.
-This also sets timeout on TCP connection establishing.
+Set raise error timeout, expressed in microseconds.
+This option is only relevant in read mode: if no data arrived in more
+than this time interval, raise error.
+
+ at item listen_timeout=@var{microseconds}
+Set listen timeout, expressed in microseconds.
+ at end table
+
+The following example shows how to setup a listening TCP connection
+with @command{ffmpeg}, which is then accessed with @command{ffplay}:
@example
ffmpeg -i @var{input} -f @var{format} tcp://@var{hostname}:@var{port}?listen
ffplay tcp://@var{hostname}:@var{port}
@end example
- at end table
-
@section tls
Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 07026e3..e457fba 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -44,8 +44,8 @@ typedef struct TCPContext {
#define E AV_OPT_FLAG_ENCODING_PARAM
static const AVOption options[] = {
{"listen", "listen on port instead of connecting", OFFSET(listen), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, D|E },
-{"timeout", "timeout of socket i/o operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
-{"listen_timeout", "connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
+{"timeout", "set timeout of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
+{"listen_timeout", "set connection awaiting timeout", OFFSET(listen_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
{NULL}
};
More information about the ffmpeg-cvslog
mailing list