From patchwork Fri Dec 9 15:40:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derek Buitenhuis X-Patchwork-Id: 39669 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp1440532pzb; Fri, 9 Dec 2022 07:41:26 -0800 (PST) X-Google-Smtp-Source: AA0mqf5DKTlQ5qb/54Q74Ev67CrouNIVvQx+TEWEhM+JsjaggT7hWebH5CbRptmzMNWJUbzx2Gc5 X-Received: by 2002:a05:6402:5305:b0:462:6ace:34cb with SMTP id eo5-20020a056402530500b004626ace34cbmr5382331edb.0.1670600486298; Fri, 09 Dec 2022 07:41:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670600486; cv=none; d=google.com; s=arc-20160816; b=Y9HpDeTJ8879YSe6ygUh3bIO9Lq9x5qCayZUKtINH1Z0SP0KsGrJfgI1hDtBH5v6lV tNzP6ZWwnL+Rqm97pWnHBDrMFn9RY4YMDvf3M82Bz8yxZKIErMzQ0HPUh+qY5pVAfWRo 3olGjVl5KHLNeDQQm0s5zG/HHxdPTVhmLKXQgtwTre0BnT4YQX7mfT004msHAHYKd37Y fAhxI108gSqHGPUOFLQw7VQJVAscX63LmPdbd2E2b5llBrafdWuUSIVM7lXPWnuf6uXe PdrMjybIWiQjXEsbgFa19b2pwAFyceikX6jO3SYlmExmN6CMNG4t9D0abRbxLohY51na VqPQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=dkJjbBy0bNeqZ2ya5/vKtXH8PAHnHXuYdRmT0qV9M0s=; b=PENWjYtq220mdNDCLkpJtf/wEAgyfoFgj4OpPxWiW0FUMPmaMuxxHqBa5SyUm8dAV7 LX9aCE+Nnp9dmm6D3zUN3/q3vctgmxJhAjnD5KXF86/gujYHnHeheZ2+fhMdHXFcBkFl K2GlNggSWh1uh9bQGGzJjhgIJL1X7KvokRJbkvOjOnXlBJUNPzgl0kVeB2nwlnOpIig+ yvJLsrn5L5k3MNTi9vHH/QJXJ+2gyOcNcMlErWpSgwunTBQ0TYuH2dpdz0pHGTr2dd0e Yr7DTxlT/q4jXO3Kuivrd8qL9/7tSTVUy2zdzw0dsAC7l/0ogzlCVSb2g41lGBl0k4Sp ZHug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=e1EdbvBH; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i7-20020a0564020f0700b0044e987f3a34si1719175eda.489.2022.12.09.07.41.24; Fri, 09 Dec 2022 07:41:26 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=e1EdbvBH; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BA1C668BCE8; Fri, 9 Dec 2022 17:41:21 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1100768BA5C for ; Fri, 9 Dec 2022 17:41:15 +0200 (EET) Received: by mail-wr1-f50.google.com with SMTP id h12so5571932wrv.10 for ; Fri, 09 Dec 2022 07:41:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=oR84YpdVpyAIckcgrlFTeW0HcXEVIqNDggc+dcMGRPI=; b=e1EdbvBHd52Kf98JEkcO7JL6F2dxzCsErqtAo8JVWnYXXCScuE6+U/Pf/rM0RGLdIt PaI87hIF+eWnxnTLNFfm64tQ+zkGfcRDx71GB1EKyV/9hth9OZCT3XNwLWbJhgUrXVUM V/MaEFrCQ2aQsJxvWANr6Uf2po1xaE2UpzpedgxcGPJonBSYiLjCM57Efs82CU9BFUCY qLyaneAckx9DIIMojmavnwxY2BLoo7fYILNHgS07f/mm3yjERC3qcWjNZBrL0Uo3tCqC mUDF0t/z2YCabhdWcDelmOa8yqrktzCa11mwcLZN1z1lxbc1kMiE0R0O0Ez7UxdzsOTD drbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oR84YpdVpyAIckcgrlFTeW0HcXEVIqNDggc+dcMGRPI=; b=71Iq5pwofXTTq03trgoEic1rf/ANmEoW95nfyInvzZTP/eZfrcZPE0mJ3LLNJZU9XA PLdV7es/YD7ouJTcQjLgzB30J28uQ/YTbxJGSs+QtqDzCXuOA4hQBBd0hDbnlnGfMZzK HTxm9tC84UcQ81Vxmdb3eNU54FFgrxAeArZQkMtyj+XGsotCF7K6/UXabhSrWNyTAtin XZFo09PcDZjq/3l6S6lCnaBqBeLkZ1f9mFgGbmPxOJtKcfcNyZRd9e/p1ZeIkiqrKlhY LHJlQ5lReQn22QYSXICvL6mxxIJ4xueNr3Y1YXXoxHFJkvD7/KUP5Xi8412n5ILw+hPY Srzg== X-Gm-Message-State: ANoB5pkMAuSP4KqQiYN9jFBYK6oUvkpg5kUonnf0Fv9hVmKGrPfC2kq2 CFTQIFhoIL78w7/U9J6WhExC/Efp+bY= X-Received: by 2002:a5d:4492:0:b0:242:3600:d221 with SMTP id j18-20020a5d4492000000b002423600d221mr4375596wrq.55.1670600474136; Fri, 09 Dec 2022 07:41:14 -0800 (PST) Received: from localhost.localdomain (33bf3096.skybroadband.com. [51.191.48.150]) by smtp.gmail.com with ESMTPSA id t8-20020a5d6a48000000b002420d51e581sm1728876wrw.67.2022.12.09.07.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:41:13 -0800 (PST) From: Derek Buitenhuis To: ffmpeg-devel@ffmpeg.org Date: Fri, 9 Dec 2022 15:40:55 +0000 Message-Id: <20221209154055.21165-1-derek.buitenhuis@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway 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: cntdsCeN9PNu It is a URL rewriter for IPFS gateways, not an actual implementation of IPFS, and naming it as such was both incorrect and misleading. Signed-off-by: Derek Buitenhuis --- As was discussed at the developer meeting last week, presented here for comments. Personally I think libavformat is no place for URL rewriters pretending to be protocols, and think that URLs should be rewritten at the layer above avformat (i.e. nuke this entirely), but I figure this is less likely to get me abusive hate emails again to my personal mail - or at least fewer. --- Changelog | 2 +- configure | 4 ++-- libavformat/Makefile | 4 ++-- libavformat/ipfsgateway.c | 34 +++++++++++++++++----------------- libavformat/protocols.c | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Changelog b/Changelog index af2dd65f8f..1e9e862406 100644 --- a/Changelog +++ b/Changelog @@ -30,7 +30,7 @@ version : version 5.1: -- add ipfs/ipns protocol support +- add ipfs/ipns gateway support - dialogue enhance audio filter - dropped obsolete XvMC hwaccel - pcm-bluray encoder diff --git a/configure b/configure index f4eedfc207..af78d79716 100755 --- a/configure +++ b/configure @@ -3597,8 +3597,8 @@ udp_protocol_select="network" udplite_protocol_select="network" unix_protocol_deps="sys_un_h" unix_protocol_select="network" -ipfs_protocol_select="https_protocol" -ipns_protocol_select="https_protocol" +ipfs_gateway_protocol_select="https_protocol" +ipns_gateway_protocol_select="https_protocol" # external library protocols libamqp_protocol_deps="librabbitmq" diff --git a/libavformat/Makefile b/libavformat/Makefile index d7f198bf39..2699409e43 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -672,8 +672,8 @@ OBJS-$(CONFIG_SRTP_PROTOCOL) += srtpproto.o srtp.o OBJS-$(CONFIG_SUBFILE_PROTOCOL) += subfile.o OBJS-$(CONFIG_TEE_PROTOCOL) += teeproto.o tee_common.o OBJS-$(CONFIG_TCP_PROTOCOL) += tcp.o -OBJS-$(CONFIG_IPFS_PROTOCOL) += ipfsgateway.o -OBJS-$(CONFIG_IPNS_PROTOCOL) += ipfsgateway.o +OBJS-$(CONFIG_IPFS_GATEWAY_PROTOCOL) += ipfsgateway.o +OBJS-$(CONFIG_IPNS_GATEWAY_PROTOCOL) += ipfsgateway.o TLS-OBJS-$(CONFIG_GNUTLS) += tls_gnutls.o TLS-OBJS-$(CONFIG_LIBTLS) += tls_libtls.o TLS-OBJS-$(CONFIG_MBEDTLS) += tls_mbedtls.o diff --git a/libavformat/ipfsgateway.c b/libavformat/ipfsgateway.c index ce69d9055a..336a2603db 100644 --- a/libavformat/ipfsgateway.c +++ b/libavformat/ipfsgateway.c @@ -304,19 +304,19 @@ err: return ret; } -static int ipfs_read(URLContext *h, unsigned char *buf, int size) +static int ipfs_gateway_read(URLContext *h, unsigned char *buf, int size) { IPFSGatewayContext *c = h->priv_data; return ffurl_read(c->inner, buf, size); } -static int64_t ipfs_seek(URLContext *h, int64_t pos, int whence) +static int64_t ipfs_gateway_seek(URLContext *h, int64_t pos, int whence) { IPFSGatewayContext *c = h->priv_data; return ffurl_seek(c->inner, pos, whence); } -static int ipfs_close(URLContext *h) +static int ipfs_gateway_close(URLContext *h) { IPFSGatewayContext *c = h->priv_data; return ffurl_closep(&c->inner); @@ -329,29 +329,29 @@ static const AVOption options[] = { {NULL}, }; -static const AVClass ipfs_context_class = { - .class_name = "IPFS", +static const AVClass ipfs_gateway_context_class = { + .class_name = "IPFS Gateway", .item_name = av_default_item_name, .option = options, .version = LIBAVUTIL_VERSION_INT, }; -const URLProtocol ff_ipfs_protocol = { - .name = "ipfs", +const URLProtocol ff_ipfs_gateway_protocol = { + .name = "ipfs_gateway", .url_open2 = translate_ipfs_to_http, - .url_read = ipfs_read, - .url_seek = ipfs_seek, - .url_close = ipfs_close, + .url_read = ipfs_gateway_read, + .url_seek = ipfs_gateway_seek, + .url_close = ipfs_gateway_close, .priv_data_size = sizeof(IPFSGatewayContext), - .priv_data_class = &ipfs_context_class, + .priv_data_class = &ipfs_gateway_context_class, }; -const URLProtocol ff_ipns_protocol = { - .name = "ipns", +const URLProtocol ff_ipns_gateway_protocol = { + .name = "ipns_gateway", .url_open2 = translate_ipfs_to_http, - .url_read = ipfs_read, - .url_seek = ipfs_seek, - .url_close = ipfs_close, + .url_read = ipfs_gateway_read, + .url_seek = ipfs_gateway_seek, + .url_close = ipfs_gateway_close, .priv_data_size = sizeof(IPFSGatewayContext), - .priv_data_class = &ipfs_context_class, + .priv_data_class = &ipfs_gateway_context_class, }; diff --git a/libavformat/protocols.c b/libavformat/protocols.c index 8b7d1b940f..d3a7d4310b 100644 --- a/libavformat/protocols.c +++ b/libavformat/protocols.c @@ -72,8 +72,8 @@ extern const URLProtocol ff_libsrt_protocol; extern const URLProtocol ff_libssh_protocol; extern const URLProtocol ff_libsmbclient_protocol; extern const URLProtocol ff_libzmq_protocol; -extern const URLProtocol ff_ipfs_protocol; -extern const URLProtocol ff_ipns_protocol; +extern const URLProtocol ff_ipfs_gateway_protocol; +extern const URLProtocol ff_ipns_gateway_protocol; #include "libavformat/protocol_list.c"