* [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
@ 2022-12-09 15:40 Derek Buitenhuis
2022-12-09 15:45 ` Nicolas George
0 siblings, 1 reply; 8+ messages in thread
From: Derek Buitenhuis @ 2022-12-09 15:40 UTC (permalink / raw)
To: ffmpeg-devel
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 <derek.buitenhuis@gmail.com>
---
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 <next>:
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"
--
2.38.1
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-09 15:40 [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway Derek Buitenhuis
@ 2022-12-09 15:45 ` Nicolas George
2022-12-09 15:52 ` Derek Buitenhuis
0 siblings, 1 reply; 8+ messages in thread
From: Nicolas George @ 2022-12-09 15:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Derek Buitenhuis (12022-12-09):
> 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 <derek.buitenhuis@gmail.com>
> ---
> 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.
I rather agree.
> ---
> 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 <next>:
>
>
> 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)
There is no need to rename local symbols.
> {
> 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",
It is a bit of a mouthful. Maybe "ipfsgw"?
> .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"
>
Regards,
--
Nicolas George
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-09 15:45 ` Nicolas George
@ 2022-12-09 15:52 ` Derek Buitenhuis
2022-12-09 15:53 ` Nicolas George
2022-12-12 15:48 ` Tomas Härdin
0 siblings, 2 replies; 8+ messages in thread
From: Derek Buitenhuis @ 2022-12-09 15:52 UTC (permalink / raw)
To: ffmpeg-devel
On 12/9/2022 3:45 PM, Nicolas George wrote:
>> -static int ipfs_read(URLContext *h, unsigned char *buf, int size)
>> +static int ipfs_gateway_read(URLContext *h, unsigned char *buf, int size)
>
> There is no need to rename local symbols.
My intent was to rename in case we ever got an actual IPFS implementation,
but I have no strong opinion on whether to keep this part of the patch or
not.
>> +const URLProtocol ff_ipfs_gateway_protocol = {
>> + .name = "ipfs_gateway",
>
> It is a bit of a mouthful. Maybe "ipfsgw"?
My personal preference is verbosity here, but it's not a strong preference.
- Derek
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-09 15:52 ` Derek Buitenhuis
@ 2022-12-09 15:53 ` Nicolas George
2022-12-12 15:48 ` Tomas Härdin
1 sibling, 0 replies; 8+ messages in thread
From: Nicolas George @ 2022-12-09 15:53 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Derek Buitenhuis (12022-12-09):
> My intent was to rename in case we ever got an actual IPFS implementation,
> but I have no strong opinion on whether to keep this part of the patch or
> not.
Even if we do, the names are local, they do not conflict.
> My personal preference is verbosity here, but it's not a strong preference.
I do not insist on this. Maybe verbosity is best.
Regards,
--
Nicolas George
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-09 15:52 ` Derek Buitenhuis
2022-12-09 15:53 ` Nicolas George
@ 2022-12-12 15:48 ` Tomas Härdin
2022-12-13 12:44 ` Derek Buitenhuis
1 sibling, 1 reply; 8+ messages in thread
From: Tomas Härdin @ 2022-12-12 15:48 UTC (permalink / raw)
To: FFmpeg development discussions and patches
fre 2022-12-09 klockan 15:52 +0000 skrev Derek Buitenhuis:
> On 12/9/2022 3:45 PM, Nicolas George wrote:
> > > -static int ipfs_read(URLContext *h, unsigned char *buf, int
> > > size)
> > > +static int ipfs_gateway_read(URLContext *h, unsigned char *buf,
> > > int size)
> >
> > There is no need to rename local symbols.
>
> My intent was to rename in case we ever got an actual IPFS
> implementation,
> but I have no strong opinion on whether to keep this part of the
> patch or
> not.
>
> > > +const URLProtocol ff_ipfs_gateway_protocol = {
> > > + .name = "ipfs_gateway",
> >
> > It is a bit of a mouthful. Maybe "ipfsgw"?
>
> My personal preference is verbosity here, but it's not a strong
> preference.
I agree verbosity is better here
/Tomas
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-12 15:48 ` Tomas Härdin
@ 2022-12-13 12:44 ` Derek Buitenhuis
2022-12-13 12:48 ` Derek Buitenhuis
0 siblings, 1 reply; 8+ messages in thread
From: Derek Buitenhuis @ 2022-12-13 12:44 UTC (permalink / raw)
To: ffmpeg-devel
On 12/12/2022 3:48 PM, Tomas Härdin wrote:
> I agree verbosity is better here
I'll push with the internal symbol renames removed later today
if nobody objects.
- Derek
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-13 12:44 ` Derek Buitenhuis
@ 2022-12-13 12:48 ` Derek Buitenhuis
2022-12-14 17:34 ` Tomas Härdin
0 siblings, 1 reply; 8+ messages in thread
From: Derek Buitenhuis @ 2022-12-13 12:48 UTC (permalink / raw)
To: ffmpeg-devel
On 12/13/2022 12:44 PM, Derek Buitenhuis wrote:
> I'll push with the internal symbol renames removed later today
> if nobody objects.
[...]
> -const URLProtocol ff_ipfs_protocol = {
> - .name = "ipfs",
> +const URLProtocol ff_ipfs_gateway_protocol = {
> + .name = "ipfs_gateway",
Actually, would this break ipfs:// urls? Might need to remove this, too.
- Derek
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway
2022-12-13 12:48 ` Derek Buitenhuis
@ 2022-12-14 17:34 ` Tomas Härdin
0 siblings, 0 replies; 8+ messages in thread
From: Tomas Härdin @ 2022-12-14 17:34 UTC (permalink / raw)
To: FFmpeg development discussions and patches
tis 2022-12-13 klockan 12:48 +0000 skrev Derek Buitenhuis:
> On 12/13/2022 12:44 PM, Derek Buitenhuis wrote:
> > I'll push with the internal symbol renames removed later today
> > if nobody objects.
>
> [...]
>
> > -const URLProtocol ff_ipfs_protocol = {
> > - .name = "ipfs",
> > +const URLProtocol ff_ipfs_gateway_protocol = {
> > + .name = "ipfs_gateway",
>
> Actually, would this break ipfs:// urls? Might need to remove this,
> too.
This is why I objected to this nonsense in the first place. Business
logic doesn't belong in lavf.
/Tomass
_______________________________________________
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-12-14 17:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 15:40 [FFmpeg-devel] [PATCH] avformat: Rename IPFS to IPFS gateway Derek Buitenhuis
2022-12-09 15:45 ` Nicolas George
2022-12-09 15:52 ` Derek Buitenhuis
2022-12-09 15:53 ` Nicolas George
2022-12-12 15:48 ` Tomas Härdin
2022-12-13 12:44 ` Derek Buitenhuis
2022-12-13 12:48 ` Derek Buitenhuis
2022-12-14 17:34 ` Tomas Härdin
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git