From patchwork Tue Jul 27 14:48:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29064 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4919454pxb; Tue, 27 Jul 2021 07:48:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB/pZh0qPojghwXPgJ3Hi9DyQE0X69yt8THx1sZOvljwf1SLSDYdPefT3cifzgmY0juhrD X-Received: by 2002:a50:9ae3:: with SMTP id p90mr101606edb.154.1627397321807; Tue, 27 Jul 2021 07:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397321; cv=none; d=google.com; s=arc-20160816; b=rPVnTajPP4EqqlYD6ULMDSvGpG7ERueQDaEpAS6Im5Cbm81vbJaFp3CwyRKOrpUZlj sYJqpyikHljIOl41VYl9KlOunxA4wsUoQC1wAh/h6s0ux4JGa33qoQL8Mc5J7ODcUfHE tPm1IW8WXaVA1PchtQw1PaKr7V/c+KhqeWT5rUBFbB4qGK1fj0K98sYg9Bipim6pSrwq 28iGb0aYeGbrysuyAng774AL0yqv8moZWMsYh3kBs5ylAJv3vTz7/XWEZmbOEoebkiZj xcfPc0UzZFuHdSKxra+L6cFsiJpGIWcSS9yxtm3B3Jq2tOWqbmDMcMEL9bWAAFROidwa vEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=vdX3QLIjUDanBfTs/9BLD07rgkBF9761QnJS93hbq+Q=; b=gbgCrJ3vZGFtJVfRbZAoVi9O7f4fc6cloh4+cmenXuzG6ayEsMxCZHrx4DE5KhE8L0 nTzZ+YPiRASEDCgYgX+CwWM91CEqcnKtiFCNDZHfhVM3rJ7K88NB7RvA875jxSiw9rX7 IBfm/h8dvdGzH845+xwV+FC8vhigxZEjHOedxu+GxYCqbo2PWOV2R7iJKA3bm2UAZEh4 qG9ODKMDPaHZIlFQ4QJb0d0eYF6sMPy+hlLlrs3EtK1OmJB50s9zpcfbFQF0Niiqa66N 9NM32U1QwtJ3L7qWgSbc5UfkLzWwTbBqYz/kYlltdwiMQ2pgERrQ6KV1LRzQyS0Tc8K9 G++A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id rh9si3272454ejb.525.2021.07.27.07.48.41; Tue, 27 Jul 2021 07:48:41 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C56F26808E6; Tue, 27 Jul 2021 17:48:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0AE4168072C for ; Tue, 27 Jul 2021 17:48:16 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmG1P026188 for ; Tue, 27 Jul 2021 16:48:16 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 392EBE0027; Tue, 27 Jul 2021 16:48:16 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:04 +0200 Message-Id: <20210727144813.452917-2-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:16 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 01/10] lavu/internal: add hex to int functions. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: eCzF2PzAM+cn Signed-off-by: Nicolas George --- libavutil/internal.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/libavutil/internal.h b/libavutil/internal.h index a33e8700c3..ba221438ed 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -291,4 +291,38 @@ void ff_check_pixfmt_descriptors(void); */ int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp); +/** + * Test if val is between min and max, inclusive. + */ +static inline int ff_between(unsigned min, unsigned max, unsigned val) +{ + return val - min <= max - min; +} + +/** + * Convert a hex digit to its value, -1 if not hex. + */ +static inline int ff_hexchar2int(char c) +{ + if (ff_between('0', '9', c)) + return c - '0'; + c &= ~('a' - 'A'); + if (ff_between('A', 'F', c)) + return c - 'A' + 10; + return -1; +} + +/** + * Convert a hex digit to its value, -1 if not hex. + */ +static inline int ff_hexpair2int(const char *s) +{ + int a, b; + + if ((a = ff_hexchar2int(s[0])) < 0 || + (b = ff_hexchar2int(s[1])) < 0) + return -1; + return (a << 4) | b; +} + #endif /* AVUTIL_INTERNAL_H */ From patchwork Tue Jul 27 14:48:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29063 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4919589pxb; Tue, 27 Jul 2021 07:48:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYMvej0L83SoTh1xgeKKE6STJgH/r+iEJfonqrXiM/JBSwB3bMyOEL5ESVXUf35PTftZWp X-Received: by 2002:a17:907:94c6:: with SMTP id dn6mr11769564ejc.287.1627397333220; Tue, 27 Jul 2021 07:48:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397333; cv=none; d=google.com; s=arc-20160816; b=dlabgqWUkT20yskc89dsM0hRTHZ43puUoM0w1nA2+0Va+JOALmACx5RUoY0RL+p6L8 x6QzdxcuXmUXNx+rZsBWJILXWkVENEeMFGRslG4OVF6i13daseURFIRzhxPv0Sw65pyz UYtdRK76tth+aGEVYG+haYNziYYT7TB8ekkHYbikXryUqTp6lxuzN3gD6CylWK7qTYgD OJCmGY8QJ/aR+rGKKjerHYonFAUGvgxjOWNiekFfq3OGHmr45SqghJRLyMD5a7lX0/B8 bX9WpxkQBqLnIc5puJ+zNFn0CpqVOBIwze4IdCwB+OBAA8NIU434IAxRjcewT9LNx/Ub Tiqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=YjUYSe/ZY2F2Cus/VDM2n9KPSsGrEPmyeOS/+baW7Pg=; b=zOa+FHtYtaTeQAwxSLAlcADkvBi6AcF3j1GflsfGLhHBCsllN8DMBTrAuuR1SAHot4 JAj+B7+UH/6eMkGNMDclUO4/C21SfTcdfCxWj8jv9T+2aUkon08SYoELBjBLpv/n/xvC zPSScvmp09t/2YfMHSThpLdOU/0j0S6RUDCL6C0vOj8TpMI0p/JIdFuiwyMYbOECYbeD tINPUBHhhOZjwa+d6151p3z/ToOvlOIAey/aBXMz+wY9VsFg9jqxkYhnyd1UsQ/Zmz1S d4h5tYc7k9gBb5mo2yHOK8qDBAU5CKlZIueQDV228Dh1TajpIrhEWfC1Sy4W7zLhBFr6 msIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h17si3164707edb.607.2021.07.27.07.48.52; Tue, 27 Jul 2021 07:48:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D395168A009; Tue, 27 Jul 2021 17:48:26 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B9D99689BC9 for ; Tue, 27 Jul 2021 17:48:17 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmGEo026196 for ; Tue, 27 Jul 2021 16:48:17 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id E86E1E0027; Tue, 27 Jul 2021 16:48:16 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:05 +0200 Message-Id: <20210727144813.452917-3-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:17 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 02/10] lavu/opt: use ff_hexpair2int(). 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: aNR/rlc3BeNN Signed-off-by: Nicolas George --- libavutil/opt.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 41284d4ecd..c7844d6241 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -167,16 +167,6 @@ static int write_number(void *obj, const AVOption *o, void *dst, double num, int return 0; } -static int hexchar2int(char c) { - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'a' && c <= 'f') - return c - 'a' + 10; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - return -1; -} - static int set_string_binary(void *obj, const AVOption *o, const char *val, uint8_t **dst) { int *lendst = (int *)(dst + 1); @@ -197,13 +187,13 @@ static int set_string_binary(void *obj, const AVOption *o, const char *val, uint if (!ptr) return AVERROR(ENOMEM); while (*val) { - int a = hexchar2int(*val++); - int b = hexchar2int(*val++); - if (a < 0 || b < 0) { + int a = ff_hexpair2int(val); + if (a < 0) { av_free(bin); return AVERROR(EINVAL); } - *ptr++ = (a << 4) | b; + *ptr++ = a; + val += 2; } *dst = bin; *lendst = len; From patchwork Tue Jul 27 14:48:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29070 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4919716pxb; Tue, 27 Jul 2021 07:49:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOXjO3YWJgwpfSMDxIf3B/ZYi2xG/MreMLcn6D0CkpdenXvo9AxaEdiwsv0fX2bigT65RZ X-Received: by 2002:a17:906:94cd:: with SMTP id d13mr5123490ejy.158.1627397343712; Tue, 27 Jul 2021 07:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397343; cv=none; d=google.com; s=arc-20160816; b=BljyNMYdervBWnuKZopI1+YNrTubpC9SjLguPhsw3TQSpHVoagcv196I7CAkKGm+j+ D285aMe5CWaGOTl63kLkMdRUV3tFXf/FHMt9fRb7MtmmrlA9oRkO0glpV8HZNpeBKYq8 JaRT6LAFUGYRFnH9asuKDGgQGC0PIx90m77vF0ib9zPkVhNQ94sGaUr3pKsMOs3eXtWJ /b0uWiICyYEXd1dIwkH25Iwr9Bjz4T5aU47G03yx6bFBYJgGoMLFLbXqDl4j280ovpQf THaZjQLA9WegbjHx+a8sZBwy8BqPYdU1joVEzlnzgYQIQC7l1DGqXZo0GK8EsvE+KQyv iAZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=XWQR0n8HywHimPfckrp0tXG5hqftpyqqXZ8tv0/87aY=; b=0uOnJzrTSnTsdnT/1Qhq1fBmHoSzVmREi8UYapLujH5yQGANs5TkpLZGmi3v5i9zXw hDwh2BUBaihbDwo12sx+BuXk906QX7PKYfETXCKHj+62DxS2dOIaGqTdKElZTxarkmXV xgzRXjJHowhxpgJb9kWtg4TcPmK9btX2e+Y3CNP0e0aySKWeHdCg/9rQCjzgov0b6XOJ 2uCehm9rpzOXI00XIA1lsRw4KfkK95HYehk27kcpulwO+o9M2MI+hghtdmnRKl+HTDb+ dbJEowAlRaBTM7dIbSlQFGXBgFCfmvq8iVNbE5HB0D1iW2BAzmuAqVlXTkgLicyc+PrT WbRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i11si3302671edv.472.2021.07.27.07.49.03; Tue, 27 Jul 2021 07:49:03 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D298968A066; Tue, 27 Jul 2021 17:48:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 772686881B5 for ; Tue, 27 Jul 2021 17:48:18 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmHq6026200 for ; Tue, 27 Jul 2021 16:48:18 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id A7A6AE0027; Tue, 27 Jul 2021 16:48:17 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:06 +0200 Message-Id: <20210727144813.452917-4-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:18 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 03/10] lavfi: add fs protocol as synonym for file. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 0NOCDGx/I1Tx Signed-off-by: Nicolas George --- libavformat/file.c | 47 ++++++++++++++++++++++++++++++++++++----- libavformat/protocols.c | 1 + 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/libavformat/file.c b/libavformat/file.c index 8303436be0..2fb93c23fd 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -203,17 +203,15 @@ static int file_move(URLContext *h_src, URLContext *h_dst) return 0; } -#if CONFIG_FILE_PROTOCOL +#if CONFIG_FILE_PROTOCOL || CONFIG_FS_PROTOCOL -static int file_open(URLContext *h, const char *filename, int flags) +static int file_open_common(URLContext *h, const char *filename, int flags) { FileContext *c = h->priv_data; int access; int fd; struct stat st; - av_strstart(filename, "file:", &filename); - if (flags & AVIO_FLAG_WRITE && flags & AVIO_FLAG_READ) { access = O_CREAT | O_RDWR; if (c->trunc) @@ -353,6 +351,16 @@ static int file_close_dir(URLContext *h) #endif /* HAVE_LSTAT */ } +#endif /* CONFIG_FILE_PROTOCOL || CONFIG_FS_PROTOCOL */ + +#if CONFIG_FILE_PROTOCOL + +static int file_open(URLContext *h, const char *filename, int flags) +{ + av_strstart(filename, "file:", &filename); + return file_open_common(h, filename, flags); +} + const URLProtocol ff_file_protocol = { .name = "file", .url_open = file_open, @@ -369,11 +377,40 @@ const URLProtocol ff_file_protocol = { .url_open_dir = file_open_dir, .url_read_dir = file_read_dir, .url_close_dir = file_close_dir, - .default_whitelist = "file,crypto,data" + .default_whitelist = "file,fs,crypto,data" }; #endif /* CONFIG_FILE_PROTOCOL */ +#if CONFIG_FS_PROTOCOL + +static int fs_open(URLContext *h, const char *filename, int flags) +{ + av_strstart(filename, "fs:", &filename); + return file_open_common(h, filename, flags); +} + +const URLProtocol ff_fs_protocol = { + .name = "fs", + .url_open = fs_open, + .url_read = file_read, + .url_write = file_write, + .url_seek = file_seek, + .url_close = file_close, + .url_get_file_handle = file_get_handle, + .url_check = file_check, + .url_delete = file_delete, + .url_move = file_move, + .priv_data_size = sizeof(FileContext), + .priv_data_class = &file_class, + .url_open_dir = file_open_dir, + .url_read_dir = file_read_dir, + .url_close_dir = file_close_dir, + .default_whitelist = "file,fs,crypto,data" +}; + +#endif /* CONFIG_FS_PROTOCOL */ + #if CONFIG_PIPE_PROTOCOL static int pipe_open(URLContext *h, const char *filename, int flags) diff --git a/libavformat/protocols.c b/libavformat/protocols.c index 7f08f151b6..a0035da590 100644 --- a/libavformat/protocols.c +++ b/libavformat/protocols.c @@ -33,6 +33,7 @@ extern const URLProtocol ff_data_protocol; extern const URLProtocol ff_ffrtmpcrypt_protocol; extern const URLProtocol ff_ffrtmphttp_protocol; extern const URLProtocol ff_file_protocol; +extern const URLProtocol ff_fs_protocol; extern const URLProtocol ff_ftp_protocol; extern const URLProtocol ff_gopher_protocol; extern const URLProtocol ff_gophers_protocol; From patchwork Tue Jul 27 14:48:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29072 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4919886pxb; Tue, 27 Jul 2021 07:49:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+tQC5Ss/sT72sK3L3VM1pwx2wuTfIgK3iuPjhjcY51M++vygO7LcdUP/8wk5ekA7Psbb8 X-Received: by 2002:aa7:d2ca:: with SMTP id k10mr28837366edr.379.1627397355151; Tue, 27 Jul 2021 07:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397355; cv=none; d=google.com; s=arc-20160816; b=YNrnhgRyf4puUzmL2uzOF9wxEjrF5nznL8KBzv/JAaW/QuQFb44hr0bDu/JPAGovxn Np2f56c9nSETWa7mU3wpEog0uJFgmeuEuzN8EqTJSC57x4J95nByJrsR6RY1hUmXwuUJ E9WUqrAZ4dppdL/+VEugP+250O6xHgTMH/gW1dujMDDeMdFvQ5xKXKaJldZa8wcjI3PI svDuxofYKx88GtDuFlJeByDkK1bD7Z6WdreTmdP5HF2av+JM4bISWzzBGAfl6GGvZNmH IgjpV170o6g2+Yoa06SEdCW855qylR0H4Y9J8h/subUTRCNcvd4RGT3ulQP2Ovt0RhlH bShw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=6bxdxqV+hQvh3d32VgsLrrFNpVpzAG/sEdvlhT92NPA=; b=TAVMiBWAyyfnD0RnA/siKj6GzAxwtaYtNnxzvbT3JeRu/DvcUzcBhmJw9bhPF3I3S5 CvmNDNfGXek3o02ZCZs3bdpRCj4UI/SuaABue5e0/3cITji1wKyo1SbIloU2B3Ov74Jg Gmq4h7NmV9n0Bgz9hupKUZ+LDq2Y3gUGCkdW/lKawgcmo8SFZB13OUMVpqUCaR4uuqMU WG3Vv7Lto2R5e5YU8mB+McsmhPFoSeJE3K3Ho4jHePINtFEnOz/FxTGO90QPhi151hxZ BOq82bF2mPPUR3V87XpCw11u+rHxnI9a7vob2vKm22Y9FTRdQpQX6pk9kL+E7kzcWxbd 6ZeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y15si3345743edc.243.2021.07.27.07.49.14; Tue, 27 Jul 2021 07:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEAE068A0BB; Tue, 27 Jul 2021 17:48:28 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 27BC668818E for ; Tue, 27 Jul 2021 17:48:19 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmIvt026205 for ; Tue, 27 Jul 2021 16:48:18 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 5EA54E0027; Tue, 27 Jul 2021 16:48:18 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:07 +0200 Message-Id: <20210727144813.452917-5-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:18 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 04/10] lavf: add fs to default_whitelist when file present. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: b62mtFw/6hSH Signed-off-by: Nicolas George --- libavformat/concat.c | 2 +- libavformat/subfile.c | 2 +- libavformat/teeproto.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/concat.c b/libavformat/concat.c index aec1f52d8e..66ee792b20 100644 --- a/libavformat/concat.c +++ b/libavformat/concat.c @@ -200,7 +200,7 @@ const URLProtocol ff_concat_protocol = { .url_seek = concat_seek, .url_close = concat_close, .priv_data_size = sizeof(struct concat_data), - .default_whitelist = "concat,file,subfile", + .default_whitelist = "concat,file,fs,subfile", }; #endif diff --git a/libavformat/subfile.c b/libavformat/subfile.c index 2936c79e06..7edd5b14f8 100644 --- a/libavformat/subfile.c +++ b/libavformat/subfile.c @@ -153,5 +153,5 @@ const URLProtocol ff_subfile_protocol = { .url_close = subfile_close, .priv_data_size = sizeof(SubfileContext), .priv_data_class = &subfile_class, - .default_whitelist = "file", + .default_whitelist = "file,fs", }; diff --git a/libavformat/teeproto.c b/libavformat/teeproto.c index e532bc7750..61981b8327 100644 --- a/libavformat/teeproto.c +++ b/libavformat/teeproto.c @@ -143,5 +143,5 @@ const URLProtocol ff_tee_protocol = { .url_close = tee_close, .priv_data_size = sizeof(TeeContext), .priv_data_class = &tee_class, - .default_whitelist = "crypto,file,http,https,httpproxy,rtmp,tcp,tls" + .default_whitelist = "crypto,file,fs,http,https,httpproxy,rtmp,tcp,tls" }; From patchwork Tue Jul 27 14:48:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29067 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920043pxb; Tue, 27 Jul 2021 07:49:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEiNs3ZEYL3kltWiizPg9x7gKSrRpUU3gTy4DbfvSB/I/Tdcz2Z/dtPhLMzFjztGM9I8/p X-Received: by 2002:a05:6402:d67:: with SMTP id ec39mr7300805edb.117.1627397367113; Tue, 27 Jul 2021 07:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397367; cv=none; d=google.com; s=arc-20160816; b=NorB8APVjyNQF/Hld+Jlw5IbCdSnmSMAmTw8qzolLfBRAszVdf7vJxEaIteoln4YHD j7ZUNtMqyyLhPtPgFSA2cQdLwDgVZWG6rQ/5N8pjoTdf9acnJ7peRdYk8uiyS/KknnGQ dBumaE+9YtFlEcfNVHk4wQKpBKmPTJlZ68mgZW0FSaB+BYZo8iCrQi+rcOPPvmY2xShu HYh96OcM8bC8uAzfxcUyF/hi8w0xfq5MGRKC65+knwS/wwaXWBWKmsdqNLMODi8LoptF 9/+5LNU1wOY1ZzxP6CFp/S7AKCDThyp74pFW4MxpK6tlYEz5Bi0Jo4lIm7SKLLxBHYX8 q7Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=Q32dN1PXccBcuEs+atmU5/TwUiiauLqnzg2B0vheXo4=; b=XSV5zkGCMnpFEVE3ixAVrvUjSvAigv0F1sR6WN/EidXbTbIDHICeLDRuN95/cfAMPL 2M3eU3NjNa9O1tR+lFhfeg9J8unoyZS/yWE8rZ/obXaOyJfKbirQpicEYGq5BpVOp/Tq 7Rz8jz0nAWTl28RcEnDdxm/oLvEcWoBOa8+a/RkxgrrueCPU1sOjKHfjvucBk71Wq40k ZqN/3RcdvEc+4YKTD6L8l8+mQOStJsQUxp/1GV4Rp/aLXZfwohmyEqRDUCQ2E0p/pV4Y v3JhQXXDYB1WDfSyOsFSertjz6URcwGy4JBBYn/yMZlmG8TumE96uYhNW0H4jerB0ak9 UtFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r18si3291497edv.355.2021.07.27.07.49.26; Tue, 27 Jul 2021 07:49:27 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A4F8268A0F9; Tue, 27 Jul 2021 17:48:29 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D0BD568818E for ; Tue, 27 Jul 2021 17:48:19 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmJYk026211 for ; Tue, 27 Jul 2021 16:48:19 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 0F6ADE0027; Tue, 27 Jul 2021 16:48:19 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:08 +0200 Message-Id: <20210727144813.452917-6-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:19 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 05/10] lavf/avio: treat fs: the same way as file:. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 57lhLSJX4rfC Signed-off-by: Nicolas George --- libavformat/avio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index 4846bbd8c6..13bba52e73 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -217,7 +217,9 @@ int ffurl_connect(URLContext *uc, AVDictionary **options) uc->is_connected = 1; /* We must be careful here as ffurl_seek() could be slow, * for example for http */ - if ((uc->flags & AVIO_FLAG_WRITE) || !strcmp(uc->prot->name, "file")) + if ((uc->flags & AVIO_FLAG_WRITE) || + !strcmp(uc->prot->name, "file") || + !strcmp(uc->prot->name, "fs")) if (!uc->is_streamed && ffurl_seek(uc, 0, SEEK_SET) < 0) uc->is_streamed = 1; return 0; From patchwork Tue Jul 27 14:48:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29069 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920186pxb; Tue, 27 Jul 2021 07:49:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYMN0WrBcT6ooyTl7F9vqRP/o923tRR4v3Su1JBo75584+kNmOuz+LR9Pm291hu4Q8f9db X-Received: by 2002:a17:907:3e02:: with SMTP id hp2mr22063400ejc.4.1627397379857; Tue, 27 Jul 2021 07:49:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397379; cv=none; d=google.com; s=arc-20160816; b=PQjp+EpTBBXfwHLgSHWErB7qTqrtomPeF9acn7yi50OCjGORp+4qx+8/jdXSDRZoSr iOXQ+11jl9yxnKriGsb0FsTeCxbyJXialKSBwXUWJZpllalBKFN+3qWJp7D6WEi/7Qms rUPijjPsTBMODS24VzzoXxVBN6fhTOR5wTkXDZaXYAQsWMx1vzrkaIzg/o/0nDVFNWuM e5F3WHuQHoog0grqqo73QfbnXW1yf9zJi/wpMagdcpyfPuRlld0MqWcmJ5/ATDRyPkXY RyDsyPvU1hz6gzt34ZHDA26IW0IL5NeX9hxcKBgImctRiMVw8RmjJYXNTfVOKScN/325 a4Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=e6qQur9x4NTW7cdy1sSyufx9jm54EttzGsSvzby0ZBI=; b=jwrgPo6mh1ydh+m2sFA/YKJ83JK6vLE3yb9Q2jbkFsDp7KwsxACc6qEJbsDJNcTelg QFG/dIO4a6QLjwrcHae8kM396uAhgmVtaeylAzs1Lay08KRcp7GlnK6oipjMhTxrSa3X Js/STdchQyNzfY6eSLrFMV+chMhGAmA8+iZecbWd3vaafkNEGeF+zM/9UvgbRLObE8aB vGVBjP30vVeUuZxtrhfBVxxka4scMi0w95gV859r69/2dVqAy79KLJycFJnsJPXi5umr +9VS5WmwSNJ0i1gUiKWbXYwkg/kWG5w4fhnBzd72mpZI92lQAj/9mY7azeGzh3AdQSe9 hcJQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j2si3128094edr.294.2021.07.27.07.49.39; Tue, 27 Jul 2021 07:49:39 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AD37668A12D; Tue, 27 Jul 2021 17:48:30 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6EA0468A0B2 for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmJBr026222 for ; Tue, 27 Jul 2021 16:48:20 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id B66BAE0027; Tue, 27 Jul 2021 16:48:19 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:09 +0200 Message-Id: <20210727144813.452917-7-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 06/10] fftools/ffmpeg_opt: treat fs: the same way as file:. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 9n16O+q3JDmL Signed-off-by: Nicolas George --- fftools/ffmpeg_opt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 1b43bab9fc..23b4e981c7 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1004,7 +1004,9 @@ static void assert_file_overwrite(const char *filename) } if (!file_overwrite) { - if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) { + if (proto_name && + !(strcmp(proto_name, "file") && strcmp(proto_name, "fs")) && + avio_check(filename, 0) == 0) { if (stdin_interaction && !no_file_overwrite) { fprintf(stderr,"File '%s' already exists. Overwrite? [y/N] ", filename); fflush(stderr); @@ -1023,7 +1025,7 @@ static void assert_file_overwrite(const char *filename) } } - if (proto_name && !strcmp(proto_name, "file")) { + if (proto_name && !(strcmp(proto_name, "file") && strcmp(proto_name, "fs"))) { for (int i = 0; i < nb_input_files; i++) { InputFile *file = input_files[i]; if (file->ctx->iformat->flags & AVFMT_NOFILE) From patchwork Tue Jul 27 14:48:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29071 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920375pxb; Tue, 27 Jul 2021 07:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDstG5Naq2g7ScuYs/f10PYyxyKkjG27Fa+J1lrjvkeBDyg55wJ7Jj1xF+2oOOtzZkDm0Q X-Received: by 2002:a17:907:1b06:: with SMTP id mp6mr22959871ejc.188.1627397391726; Tue, 27 Jul 2021 07:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397391; cv=none; d=google.com; s=arc-20160816; b=JvD4mOPbfokaXIqnq/4dr2VWFmomUXRqfZBPRXj2ptlZdqssZtLMjxWytf7o6X3VUO ZFPmK2qtLdsowjVbCgnGaFopjXEOidjA+EFkaxLAoafX7Z/oJO3gJsjvJtB0HLe9Z9Vf wuwY2MyXCArQLDaSMOoy+3Ux/JsS3EERn9o4/N9aWQV2BfLrunqIHXHVMIjZo81+/Ds/ KeoRT2kOZ7rmgrrEBKDHU8uIoiWfYAmUNG2Ypis1yj0eA5boqN1mVdjUB54QuCDlxZp6 Jnf7Y3Jpvo/DR2N+3l7VOVfTYmVBCPmjqsz47fIPy5KTDtiSuDwNNAxKx6/Vc3LKBWer Mjfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=w72HpTn06YGXjobtafHVj6AJsN9zjObjTwS6KxLA7Vg=; b=EY5zgpWSI23b2QeosTKD15USIDMgvcn+tzh3JZc2UoGVER/4g9GB4foOVroeMUK64r vVBECgQA9Ser10Z5d/dcnKXpgGGglGgJ7wvjgAmsOAxu0SmegflyOFsBKYcNHIYa0wyW i1VV631vISFhjBNUjoVkX2PfXPVmTXMT/FLuPOwwaN+4HtFsxaCi7GkO8F9Aq24Q0xsm JlDAijZL/K3NIiFrXDg25qAqusLUrlm4oPKYAGSAM0gkKMHtacI7BzxnBEeRMGOKY8oG 0+bRkA/U9IHY1HjIu+JM18+Z0tZAm30ZyaRWUp5F4L9meZSyglTOCMmh+y9rQxKmubo5 KjjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a17si2965272ejb.749.2021.07.27.07.49.51; Tue, 27 Jul 2021 07:49:51 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D84D568A2F4; Tue, 27 Jul 2021 17:48:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7534C68A0B7 for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmKKh026223 for ; Tue, 27 Jul 2021 16:48:20 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 84B4CE1DC8; Tue, 27 Jul 2021 16:48:20 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:10 +0200 Message-Id: <20210727144813.452917-8-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 07/10] lavf/hls: treat fs: the same way as file:. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 2E8Sh+rBOz5c Signed-off-by: Nicolas George --- libavformat/hls.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/hls.c b/libavformat/hls.c index 3c1b80f60c..e1928b6db3 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -646,7 +646,7 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, return AVERROR_INVALIDDATA; // only http(s) & file are allowed - if (av_strstart(proto_name, "file", NULL)) { + if (av_strstart(proto_name, "file", NULL) || av_strstart(proto_name, "fs", NULL)) { if (strcmp(c->allowed_extensions, "ALL") && !av_match_ext(url, c->allowed_extensions)) { av_log(s, AV_LOG_ERROR, "Filename extension of \'%s\' is not a common multimedia extension, blocked for security reasons.\n" @@ -667,8 +667,10 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ; else if (av_strstart(url, "data", NULL) && !strncmp(proto_name, url + 5, strlen(proto_name)) && url[5 + strlen(proto_name)] == ':') ; - else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5)) + else if ((strcmp(proto_name, "file") && strcmp(proto_name, "fs")) || + !strncmp(url, "file,", 5) || !strncmp(url, "fs,", 3)) { return AVERROR_INVALIDDATA; + } av_dict_copy(&tmp, *opts, 0); av_dict_copy(&tmp, opts2, 0); From patchwork Tue Jul 27 14:48:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29066 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920538pxb; Tue, 27 Jul 2021 07:50:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWGfME61pd3cWFj47w7TFVLrVvJmv7mge4ygSBSxOwMT5lwyYhdP24d+j/gTnNNgB+zkf5 X-Received: by 2002:a17:907:7e89:: with SMTP id qb9mr9377092ejc.333.1627397404166; Tue, 27 Jul 2021 07:50:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397404; cv=none; d=google.com; s=arc-20160816; b=tC99AQSrAH3Df9HNCwqJo9hX3FHDTYq2osS+gEb7ULsC3Ek0s7/LEtZLzCzsyH8E9e Tjb5ZnZF5LepBNojuhriUeTMrZZ3exBI/FF6xDR9Gpvz1U+W1S9QrWD7iajsxq01eCoJ 5CqcNIFn3B3rG/i8uwlZEHeLcmOPSWAFdTHKjP3sVKQTCaU77MINqauJ8UeDs3sm6eIa 6m4LemZPkM+yD3k/SSO8vuOvbziepoduXUcphPZ2HpGrauyONt9tmnn8Uf/CqQO/o1GD xTTmpNt6aZWQFrJhzZdC5OqIPj5FJPJ9CkYRxZOB+sFOUCu/zaOZaHRLbcYxUT8U3Q8u zWXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=om62v8I2pFsyjqjl8miU03zb7pWMWRKldv+jUtHpayI=; b=Jpo8CKvc7w0ugYizpgh04sGfgAPHdUOpU0uP/3qIVhaddOTTZslWrFw8sNXl9aoPfx nodqD//n+TQ2e527LTUGfVmlNZVm8GmvenH8z1VyyCi66QW1+KvOAgI6omdGg+THWpIe ZVUrelw4+ETtj7DYh+HgNPoyBmkWI3lATq+ZlKmcX6P7jG7Kw4EADIoAvBsHANwwSavV LI0cNrONeyZa5zvz0QdIbphM0PX2vO9WO5E6FgvwtONzm2dyfbSjFgNF3T80NKX/mv2L z6187E2m7xBrrMaYmH9COmyRKgUB/GiO2wbR2y0OcC/oiauD0F8ryOsE8Y6vBGNboTD/ XYjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id x14si3310403edd.191.2021.07.27.07.50.03; Tue, 27 Jul 2021 07:50:04 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0C4CE68A306; Tue, 27 Jul 2021 17:48:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 78A2968A0BB for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmLZf026224 for ; Tue, 27 Jul 2021 16:48:21 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 3FD02E8C4D; Tue, 27 Jul 2021 16:48:21 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:11 +0200 Message-Id: <20210727144813.452917-9-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 08/10] lavf/avio: use fs: by default instead of file:. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: OhVGfTpHVbGW Signed-off-by: Nicolas George --- libavformat/avio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index 13bba52e73..ebfecac893 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -260,7 +260,7 @@ static const struct URLProtocol *url_find_protocol(const char *filename) if (filename[proto_len] != ':' && (strncmp(filename, "subfile,", 8) || !strchr(filename + proto_len + 1, ':')) || is_dos_path(filename)) - strcpy(proto_str, "file"); + strcpy(proto_str, "fs"); else av_strlcpy(proto_str, filename, FFMIN(proto_len + 1, sizeof(proto_str))); From patchwork Tue Jul 27 14:48:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29068 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920689pxb; Tue, 27 Jul 2021 07:50:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxR7KK7yTikiXYyy+RPAQjctwkMPsXsHENFssZYYeP++q6SQUFLgBEbksvdxsKOURLLHG/n X-Received: by 2002:a05:6402:615:: with SMTP id n21mr28649489edv.139.1627397414568; Tue, 27 Jul 2021 07:50:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397414; cv=none; d=google.com; s=arc-20160816; b=BA0lPfsL8zs5Ix/NXfXUBbg+7epUaSKlA4QuNzD7nlMDwOGxjgheX7z+ok3eDX8FFo X+LXHxzD/g1QoOGpqKPl5aQowDsUja2ZqBBuowYkDZh/pRbyqnQHw1mhQzkDN3CMLgnl rviQO0HVcHWpOADnmHbrOJAwOtjjasvKKKNA+jWX/sLwJB+OuDNnsTaH/+Nh2ZG01TlR sfLF6z52JvX3lRu/rvcrzTs851XDH7il2NnOYw8JXSyOAriYXCaAK1ny5OAeoJPkYz9L MkzkQXDtTN38JFIwKLJ0/c2kOltqmHI+/NUoMA+5wua2UmN+uifDeRAP6f8RhENeOEel nPCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=oBLy1VV07K9pR4Z63KFfIrgae2mcVbCsrpndr33Curk=; b=TwModOgIpgdMl+WHOeQniHYal46DR21QOpzToxdDJ5U33Se4uZI0jptv+dAIERX5Oc RE++PY69G+ZXBlFiDf8a4/XVh6QYXTUx7+LQFYTIXekjmmiuAXSmHGkWHk3RLxcOj0uK fcfU0BhTqw+U0idwL+/0upck9qDmmN/ydJCJZLxtzYxiLUwVYKjPK6WimveJtAZ+ORfD 1tCbmNRVu5xW6d4ZQmCNqsZYBcD1G4PM6DOK924n3ULwH5T5WuAj1Ju8E+bSJZi93bN5 OZC1IHmHtYvKQEBpRWTIQwvHexC1HVomoxBmzABdMYZstcnYOn3Ocju/sn10NC0E73EX ataQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id y8si2997244edu.495.2021.07.27.07.50.14; Tue, 27 Jul 2021 07:50:14 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D2FB68A348; Tue, 27 Jul 2021 17:48:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7D5D068A0C3 for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmMF5026226 for ; Tue, 27 Jul 2021 16:48:22 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id F1DB9E96CA; Tue, 27 Jul 2021 16:48:21 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:12 +0200 Message-Id: <20210727144813.452917-10-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 09/10] lavf/file: handle standard file:// URLs. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: GJ51AcIwYBS4 Signed-off-by: Nicolas George --- libavformat/file.c | 54 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/libavformat/file.c b/libavformat/file.c index 2fb93c23fd..82d9e7bab4 100644 --- a/libavformat/file.c +++ b/libavformat/file.c @@ -20,6 +20,7 @@ */ #include "libavutil/avstring.h" +#include "libavutil/bprint.h" #include "libavutil/internal.h" #include "libavutil/opt.h" #include "avformat.h" @@ -355,10 +356,61 @@ static int file_close_dir(URLContext *h) #if CONFIG_FILE_PROTOCOL +/** + * De-escape %hh. Return 0 if no de-escaping needed. + */ +static int url_de_escape(void *log, const char *filename, AVBPrint *out) +{ + const char *in; + + for (in = filename; *in; in++) + if (*in == '%' || *in == '#' || *in == '?') + break; + if (!*in) + return 0; + for (in = filename; *in; in++) { + if (*in == '#' || *in == '?') + break; + if (*in == '%') { + int a = ff_hexpair2int(in + 1); + if (a < 0) { + av_log(log, AV_LOG_ERROR, "Invalid %% char in URL.\n"); + return AVERROR(EINVAL); + } + av_bprint_chars(out, a, 1); + in += 2; + } else { + av_bprint_chars(out, *in, 1); + } + } + if (!av_bprint_is_complete(out)) + return AVERROR(ENOMEM); + return 1; +} + static int file_open(URLContext *h, const char *filename, int flags) { + AVBPrint decoded; + int ret; + av_strstart(filename, "file:", &filename); - return file_open_common(h, filename, flags); + av_bprint_init(&decoded, 1, AV_BPRINT_SIZE_UNLIMITED); + if (filename[0] == '/' && filename[1] == '/' && filename[2] == '/') { + filename += 2; + ret = url_de_escape(h, filename, &decoded); + if (ret < 0) { + av_bprint_finalize(&decoded, NULL); + return ret; + } + if (ret) + filename = decoded.str; + } else { + av_log(h, AV_LOG_WARNING, + "'file:path' is deprecated, use 'fs:path' or a standard 'file:///' URL\n"); + } + ret = file_open_common(h, filename, flags); + av_bprint_finalize(&decoded, NULL); + return ret; } const URLProtocol ff_file_protocol = { From patchwork Tue Jul 27 14:48:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 29065 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a11:4023:0:0:0:0 with SMTP id ky35csp4920821pxb; Tue, 27 Jul 2021 07:50:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzq+kSfwF7O2xQMzQ0vTyvFhqrCxrDBVdbN7FEowkM/PPBRdKBoLbqrfkQLOEWmkYRx8MVF X-Received: by 2002:a17:906:af6f:: with SMTP id os15mr5298252ejb.71.1627397423953; Tue, 27 Jul 2021 07:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627397423; cv=none; d=google.com; s=arc-20160816; b=nkUmEsf4IAKrgCxsKbg37dhWUFyoaFFW4rFwY3Rzcyukv9ws/Hljpp6jXFneJPXpPi UF6LLb3gSS8DIJO7IpNx1jyf5VVX0m8/OSOJ+QP5Z7XelSpA45VECMgQetCjb5ekAdnu uJZpjbFlOAsiVxX3qRkuXYwKN7lHeilQEk/RDzbNPa01WxqNwARoWA3PN1AkNMqD2BjB WHe6HvUtBTBekJI6fnzEqXQ0hBm89+W/pGOzi/iEScbsiTab0gJLQsXolBYHlXBXLqJ5 CWsqDrgpPfX0wN2oLIJ3I3wTNoc3CwS9PmSgl568/usjYsBvMllA1ha0wvlKdfD4A2HY ZBMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=X93BV578pqCSh5c2N1FhFnBkp9Mutfz/KikmY+1CDq8=; b=RzYoxqa8A4xuTD52/ynGRptvV+/8JkIdFA9B6vA9YqLY25bOBqjNOyINpC+3UosPhJ WzlDOQNgYZ+jbV6iwjpQPROLvrKgWJ5CqLfumuKANYZ75qXDW32ph3a8p8srb8PX4AMm fIUUviE73v6r+UaM1Wtr+zwONBlHo8XOq1xocw0AVzgq+ZErfvawbv2sssZ98DuOCGB5 YOWSXcYxYNnWOpXHKnuTB2M7PXUhRGhsVLn1XYHzHcmFU37hu4SJEuTxmmTFQfcfB5l8 edOdzONDR1F2WJuhQMXpGChi8diLRk6mOy69rqteBqNC5qDIwP0gAga6xdYpo02bzoaw 1+BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id da17si3037954edb.259.2021.07.27.07.50.23; Tue, 27 Jul 2021 07:50:23 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2475F68A37E; Tue, 27 Jul 2021 17:48:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7FCAB689D48 for ; Tue, 27 Jul 2021 17:48:23 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 16REmMJ4026228 for ; Tue, 27 Jul 2021 16:48:23 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id B232FE977F; Tue, 27 Jul 2021 16:48:22 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Jul 2021 16:48:13 +0200 Message-Id: <20210727144813.452917-11-george@nsup.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210727144813.452917-1-george@nsup.org> References: <20210727144813.452917-1-george@nsup.org> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Tue, 27 Jul 2021 16:48:23 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 10/10] doc: document fs: and file: changes. 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uVZTqvlvSbzt Signed-off-by: Nicolas George --- doc/protocols.texi | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/doc/protocols.texi b/doc/protocols.texi index 726e5f1c44..d341d93914 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -283,20 +283,16 @@ Read from or write to a file. A file URL can have the form: @example -file:@var{filename} +file://@var{encoded_absolute_path} @end example -where @var{filename} is the path of the file to read. +where @var{encoded_absolute_path} is the path of the file, with standard % +URL encoding.. -An URL that does not have a protocol prefix will be assumed to be a -file URL. Depending on the build, an URL that looks like a Windows -path with the drive letter at the beginning will also be assumed to be -a file URL (usually not the case in builds for unix-like systems). - -For example to read from a file @file{input.mpeg} with @command{ffmpeg} +For example to read from a file @file{/tmp/test input.mpeg} with @command{ffmpeg} use the command: @example -ffmpeg -i file:input.mpeg output.mpeg +ffmpeg -i file:///tmp/test%20input.mpeg output.mpeg @end example This protocol accepts the following options: @@ -327,6 +323,32 @@ overriding this might speed up opening certain files at the cost of losing some features (e.g. accurate seeking). @end table +@section fs + +Direct file system access protocol. + +Read from or write to a file. + +A fs URL can have the form: +@example +fs:@var{filename} +@end example + +where @var{filename} is the path of the file. + +An URL that does not have a protocol prefix will be assumed to be a +fs URL. Depending on the build, an URL that looks like a Windows +path with the drive letter at the beginning will also be assumed to be +a fs URL (usually not the case in builds for unix-like systems). + +For example to read from a file @file{input.mpeg} with @command{ffmpeg} +use the command: +@example +ffmpeg -i fs:input.mpeg output.mpeg +@end example + +This protocol accepts the same options as the file protocol. + @section ftp FTP (File Transfer Protocol).