This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit dd2554331668097f59e4a47a353dd16b4ae90fe9
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Mon Jun 15 02:30:08 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Mon Jul 27 17:05:20 2026 +0000

    avformat/libcurl: add libcurl protocol skeleton
    
    configure changes, and protocol with ENOSYS impl.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 configure               |  5 ++++
 libavformat/Makefile    |  1 +
 libavformat/libcurl.c   | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
 libavformat/protocols.c |  1 +
 4 files changed, 73 insertions(+)

diff --git a/configure b/configure
index d51809931c..c9d8736dac 100755
--- a/configure
+++ b/configure
@@ -308,6 +308,7 @@ External library support:
   --enable-libxevdb        enable EVC decoding via libxevd (Base profile) [no]
   --enable-libxavs         enable AVS encoding via xavs [no]
   --enable-libxavs2        enable AVS2 encoding via xavs2 [no]
+  --enable-libcurl         enable HTTP(S) protocol support via libcurl 
[autodetect]
   --enable-libxcb          enable X11 grabbing using XCB [autodetect]
   --enable-libxcb-shm      enable X11 grabbing shm communication [autodetect]
   --enable-libxcb-xfixes   enable X11 grabbing mouse rendering [autodetect]
@@ -1980,6 +1981,7 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST="
     bzlib
     coreimage
     iconv
+    libcurl
     libxcb
     libxcb_shm
     libxcb_shape
@@ -4115,6 +4117,8 @@ ipns_gateway_protocol_select="https_protocol"
 libamqp_protocol_deps="librabbitmq"
 libamqp_protocol_select="network"
 librist_protocol_deps="librist"
+libcurl_protocol_deps="libcurl"
+libcurl_protocol_select="network"
 librist_protocol_select="network"
 librtmp_protocol_deps="librtmp"
 librtmpe_protocol_deps="librtmp"
@@ -7312,6 +7316,7 @@ enabled libbluray         && require_pkg_config libbluray 
libbluray libbluray/bl
 enabled libbs2b           && require_pkg_config libbs2b libbs2b bs2b.h 
bs2b_open
 enabled libcaca           && require_pkg_config libcaca caca caca.h 
caca_create_canvas
 enabled libcodec2         && require libcodec2 codec2/codec2.h codec2_create 
-lcodec2
+enabled libcurl           && check_pkg_config libcurl "libcurl >= 7.88.0" 
curl/curl.h curl_easy_init
 enabled libdav1d          && require_pkg_config libdav1d "dav1d >= 1.0.0" 
"dav1d/dav1d.h" dav1d_version
 enabled libdavs2          && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
 enabled libdc1394         && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2f85e8a2ad..2a7fbecf96 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -735,6 +735,7 @@ OBJS-$(CONFIG_UNIX_PROTOCOL)             += unix.o
 
 # external library protocols
 OBJS-$(CONFIG_LIBAMQP_PROTOCOL)          += libamqp.o
+OBJS-$(CONFIG_LIBCURL_PROTOCOL)          += libcurl.o
 OBJS-$(CONFIG_LIBRIST_PROTOCOL)          += librist.o
 OBJS-$(CONFIG_LIBRTMP_PROTOCOL)          += librtmp.o
 OBJS-$(CONFIG_LIBRTMPE_PROTOCOL)         += librtmp.o
diff --git a/libavformat/libcurl.c b/libavformat/libcurl.c
new file mode 100644
index 0000000000..b4a4995873
--- /dev/null
+++ b/libavformat/libcurl.c
@@ -0,0 +1,66 @@
+/*
+ * libcurl based HTTP(S) protocol
+ * Copyright (C) 2026 Kacper Michajłow
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config_components.h"
+
+#include <curl/curl.h>
+
+#include "libavutil/opt.h"
+
+#include "avformat.h"
+#include "internal.h"
+#include "url.h"
+
+typedef struct CurlContext {
+    const AVClass *class;
+} CurlContext;
+
+static int libcurl_open(URLContext *h, const char *url, int flags,
+                        AVDictionary **options)
+{
+    return AVERROR(ENOSYS);
+}
+
+static int libcurl_read(URLContext *h, unsigned char *buf, int size)
+{
+    return AVERROR(ENOSYS);
+}
+
+static int libcurl_close(URLContext *h)
+{
+    return 0;
+}
+
+static const AVClass libcurl_context_class = {
+    .class_name = "libcurl",
+    .item_name  = av_default_item_name,
+    .version    = LIBAVUTIL_VERSION_INT,
+};
+
+const URLProtocol ff_libcurl_protocol = {
+    .name            = "libcurl",
+    .url_open2       = libcurl_open,
+    .url_read        = libcurl_read,
+    .url_close       = libcurl_close,
+    .priv_data_size  = sizeof(CurlContext),
+    .priv_data_class = &libcurl_context_class,
+    .flags           = URL_PROTOCOL_FLAG_NETWORK,
+};
diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 257b41970a..367b40ee2c 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -67,6 +67,7 @@ extern const URLProtocol ff_udp_protocol;
 extern const URLProtocol ff_udplite_protocol;
 extern const URLProtocol ff_unix_protocol;
 extern const URLProtocol ff_libamqp_protocol;
+extern const URLProtocol ff_libcurl_protocol;
 extern const URLProtocol ff_librist_protocol;
 extern const URLProtocol ff_librtmp_protocol;
 extern const URLProtocol ff_librtmpe_protocol;

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to