hc
2023-11-20 2e7bd41e4e8ab3d1efdabd9e263a2f7fe79bff8c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
From 03582e4b7a73abe6556fb9786e48d0181a812e54 Mon Sep 17 00:00:00 2001
From: Francis Fan <francis.fan@rock-chips.com>
Date: Fri, 5 Jul 2019 16:24:56 +0800
Subject: [PATCH 11/11] rv1108: update ffmpeg config menu for rkffplay
 
Change-Id: If6bc9d6737f69c96c4fd44c56816e5c5aaf86513
Signed-off-by: Francis Fan <francis.fan@rock-chips.com>
---
 Config.in   | 105 ++++++++++++++++++++++++++++++++++++++++++++++++---
 configure   |   2 +-
 ffmpeg.rvmk | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++----------
 3 files changed, 203 insertions(+), 26 deletions(-)
 
diff --git a/Config.in b/Config.in
index fa5d564..8d07a08 100644
--- a/Config.in
+++ b/Config.in
@@ -35,14 +35,35 @@ config RV_TARGET_FFMPEG_NONFREE
       allow use of nonfree code, the resulting libs and binaries
       will be unredistributable
 
-config RV_TARGET_FFMPEG_DISABLE_FFPLAY
-    bool "Disable ffplay"
+config RV_TARGET_FFMPEG_ENABLE_ION
+    bool "Enable ion type for hwcontext table"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_VERSION3
+    bool "Enable version3"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_RKMPP
+    bool "Enable rkmpp"
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_FFMPEG
+    bool "Disable ffmpeg"
     default n
 
 config RV_TARGET_FFMPEG_DISABLE_FFPORBE
     bool "Disable ffprobe"
     default n
 
+config RV_TARGET_FFMPEG_DISABLE_FFPLAY
+    bool "Disable ffplay"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_SDL
+    bool "Enable sdl for ffplay"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_FFPLAY)
+    default y if (!RV_TARGET_FFMPEG_DISABLE_FFPLAY)
+
 config RV_TARGET_FFMPEG_DISABLE_COREIMAGE
     bool "Disable core image"
     default n
@@ -59,24 +80,54 @@ config RV_TARGET_FFMPEG_DISABLE_BSFS
     bool "Disable bsfs"
     default n
 
+config RV_TARGET_FFMPEG_DISABLE_EVERYTHING
+    bool "Disable everything"
+    default y
+
 config RV_TARGET_FFMPEG_DISABLE_MUXERS
     bool "Disable all muxers"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
     default n
 
 config RV_TARGET_FFMPEG_DISABLE_DEMUXERS
     bool "Disable all demuxers"
-    default n
-
-config RV_TARGET_FFMPEG_DISABLE_FILTERS
-    bool "Disable all filters"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
     default n
 
 config RV_TARGET_FFMPEG_DISABLE_ENCODERS
     bool "Disable all encoders"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
     default n
 
 config RV_TARGET_FFMPEG_DISABLE_DECODERS
     bool "Disable all decoders"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_DEVICES
+    bool "Disable all devices"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_FILTERS
+    bool "Disable all filters"
+    depends on (!RV_TARGET_FFMPEG_DISABLE_EVERYTHING)
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_AVDEVICES
+    bool "Disable all avdevices"
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_AVFILTERS
+    bool "Disable all avfilters"
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_SWSCALE
+    bool "Disable swscale"
+    default n
+
+config RV_TARGET_FFMPEG_DISABLE_SWRESAMPLE
+    bool "Disable swresample"
     default n
 
 config RV_TARGET_FFMPEG_DEMUXER_H264
@@ -187,8 +238,29 @@ config RV_TARGET_FFMPEG_ENABLE_DECODER_AACLATM
     bool "Enable decoder:aac_latm"
     default n
 
+config RV_TARGET_FFMPEG_ENABLE_DECODER_AC3
+    bool "Enable decoder:ac3"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DECODER_MPEG4
+    bool "Enable decoder:mpeg4"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DECODER_H264
+    bool "Enable decoder:h264"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DECODER_ASS
+    bool "Enable decoder:ass"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DECODER_VORBIS
+    bool "Enable decoder:vorbis"
+    default n
+
 config RV_TARGET_FFMPEG_ENABLE_DECODER_RKMPP
     bool "Enable decoder:rk_mpp"
