1- From fc20f37d242895412029521935804a96d9d0bf0c Mon Sep 17 00:00:00 2001
1+ From a8dc36d3060372153fe0cc93b2a9af3a50271aba Mon Sep 17 00:00:00 2001
22From: qianlongxu <
[email protected] >
3- Date: Thu, 29 May 2025 10:57:48 +0800
4- Subject: [PATCH] restore ijk custom protocols except long url
3+ Date: Fri, 30 May 2025 09:15:11 +0800
4+ Subject: [PATCH] restore ijk custom protocols and demuxers except long url and
5+ async
56
67---
78 libavcodec/Makefile | 1 +
8- libavformat/Makefile | 9 ++++
9+ libavformat/Makefile | 10 ++++
910 libavformat/allformats.c | 4 ++
10- libavformat/async.c | 2 +-
1111 libavformat/demux.c | 13 +++++
1212 libavformat/demux.h | 2 +
13- libavformat/ijkutils.c | 101 +++++++++++++++++++++++++++++++++++++++
13+ libavformat/ijkutils.c | 102 +++++++++++++++++++++++++++++++++++++++
1414 libavformat/protocols.c | 6 +++
1515 libavutil/Makefile | 1 +
16- 9 files changed, 138 insertions(+), 1 deletion(- )
16+ 8 files changed, 139 insertions(+)
1717 create mode 100644 libavformat/ijkutils.c
1818
1919diff --git a/libavcodec/Makefile b/libavcodec/Makefile
@@ -29,13 +29,14 @@ index a4fcce3..ed5c705 100644
2929 OBJS = ac3_parser.o \
3030 adts_parser.o \
3131diff --git a/libavformat/Makefile b/libavformat/Makefile
32- index e5934e9..359781b 100644
32+ index e5934e9..5e88060 100644
3333--- a/libavformat/Makefile
3434+++ b/libavformat/Makefile
35- @@ -7,6 +7,14 @@ HEADERS = avformat.h \
35+ @@ -7,6 +7,15 @@ HEADERS = avformat.h \
3636 version_major.h \
3737 application.h \
3838 dns_cache.h \
39+ + demux.h \
3940+ avc.h \
4041+ url.h \
4142+ internal.h \
@@ -47,7 +48,7 @@ index e5934e9..359781b 100644
4748
4849 OBJS = allformats.o \
4950 avformat.o \
50- @@ -34,6 +42 ,7 @@ OBJS = allformats.o \
51+ @@ -34,6 +43 ,7 @@ OBJS = allformats.o \
5152 version.o \
5253 application.o \
5354 dns_cache.o \
@@ -70,19 +71,6 @@ index 305fa46..063be70 100644
7071 #include "libavformat/muxer_list.c"
7172 #include "libavformat/demuxer_list.c"
7273
73- diff --git a/libavformat/async.c b/libavformat/async.c
74- index e0329e2..e5ee519 100644
75- --- a/libavformat/async.c
76- +++ b/libavformat/async.c
77- @@ -489,7 +489,7 @@ static const AVClass async_context_class = {
78- .version = LIBAVUTIL_VERSION_INT,
79- };
80-
81- - const URLProtocol ff_async_protocol = {
82- + URLProtocol ff_async_protocol = {
83- .name = "async",
84- .url_open2 = async_open,
85- .url_read = async_read,
8674diff --git a/libavformat/demux.c b/libavformat/demux.c
8775index 4fd22c4..ff62292 100644
8876--- a/libavformat/demux.c
@@ -143,10 +131,10 @@ index 9c76095..8b0af4c 100644
143131 * set. 'avformat_new_stream' can be called only if the flag
144132diff --git a/libavformat/ijkutils.c b/libavformat/ijkutils.c
145133new file mode 100644
146- index 0000000..107b238
134+ index 0000000..42cc77c
147135--- /dev/null
148136+++ b/libavformat/ijkutils.c
149- @@ -0,0 +1,101 @@
137+ @@ -0,0 +1,102 @@
150138+ /*
151139+ * utils.c
152140+ *
@@ -172,7 +160,7 @@ index 0000000..107b238
172160+
173161+ #include <stdlib.h>
174162+ #include "url.h"
175- + #include "avformat .h"
163+ + #include "demux .h"
176164+
177165+
178166+ #define IJK_FF_PROTOCOL(x) \
@@ -208,19 +196,18 @@ index 0000000..107b238
208196+ return -1;
209197+ }
210198+
211- + IJK_FF_PROTOCOL(async);
212199+ IJK_DUMMY_PROTOCOL(ijkmediadatasource);
213200+ IJK_DUMMY_PROTOCOL(ijkhttphook);
214201+ IJK_DUMMY_PROTOCOL(ijksegment);
215202+ IJK_DUMMY_PROTOCOL(ijktcphook);
216203+ IJK_DUMMY_PROTOCOL(ijkio);
217204+
218205+ #define IJK_FF_DEMUXER(x) \
219- + extern AVInputFormat ff_##x##_demuxer; \
220- + int ijkav_register_##x##_demuxer(AVInputFormat *demuxer, int demuxer_size); \
221- + int ijkav_register_##x##_demuxer(AVInputFormat *demuxer, int demuxer_size) \
206+ + extern FFInputFormat ff_##x##_demuxer; \
207+ + int ijkav_register_##x##_demuxer(FFInputFormat *demuxer, int demuxer_size); \
208+ + int ijkav_register_##x##_demuxer(FFInputFormat *demuxer, int demuxer_size) \
222209+ { \
223- + if (demuxer_size != sizeof(AVInputFormat )) { \
210+ + if (demuxer_size != sizeof(FFInputFormat )) { \
224211+ av_log(NULL, AV_LOG_ERROR, "ijkav_register_##x##_demuxer: ABI mismatch.\n"); \
225212+ return -1; \
226213+ } \
@@ -236,9 +223,11 @@ index 0000000..107b238
236223+ .version = LIBAVUTIL_VERSION_INT, \
237224+ }; \
238225+ \
239- + AVInputFormat ff_##x##_demuxer = { \
240- + .name = #x, \
241- + .priv_class = &ijk_##x##_demuxer_class, \
226+ + FFInputFormat ff_##x##_demuxer = { \
227+ + .p.name = #x, \
228+ + .p.priv_class = &ijk_##x##_demuxer_class, \
229+ + .priv_data_size = 1, \
230+ + .flags_internal = FF_INFMT_FLAG_INIT_CLEANUP, \
242231+ };
243232+
244233+ /*
0 commit comments