1
- From fc20f37d242895412029521935804a96d9d0bf0c Mon Sep 17 00:00:00 2001
1
+ From a8dc36d3060372153fe0cc93b2a9af3a50271aba Mon Sep 17 00:00:00 2001
2
2
From: qianlongxu <qianlongxu@gmail.com>
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
5
6
6
7
---
7
8
libavcodec/Makefile | 1 +
8
- libavformat/Makefile | 9 ++++
9
+ libavformat/Makefile | 10 ++++
9
10
libavformat/allformats.c | 4 ++
10
- libavformat/async.c | 2 +-
11
11
libavformat/demux.c | 13 +++++
12
12
libavformat/demux.h | 2 +
13
- libavformat/ijkutils.c | 101 +++++++++++++++++++++++++++++++++++++++
13
+ libavformat/ijkutils.c | 102 +++++++++++++++++++++++++++++++++++++++
14
14
libavformat/protocols.c | 6 +++
15
15
libavutil/Makefile | 1 +
16
- 9 files changed, 138 insertions(+), 1 deletion(- )
16
+ 8 files changed, 139 insertions(+)
17
17
create mode 100644 libavformat/ijkutils.c
18
18
19
19
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
@@ -29,13 +29,14 @@ index a4fcce3..ed5c705 100644
29
29
OBJS = ac3_parser.o \
30
30
adts_parser.o \
31
31
diff --git a/libavformat/Makefile b/libavformat/Makefile
32
- index e5934e9..359781b 100644
32
+ index e5934e9..5e88060 100644
33
33
--- a/libavformat/Makefile
34
34
+++ b/libavformat/Makefile
35
- @@ -7,6 +7,14 @@ HEADERS = avformat.h \
35
+ @@ -7,6 +7,15 @@ HEADERS = avformat.h \
36
36
version_major.h \
37
37
application.h \
38
38
dns_cache.h \
39
+ + demux.h \
39
40
+ avc.h \
40
41
+ url.h \
41
42
+ internal.h \
@@ -47,7 +48,7 @@ index e5934e9..359781b 100644
47
48
48
49
OBJS = allformats.o \
49
50
avformat.o \
50
- @@ -34,6 +42 ,7 @@ OBJS = allformats.o \
51
+ @@ -34,6 +43 ,7 @@ OBJS = allformats.o \
51
52
version.o \
52
53
application.o \
53
54
dns_cache.o \
@@ -70,19 +71,6 @@ index 305fa46..063be70 100644
70
71
#include "libavformat/muxer_list.c"
71
72
#include "libavformat/demuxer_list.c"
72
73
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,
86
74
diff --git a/libavformat/demux.c b/libavformat/demux.c
87
75
index 4fd22c4..ff62292 100644
88
76
--- a/libavformat/demux.c
@@ -143,10 +131,10 @@ index 9c76095..8b0af4c 100644
143
131
* set. 'avformat_new_stream' can be called only if the flag
144
132
diff --git a/libavformat/ijkutils.c b/libavformat/ijkutils.c
145
133
new file mode 100644
146
- index 0000000..107b238
134
+ index 0000000..42cc77c
147
135
--- /dev/null
148
136
+++ b/libavformat/ijkutils.c
149
- @@ -0,0 +1,101 @@
137
+ @@ -0,0 +1,102 @@
150
138
+ /*
151
139
+ * utils.c
152
140
+ *
@@ -172,7 +160,7 @@ index 0000000..107b238
172
160
+
173
161
+ #include <stdlib.h>
174
162
+ #include "url.h"
175
- + #include "avformat .h"
163
+ + #include "demux .h"
176
164
+
177
165
+
178
166
+ #define IJK_FF_PROTOCOL(x) \
@@ -208,19 +196,18 @@ index 0000000..107b238
208
196
+ return -1;
209
197
+ }
210
198
+
211
- + IJK_FF_PROTOCOL(async);
212
199
+ IJK_DUMMY_PROTOCOL(ijkmediadatasource);
213
200
+ IJK_DUMMY_PROTOCOL(ijkhttphook);
214
201
+ IJK_DUMMY_PROTOCOL(ijksegment);
215
202
+ IJK_DUMMY_PROTOCOL(ijktcphook);
216
203
+ IJK_DUMMY_PROTOCOL(ijkio);
217
204
+
218
205
+ #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) \
222
209
+ { \
223
- + if (demuxer_size != sizeof(AVInputFormat )) { \
210
+ + if (demuxer_size != sizeof(FFInputFormat )) { \
224
211
+ av_log(NULL, AV_LOG_ERROR, "ijkav_register_##x##_demuxer: ABI mismatch.\n"); \
225
212
+ return -1; \
226
213
+ } \
@@ -236,9 +223,11 @@ index 0000000..107b238
236
223
+ .version = LIBAVUTIL_VERSION_INT, \
237
224
+ }; \
238
225
+ \
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, \
242
231
+ };
243
232
+
244
233
+ /*
0 commit comments