From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 1293B45038 for ; Wed, 28 Dec 2022 17:31:49 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AA63F68BA04; Wed, 28 Dec 2022 19:31:46 +0200 (EET) Received: from out162-62-57-87.mail.qq.com (out162-62-57-87.mail.qq.com [162.62.57.87]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AC5E968B9D5 for ; Wed, 28 Dec 2022 19:31:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1672248690; bh=GQOd4ID3obdGtmnblK6hBFLCVs+fKOcNxgMPbRVFXB0=; h=Subject:From:To:Date:In-Reply-To:References; b=cgLXOesTroukdfYPhUTbRpjvzd/mZ1qc2hfH/UiOsPGZYoVK5DUazTZg57Jmks0ju Vh4X51J5FTbVJvK0I0kuZGSeueVy7cWw3VIgoAdBExYVkATdputEeIaiE/+UgmvxYW M4THVkf3eGUy+RF3YWVrYcOMZhl6odrQgx0ie45M= Received: from zhilizhao-LC4 ([121.35.187.62]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id 7DE05630; Thu, 29 Dec 2022 01:31:30 +0800 X-QQ-mid: xmsmtpt1672248690txrf094k4 Message-ID: X-QQ-XMAILINFO: N7h1OCCDntujhRViq562jDXQIG06dZNNMQvU1H9R1kICMTpVP05hH+YjqCz3oY 1B23dV1h2FOEFsE2w0Zmtxwt3jrQbmV++iSmZASTznjbaHhHoUn0Q/eXeZ7e7zbTWrtFE+1/V1T9 2/GdkjfGL1BVUwTuH9RWBTeD3n7Mukrh77uPDZZQss0tQ2mrIpW9bg8zHfN5cA9F2Cn8TqoCUucL FHyQvj/5VW4ON4hhHVt3lDqpW0HDbTYcaCVYHC1OtKYtowWL5OLKEIB9j3eV99dXX1GG2jJt9hpJ 3zjKpEzcvzGpewurE6QWmMdAwNW7++Krzei3iBfGlAeR4igZOYhzLJYunOduQwhMkhXku5JajLdW JOtanHa5tTYEzHI6a4Ly/OYck6KpilWtnZolKoa/SPX/B2mtlCJgcgzTGhvfwVlIRK61qi20G9wx TVQAdPoAvAXL9ImgyARsJa3k/AjafdqRpAhXHRYuSmkdHVlXu5ujWDu0SARR6ujXAcKA4KFnITrb kmnHXhEviYvWNHoOZkQQnUxqCukQn2emzeOASgDUZC00+y2zmk8oQbhmC3pxY7G252tRL6t+0v52 QOyQQCDUffRVA9G2cqYLgKYLern79dEGVqii5nQTjX/wCPnqbatEUHKAi68spiZW1RB6x73aYK8D pk/jPEuBkcCmayKwaozOdfhRfWo1wOHvjX7p/+NylSbPkq+RywDkVKIc316hPl+07kg10/FtXHSe tvjCh8eWXjrf/jE4Ek4pYE2OxK1sO79ED0OOfl+nYCvfUmumuiSJcVQJTQiVJC525OoeCWrQLz9d 5WQ9c0s8IQXckbUPivxV029o19EDCOY5ghG0meqawYbnXzv0t6GxKzZSSi1Ou2r6rG4a/z73N+sp xaOJUw3IceVZ761kBUKl3UJNqhqjYubb1zZDFS2aD3gkiVI2cGwEW2OM6Yky9dbpFx1qbWIT66+L 8Gv6jzKQlSfyioINWaew== X-OQ-MSGID: From: Zhao Zhili To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Dec 2022 01:31:29 +0800 In-Reply-To: References: <20221214171014.1058709-1-quinkblack@foxmail.com> User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v3 1/8] avformat/file: add fd option for pipe X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Thu, 2022-12-15 at 01:10 +0800, Zhao Zhili wrote: > From: Zhao Zhili > > --- > doc/protocols.texi | 4 +++- > libavformat/file.c | 9 +++++++-- > libavformat/version.h | 2 +- > 3 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/doc/protocols.texi b/doc/protocols.texi > index d1c6fced7b..a686a7f0ac 100644 > --- a/doc/protocols.texi > +++ b/doc/protocols.texi > @@ -687,7 +687,7 @@ The accepted syntax is: > pipe:[@var{number}] > @end example > > -@var{number} is the number corresponding to the file descriptor of > the > +If @option{fd} isn't specified, @var{number} is the number > corresponding to the file descriptor of the > pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If > @var{number} > is not specified, by default the stdout file descriptor will be used > for writing, stdin for reading. > @@ -714,6 +714,8 @@ Set I/O operation maximum block size, in bytes. > Default value is > @code{INT_MAX}, which results in not limiting the requested block > size. > Setting this value reasonably low improves user termination request > reaction > time, which is valuable if data transmission is slow. > +@item fd > +Set file descriptor. > @end table > > Note that some formats (typically MOV), require the output protocol > to > diff --git a/libavformat/file.c b/libavformat/file.c > index 6103c37b34..db619fcaac 100644 > --- a/libavformat/file.c > +++ b/libavformat/file.c > @@ -92,6 +92,7 @@ static const AVOption file_options[] = { > > static const AVOption pipe_options[] = { > { "blocksize", "set I/O operation maximum block size", > offsetof(FileContext, blocksize), AV_OPT_TYPE_INT, { .i64 = INT_MAX > }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM }, > + { "fd", "set file descriptor", offsetof(FileContext, fd), > AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, > AV_OPT_FLAG_ENCODING_PARAM }, > { NULL } > }; > > @@ -381,6 +382,8 @@ static int pipe_open(URLContext *h, const char > *filename, int flags) > FileContext *c = h->priv_data; > int fd; > char *final; > + > + if (c->fd < 0) { > av_strstart(filename, "pipe:", &filename); > > fd = strtol(filename, &final, 10); > @@ -391,10 +394,12 @@ static int pipe_open(URLContext *h, const char > *filename, int flags) > fd = 0; > } > } > + c->fd = fd; > + } > + > #if HAVE_SETMODE > - setmode(fd, O_BINARY); > + setmode(c->fd, O_BINARY); > #endif > - c->fd = fd; > h->is_streamed = 1; > return 0; > } > diff --git a/libavformat/version.h b/libavformat/version.h > index a7e5a9ac66..63e753a3aa 100644 > --- a/libavformat/version.h > +++ b/libavformat/version.h > @@ -32,7 +32,7 @@ > #include "version_major.h" > > #define LIBAVFORMAT_VERSION_MINOR 34 > -#define LIBAVFORMAT_VERSION_MICRO 102 > +#define LIBAVFORMAT_VERSION_MICRO 103 > > #define LIBAVFORMAT_VERSION_INT > AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ > LIBAVFORMAT_VERSION_M > INOR, \ Ping for the patchset. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".