+    depends on RV_TARGET_FFMPEG_ENABLE_RKMPP
     default n
 
 
@@ -202,6 +274,7 @@ config RV_TARGET_FFMPEG_ENABLE_ENCODER_PCM32
 
 config RV_TARGET_FFMPEG_ENABLE_ENCODER_RKMPP
     bool "Enable encoder:rk_mpp"
+    depends on RV_TARGET_FFMPEG_ENABLE_RKMPP
     default n
 
 config RV_TARGET_FFMPEG_ENABLE_MUXER_PCM32
@@ -292,8 +365,28 @@ config RV_TARGET_FFMPEG_ENABLE_DEMUXER_WAV
     bool "Enable demuxer:wav"
     default n
 
+config RV_TARGET_FFMPEG_ENABLE_DEMUXER_AC3
+    bool "Enable demuxer:ac3"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DEMUXER_MPEGVIDEO
+    bool "Enable demuxer:mpegvideo"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DEMUXER_MATROSKA
+    bool "Enable demuxer:matroska"
+    default n
+
+config RV_TARGET_FFMPEG_ENABLE_DEMUXER_ASS
+    bool "Enable demuxer:ass"
+    default n
+
 config RV_TARGET_FFMPEG_ENABLE_PARSER_H264
     bool "Enable parser:h264"
     default n
 
+config RV_TARGET_FFMPEG_ENABLE_FILTER_ARESAMPLE
+    bool "Enable filter:aresample"
+    default n
+
 endif
diff --git a/configure b/configure
index 66f2497..b0630f6 100755
--- a/configure
+++ b/configure
@@ -6237,7 +6237,7 @@ enabled openssl           && { check_pkg_config openssl openssl openssl/ssl.h OP
 enabled rkmpp             && { require_pkg_config rkmpp rockchip_mpp  rockchip/rk_mpi.h mpp_create &&
                                require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
                                { enabled libdrm ||
-                                 die "ERROR: rkmpp requires --enable-libdrm"; }
+                                 warn "WARNING: rkmpp requires --enable-libdrm"; }
                              }
 enabled vapoursynth       && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
 
diff --git a/ffmpeg.rvmk b/ffmpeg.rvmk
index 9ffe027..bd2b729 100644
--- a/ffmpeg.rvmk
+++ b/ffmpeg.rvmk
@@ -18,28 +18,9 @@ FFMPEG_CONF_OPTS = \
     --pkg-config=$(PKG_CONFIG_HOST_BINARY) \
     --pkgconfigdir=$(TARGET_DIR)/lib/pkgconfig \
     --enable-cross-compile \
-    --disable-programs \
     --disable-doc \
-    --disable-avdevice \
     --disable-postproc \
-    --disable-swscale \
-    --disable-avfilter \
     --disable-w32threads --disable-os2threads \
-    --disable-pixelutils \
-    --disable-everything \
-    --disable-hwaccels \
-    --disable-audiotoolbox \
-    --disable-iconv \
-    --disable-libxcb \
-    --disable-libxcb-shm \
-    --disable-libxcb-xfixes \
-    --disable-libxcb-shape \
-    --disable-schannel \
-    --disable-securetransport \
-    --disable-videotoolbox \
-    --disable-xlib \
-    --disable-asm \
-    --disable-zlib \
     --cross-prefix=$(TARGET_CROSS) \
     --target-os=linux \
     --arch=armv7-a \
@@ -76,6 +57,11 @@ FFMPEG_CONF_OPTS += --disable-ffprobe
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_FFPORBE
 
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_FFMPEG),y)
+FFMPEG_CONF_OPTS += --disable-ffmpeg
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_FFMPEG
+
 ifeq ($(RV_TARGET_FFMPEG_DISABLE_COREIMAGE),y)
 FFMPEG_CONF_OPTS += --disable-coreimage
 endif
