[FFmpeg-devel] [PATCH 1/5] Early version of IPFS protocol support.

Lynne dev at lynne.ee
Mon Jan 31 22:26:43 EET 2022


Jan 31, 2022, 14:51 by markg85 at gmail.com:

> Signed-off-by: Mark Gaiser <markg85 at gmail.com>
> ---
>  configure               |   1 +
>  doc/protocols.texi      |  30 ++++++
>  libavformat/Makefile    |   1 +
>  libavformat/ipfs.c      | 202 ++++++++++++++++++++++++++++++++++++++++
>  libavformat/protocols.c |   2 +
>  5 files changed, 236 insertions(+)
>  create mode 100644 libavformat/ipfs.c
>
> +
> +static int ipfs_open(URLContext *h, const char *uri, int flags, AVDictionary **options)
> +{
> +    const char *gatewaysuffix;
> +    int ret = 0;
> +    Context *c = h->priv_data;
> + 
> +    if (!av_strstart(uri, "ipfs://", &gatewaysuffix) &&
> +        !av_strstart(uri, "ipfs:", &gatewaysuffix)) {
> +        av_log(h, AV_LOG_ERROR, "Unsupported url %s\n", uri);
> +        ret = AVERROR(EINVAL);
> +        goto err;
> +    }
> + 
> +    char* ipfs_gateway = "https://ipfs.io/ipfs/";
>

That's a no from me. I'd rather have native support rather
than depend on some third party service. Users can just convert
the link themselves if they want to. Surely the IPFS project
has libraries one could use instead.


More information about the ffmpeg-devel mailing list