@@ -96,6 +82,11 @@ FFMPEG_CONF_OPTS += --disable-bsfs
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_BSFS
 
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_EVERYTHING),y)
+FFMPEG_CONF_OPTS += --disable-everything
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_EVERYTHING
+
 ifeq ($(RV_TARGET_FFMPEG_DISABLE_MUXERS),y)
 FFMPEG_CONF_OPTS += --disable-muxers
 endif
@@ -111,6 +102,27 @@ FFMPEG_CONF_OPTS += --disable-filters
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_FILTERS
 
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_DEVICES),y)
+FFMPEG_CONF_OPTS += --disable-devices
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_DEVICES
+
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_AVDEVICES),y)
+FFMPEG_CONF_OPTS += --disable-avdevice
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_AVDEVICES
+
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_AVFILTERS),y)
+FFMPEG_CONF_OPTS += --disable-avfilter
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_AVFILTERS
+
+ifeq ($(RV_TARGET_FFMPEG_DISABLE_SWSCALE),y)
+FFMPEG_CONF_OPTS += --disable-swscale
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_DISABLE_SWSCALE
+
+
 ifeq ($(RV_TARGET_FFMPEG_DISABLE_ENCODERS),y)
 FFMPEG_CONF_OPTS += --disable-encoders
 endif
@@ -277,6 +289,26 @@ FFMPEG_CONF_OPTS += --enable-small
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_SMALL
 
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_ION),y)
+FFMPEG_CONF_OPTS += --extra-cflags="-DCONFIG_ION"
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_ION
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_SDL),y)
+FFMPEG_CONF_OPTS += --enable-sdl
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_SDL
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_VERSION3),y)
+FFMPEG_CONF_OPTS += --enable-version3
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_VERSION3
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_RKMPP),y)
+FFMPEG_CONF_OPTS += --enable-rkmpp
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_RKMPP
+
 ####################### DECODER ################################
 
 ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_FDKAAC),y)
@@ -309,6 +341,30 @@ FFMPEG_CONF_OPTS += --enable-decoder=h264_rkmpp
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_RKMPP
 
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_AC3),y)
+FFMPEG_CONF_OPTS += --enable-decoder=ac3
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_AC3
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_MPEG4),y)
+FFMPEG_CONF_OPTS += --enable-decoder=mpeg4
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_MPEG4
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_H264),y)
+FFMPEG_CONF_OPTS += --enable-decoder=h264
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_H264
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_ASS),y)
+FFMPEG_CONF_OPTS += --enable-decoder=ass
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_ASS
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DECODER_VORBIS),y)
+FFMPEG_CONF_OPTS += --enable-decoder=vorbis
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DECODER_VORBIS
 
 ##################### ENCODER #######################
 
@@ -462,6 +518,26 @@ FFMPEG_CONF_OPTS += --enable-demuxer=wav
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DEMUXER_WAV
 
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DEMUXER_AC3),y)
+FFMPEG_CONF_OPTS += --enable-demuxer=ac3
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DEMUXER_AC3
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DEMUXER_MPEGVIDEO),y)
+FFMPEG_CONF_OPTS += --enable-demuxer=mpegvideo
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DEMUXER_MPEGVIDEO
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DEMUXER_MATROSKA),y)
+FFMPEG_CONF_OPTS += --enable-demuxer=matroska
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DEMUXER_MATROSKA
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_DEMUXER_ASS),y)
+FFMPEG_CONF_OPTS += --enable-demuxer=ass
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_DEMUXER_ASS
+
 ############# PARSER #######################
 
 ifeq ($(RV_TARGET_FFMPEG_ENABLE_PARSER_H264),y)
@@ -469,6 +545,14 @@ FFMPEG_CONF_OPTS += --enable-parser=h264
 endif
 FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_PARSER_H264
 
+############# FILTER #######################
+
+ifeq ($(RV_TARGET_FFMPEG_ENABLE_FILTER_ARESAMPLE),y)
+FFMPEG_CONF_OPTS += --enable-filter=aresample
+endif
+FFMPEG_CONFIGURE_DEP_CONFIGS += RV_TARGET_FFMPEG_ENABLE_FILTER_ARESAMPLE
+
+
 FFMPEG_CONF_OPTS += --extra-cflags="$(FFMPEG_EXTRA_CFLAGS)"
 
 $(eval $(rv-generic-configure))
-- 
2.7.4