diff --git a/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch b/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch index 6d607f62b2..f0e0ffe03b 100644 --- a/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch +++ b/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch @@ -1,7 +1,7 @@ -From 504df93cfe5416b394755e79b7b81ee0119cf09c Mon Sep 17 00:00:00 2001 +From bedd295922f7df955c45801720503eb632711525 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Apr 2021 12:34:50 +0100 -Subject: [PATCH 001/161] Add pi configs and scripts +Subject: [PATCH 001/186] Add pi configs and scripts --- pi-util/BUILD.txt | 59 ++++++++ @@ -44,7 +44,7 @@ Subject: [PATCH 001/161] Add pi configs and scripts diff --git a/pi-util/BUILD.txt b/pi-util/BUILD.txt new file mode 100644 -index 0000000000..b050971f63 +index 000000000000..b050971f63c5 --- /dev/null +++ b/pi-util/BUILD.txt @@ -0,0 +1,59 @@ @@ -109,7 +109,7 @@ index 0000000000..b050971f63 + diff --git a/pi-util/NOTES.txt b/pi-util/NOTES.txt new file mode 100644 -index 0000000000..fcce72226a +index 000000000000..fcce72226a32 --- /dev/null +++ b/pi-util/NOTES.txt @@ -0,0 +1,69 @@ @@ -184,7 +184,7 @@ index 0000000000..fcce72226a + diff --git a/pi-util/TESTMESA.txt b/pi-util/TESTMESA.txt new file mode 100644 -index 0000000000..92bc13a3df +index 000000000000..92bc13a3dfa1 --- /dev/null +++ b/pi-util/TESTMESA.txt @@ -0,0 +1,82 @@ @@ -272,7 +272,7 @@ index 0000000000..92bc13a3df + diff --git a/pi-util/clean_usr_libs.sh b/pi-util/clean_usr_libs.sh new file mode 100755 -index 0000000000..b3b2d5509d +index 000000000000..b3b2d5509de0 --- /dev/null +++ b/pi-util/clean_usr_libs.sh @@ -0,0 +1,26 @@ @@ -304,7 +304,7 @@ index 0000000000..b3b2d5509d + diff --git a/pi-util/conf_arm64_native.sh b/pi-util/conf_arm64_native.sh new file mode 100644 -index 0000000000..9e3bbfa190 +index 000000000000..9e3bbfa1908a --- /dev/null +++ b/pi-util/conf_arm64_native.sh @@ -0,0 +1,45 @@ @@ -355,7 +355,7 @@ index 0000000000..9e3bbfa190 +# -Wa,-ahls diff --git a/pi-util/conf_h265.2016.csv b/pi-util/conf_h265.2016.csv new file mode 100644 -index 0000000000..4efd5d1c67 +index 000000000000..4efd5d1c676d --- /dev/null +++ b/pi-util/conf_h265.2016.csv @@ -0,0 +1,195 @@ @@ -556,7 +556,7 @@ index 0000000000..4efd5d1c67 +1,local/intra_pred_21_laps,intra_pred_21_laps.265,intra_pred_21_laps.md5,8 diff --git a/pi-util/conf_h265.2016_HEVC_v1.csv b/pi-util/conf_h265.2016_HEVC_v1.csv new file mode 100644 -index 0000000000..6082641271 +index 000000000000..60826412715c --- /dev/null +++ b/pi-util/conf_h265.2016_HEVC_v1.csv @@ -0,0 +1,147 @@ @@ -709,7 +709,7 @@ index 0000000000..6082641271 +1,WPP_F_ericsson_MAIN_2,WPP_F_ericsson_MAIN_2.bit,WPP_F_ericsson_MAIN_2_yuv.md5 diff --git a/pi-util/conf_h265.csv b/pi-util/conf_h265.csv new file mode 100644 -index 0000000000..fc14f2a3c2 +index 000000000000..fc14f2a3c2bb --- /dev/null +++ b/pi-util/conf_h265.csv @@ -0,0 +1,144 @@ @@ -859,7 +859,7 @@ index 0000000000..fc14f2a3c2 +1,WPP_F_ericsson_MAIN_2,WPP_F_ericsson_MAIN_2.bit,WPP_F_ericsson_MAIN_2_yuv.md5 diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh new file mode 100755 -index 0000000000..65576846e8 +index 000000000000..65576846e81f --- /dev/null +++ b/pi-util/conf_native.sh @@ -0,0 +1,108 @@ @@ -973,7 +973,7 @@ index 0000000000..65576846e8 +# -Wa,-ahls diff --git a/pi-util/ffconf.py b/pi-util/ffconf.py new file mode 100755 -index 0000000000..657568014e +index 000000000000..657568014e57 --- /dev/null +++ b/pi-util/ffconf.py @@ -0,0 +1,215 @@ @@ -1194,7 +1194,7 @@ index 0000000000..657568014e + diff --git a/pi-util/ffperf.py b/pi-util/ffperf.py new file mode 100755 -index 0000000000..65c5224cd8 +index 000000000000..65c5224cd8fb --- /dev/null +++ b/pi-util/ffperf.py @@ -0,0 +1,128 @@ @@ -1328,7 +1328,7 @@ index 0000000000..65c5224cd8 + diff --git a/pi-util/genpatch.sh b/pi-util/genpatch.sh new file mode 100755 -index 0000000000..0948a68a7a +index 000000000000..0948a68a7ad7 --- /dev/null +++ b/pi-util/genpatch.sh @@ -0,0 +1,35 @@ @@ -1369,7 +1369,7 @@ index 0000000000..0948a68a7a +git diff n$VERSION -- > $PATCHFILE diff --git a/pi-util/make_array.py b/pi-util/make_array.py new file mode 100755 -index 0000000000..67b22d2d51 +index 000000000000..67b22d2d517f --- /dev/null +++ b/pi-util/make_array.py @@ -0,0 +1,23 @@ @@ -1398,7 +1398,7 @@ index 0000000000..67b22d2d51 + diff --git a/pi-util/mkinst.sh b/pi-util/mkinst.sh new file mode 100755 -index 0000000000..271a39e846 +index 000000000000..271a39e8460a --- /dev/null +++ b/pi-util/mkinst.sh @@ -0,0 +1,5 @@ @@ -1409,7 +1409,7 @@ index 0000000000..271a39e846 +cp -r install/* ../vlc/sysroot/raspian_stretch_pi1-sysroot/usr diff --git a/pi-util/patkodi.sh b/pi-util/patkodi.sh new file mode 100644 -index 0000000000..dcd05a606e +index 000000000000..dcd05a606e85 --- /dev/null +++ b/pi-util/patkodi.sh @@ -0,0 +1,9 @@ @@ -1424,7 +1424,7 @@ index 0000000000..dcd05a606e + diff --git a/pi-util/perfcmp.py b/pi-util/perfcmp.py new file mode 100755 -index 0000000000..e44cfa0c3c +index 000000000000..e44cfa0c3c4d --- /dev/null +++ b/pi-util/perfcmp.py @@ -0,0 +1,101 @@ @@ -1531,7 +1531,7 @@ index 0000000000..e44cfa0c3c + diff --git a/pi-util/qem.sh b/pi-util/qem.sh new file mode 100755 -index 0000000000..a4dbb6eacd +index 000000000000..a4dbb6eacd18 --- /dev/null +++ b/pi-util/qem.sh @@ -0,0 +1,9 @@ @@ -1546,7 +1546,7 @@ index 0000000000..a4dbb6eacd + diff --git a/pi-util/v3dusage.py b/pi-util/v3dusage.py new file mode 100755 -index 0000000000..5935a11ca5 +index 000000000000..5935a11ca553 --- /dev/null +++ b/pi-util/v3dusage.py @@ -0,0 +1,128 @@ @@ -1679,10 +1679,10 @@ index 0000000000..5935a11ca5 + do_logparse(args.logfile) + -From f3eaadb27a5bc6db07d33ce0814d796e8cee623e Mon Sep 17 00:00:00 2001 +From b6b137b1d039b42b15325f87f55cb7c38e2270b0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:27:39 +0100 -Subject: [PATCH 002/161] Add sand pix fmts & conversion fns +Subject: [PATCH 002/186] Add sand pix fmts & conversion fns --- configure | 3 + @@ -1703,7 +1703,7 @@ Subject: [PATCH 002/161] Add sand pix fmts & conversion fns create mode 100644 libavutil/rpi_sand_fns.h diff --git a/configure b/configure -index b6616f00b6..27112ced58 100755 +index 3cd3bdfb4496..5a5ada20711f 100755 --- a/configure +++ b/configure @@ -344,6 +344,7 @@ External library support: @@ -1731,7 +1731,7 @@ index b6616f00b6..27112ced58 100755 sinewin snappy diff --git a/libavutil/Makefile b/libavutil/Makefile -index dc9012f9a8..e33f5db099 100644 +index dc9012f9a83a..e33f5db0996a 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -73,6 +73,7 @@ HEADERS = adler32.h \ @@ -1759,7 +1759,7 @@ index dc9012f9a8..e33f5db099 100644 SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += hwcontext_videotoolbox.h SKIPHEADERS-$(CONFIG_VDPAU) += hwcontext_vdpau.h diff --git a/libavutil/arm/Makefile b/libavutil/arm/Makefile -index 5da44b0542..b74b7c4e2f 100644 +index 5da44b05427a..b74b7c4e2f25 100644 --- a/libavutil/arm/Makefile +++ b/libavutil/arm/Makefile @@ -6,3 +6,4 @@ VFP-OBJS += arm/float_dsp_init_vfp.o \ @@ -1769,7 +1769,7 @@ index 5da44b0542..b74b7c4e2f 100644 + arm/rpi_sand_neon.o \ diff --git a/libavutil/arm/rpi_sand_neon.S b/libavutil/arm/rpi_sand_neon.S new file mode 100644 -index 0000000000..80890fe985 +index 000000000000..80890fe9854b --- /dev/null +++ b/libavutil/arm/rpi_sand_neon.S @@ -0,0 +1,768 @@ @@ -2543,7 +2543,7 @@ index 0000000000..80890fe985 + diff --git a/libavutil/arm/rpi_sand_neon.h b/libavutil/arm/rpi_sand_neon.h new file mode 100644 -index 0000000000..447f367bea +index 000000000000..447f367bea8f --- /dev/null +++ b/libavutil/arm/rpi_sand_neon.h @@ -0,0 +1,99 @@ @@ -2647,7 +2647,7 @@ index 0000000000..447f367bea +#endif // AVUTIL_ARM_SAND_NEON_H + diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c -index 62a2ae08d9..cb73521ea7 100644 +index 62a2ae08d907..cb73521ea75c 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -2717,6 +2717,50 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { @@ -2702,7 +2702,7 @@ index 62a2ae08d9..cb73521ea7 100644 static const char * const color_range_names[] = { diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h -index 37c2c79e01..22f70007c3 100644 +index 37c2c79e0140..22f70007c3df 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -377,6 +377,12 @@ enum AVPixelFormat { @@ -2720,7 +2720,7 @@ index 37c2c79e01..22f70007c3 100644 AV_PIX_FMT_X2RGB10BE, ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined diff --git a/libavutil/rpi_sand_fn_pw.h b/libavutil/rpi_sand_fn_pw.h new file mode 100644 -index 0000000000..0324f6826d +index 000000000000..0324f6826dde --- /dev/null +++ b/libavutil/rpi_sand_fn_pw.h @@ -0,0 +1,227 @@ @@ -2953,7 +2953,7 @@ index 0000000000..0324f6826d + diff --git a/libavutil/rpi_sand_fns.c b/libavutil/rpi_sand_fns.c new file mode 100644 -index 0000000000..ed0261b02f +index 000000000000..ed0261b02f07 --- /dev/null +++ b/libavutil/rpi_sand_fns.c @@ -0,0 +1,353 @@ @@ -3312,7 +3312,7 @@ index 0000000000..ed0261b02f +} diff --git a/libavutil/rpi_sand_fns.h b/libavutil/rpi_sand_fns.h new file mode 100644 -index 0000000000..634b55e800 +index 000000000000..634b55e800dc --- /dev/null +++ b/libavutil/rpi_sand_fns.h @@ -0,0 +1,183 @@ @@ -3500,10 +3500,10 @@ index 0000000000..634b55e800 +#endif + -From 89b8d6ac2a886749d4594656083753e682de05a7 Mon Sep 17 00:00:00 2001 +From c1b879de52690fb978f344b05cb213c34c35021f Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:36:47 +0100 -Subject: [PATCH 003/161] Add aarch64 asm sand conv functions +Subject: [PATCH 003/186] Add aarch64 asm sand conv functions Many thanks to eiler.mike@gmail.com (Michael Eiler) for these optimizations @@ -3518,7 +3518,7 @@ optimizations create mode 100644 libavutil/aarch64/rpi_sand_neon.h diff --git a/libavutil/aarch64/Makefile b/libavutil/aarch64/Makefile -index eba0151337..1b44beab39 100644 +index eba01513379a..1b44beab3942 100644 --- a/libavutil/aarch64/Makefile +++ b/libavutil/aarch64/Makefile @@ -4,3 +4,5 @@ OBJS += aarch64/cpu.o \ @@ -3529,7 +3529,7 @@ index eba0151337..1b44beab39 100644 + diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S new file mode 100644 -index 0000000000..cdcf71ee67 +index 000000000000..cdcf71ee6740 --- /dev/null +++ b/libavutil/aarch64/rpi_sand_neon.S @@ -0,0 +1,676 @@ @@ -4211,7 +4211,7 @@ index 0000000000..cdcf71ee67 + diff --git a/libavutil/aarch64/rpi_sand_neon.h b/libavutil/aarch64/rpi_sand_neon.h new file mode 100644 -index 0000000000..b3aa481ea4 +index 000000000000..b3aa481ea497 --- /dev/null +++ b/libavutil/aarch64/rpi_sand_neon.h @@ -0,0 +1,55 @@ @@ -4271,7 +4271,7 @@ index 0000000000..b3aa481ea4 +#endif + diff --git a/libavutil/rpi_sand_fn_pw.h b/libavutil/rpi_sand_fn_pw.h -index 0324f6826d..0d5d203dc3 100644 +index 0324f6826dde..0d5d203dc3cd 100644 --- a/libavutil/rpi_sand_fn_pw.h +++ b/libavutil/rpi_sand_fn_pw.h @@ -54,7 +54,7 @@ void FUNC(av_rpi_sand_to_planar_y)(uint8_t * dst, const unsigned int dst_stride, @@ -4293,7 +4293,7 @@ index 0324f6826d..0d5d203dc3 100644 ff_rpi_sand8_lines_to_planar_c8(dst_u, dst_stride_u, dst_v, dst_stride_v, src, stride1, stride2, _x, y, _w, h); diff --git a/libavutil/rpi_sand_fns.c b/libavutil/rpi_sand_fns.c -index ed0261b02f..1f543e9357 100644 +index ed0261b02f07..1f543e935701 100644 --- a/libavutil/rpi_sand_fns.c +++ b/libavutil/rpi_sand_fns.c @@ -37,6 +37,9 @@ Authors: John Cox @@ -4307,10 +4307,10 @@ index ed0261b02f..1f543e9357 100644 #define HAVE_SAND_ASM 0 #endif -From 247025a42ae09d6c9c5d4128a5e4b288b7b3047c Mon Sep 17 00:00:00 2001 +From c45ddc15e96adf8d90eb0c849d60499849213a12 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:56:02 +0100 -Subject: [PATCH 004/161] Add raw encoding for sand +Subject: [PATCH 004/186] Add raw encoding for sand --- libavcodec/raw.c | 6 +++ @@ -4318,7 +4318,7 @@ Subject: [PATCH 004/161] Add raw encoding for sand 2 files changed, 96 insertions(+), 2 deletions(-) diff --git a/libavcodec/raw.c b/libavcodec/raw.c -index 1e5b48d1e0..1e689f9ee0 100644 +index 1e5b48d1e06c..1e689f9ee0b8 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -295,6 +295,12 @@ static const PixelFormatTag raw_pix_fmt_tags[] = { @@ -4335,7 +4335,7 @@ index 1e5b48d1e0..1e689f9ee0 100644 }; diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c -index 8c577006d9..594a77c42a 100644 +index 8c577006d922..594a77c42a64 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -24,6 +24,7 @@ @@ -4456,10 +4456,10 @@ index 8c577006d9..594a77c42a 100644 return ret; -From ac6961f424b56563dc793b6bc002a8c04cb1bc36 Mon Sep 17 00:00:00 2001 +From 3e02e6190c567a58c8153ba2627f61677b58d6fb Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:02:09 +0100 -Subject: [PATCH 005/161] Deal with the lack of trivial sand cropping +Subject: [PATCH 005/186] Deal with the lack of trivial sand cropping --- fftools/ffmpeg.c | 4 ++-- @@ -4469,10 +4469,10 @@ Subject: [PATCH 005/161] Deal with the lack of trivial sand cropping 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c -index d721a5e721..15e084f0b2 100644 +index c819d30ca523..ca5431aeb401 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c -@@ -1993,8 +1993,8 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_ref +@@ -1996,8 +1996,8 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_ref av_channel_layout_compare(&ifilter->ch_layout, &frame->ch_layout); break; case AVMEDIA_TYPE_VIDEO: @@ -4484,10 +4484,10 @@ index d721a5e721..15e084f0b2 100644 } diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c -index 1f5bbf6c4d..f888307762 100644 +index 686a33c2bae7..cfe3351c522f 100644 --- a/fftools/ffmpeg_filter.c +++ b/fftools/ffmpeg_filter.c -@@ -1281,8 +1281,8 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) +@@ -1283,8 +1283,8 @@ int ifilter_parameters_from_frame(InputFilter *ifilter, const AVFrame *frame) ifilter->format = frame->format; @@ -4499,7 +4499,7 @@ index 1f5bbf6c4d..f888307762 100644 ifilter->sample_rate = frame->sample_rate; diff --git a/libavutil/frame.c b/libavutil/frame.c -index 9545477acc..48621e4098 100644 +index 9545477acc95..48621e40989f 100644 --- a/libavutil/frame.c +++ b/libavutil/frame.c @@ -16,6 +16,8 @@ @@ -4535,7 +4535,7 @@ index 9545477acc..48621e4098 100644 if (!desc) return AVERROR_BUG; diff --git a/libavutil/frame.h b/libavutil/frame.h -index 2580269549..3a9d323325 100644 +index 25802695493a..3a9d323325a9 100644 --- a/libavutil/frame.h +++ b/libavutil/frame.h @@ -957,6 +957,16 @@ int av_frame_apply_cropping(AVFrame *frame, int flags); @@ -4556,10 +4556,10 @@ index 2580269549..3a9d323325 100644 * @} */ -From 9a08431f7790507b0374d9585dfc736000c1bd42 Mon Sep 17 00:00:00 2001 +From c7d8474ffa5689abf99367c43ec2d39a1957f564 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:31:16 +0100 -Subject: [PATCH 006/161] Add an unsand filter +Subject: [PATCH 006/186] Add an unsand filter --- configure | 1 + @@ -4571,7 +4571,7 @@ Subject: [PATCH 006/161] Add an unsand filter create mode 100644 libavfilter/vf_unsand.c diff --git a/configure b/configure -index 27112ced58..7712482bd5 100755 +index 5a5ada20711f..986f51b75b78 100755 --- a/configure +++ b/configure @@ -3754,6 +3754,7 @@ tonemap_opencl_filter_deps="opencl const_nan" @@ -4583,7 +4583,7 @@ index 27112ced58..7712482bd5 100755 uspp_filter_deps="gpl avcodec" vaguedenoiser_filter_deps="gpl" diff --git a/libavfilter/Makefile b/libavfilter/Makefile -index b3d3d981dd..c14fc995a0 100644 +index b3d3d981dd46..c14fc995a0b5 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -518,6 +518,7 @@ OBJS-$(CONFIG_TRANSPOSE_VAAPI_FILTER) += vf_transpose_vaapi.o vaapi_vpp.o @@ -4595,7 +4595,7 @@ index b3d3d981dd..c14fc995a0 100644 OBJS-$(CONFIG_UNSHARP_OPENCL_FILTER) += vf_unsharp_opencl.o opencl.o \ opencl/unsharp.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index d7db46c2af..b990a00152 100644 +index d7db46c2af92..b990a001529b 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -490,6 +490,7 @@ extern const AVFilter ff_vf_trim; @@ -4607,7 +4607,7 @@ index d7db46c2af..b990a00152 100644 extern const AVFilter ff_vf_uspp; extern const AVFilter ff_vf_v360; diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c -index ba17450b93..0dbe5d2335 100644 +index ba17450b9378..0dbe5d23355c 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -201,7 +201,7 @@ FF_ENABLE_DEPRECATION_WARNINGS @@ -4621,7 +4621,7 @@ index ba17450b93..0dbe5d2335 100644 case AVMEDIA_TYPE_AUDIO: diff --git a/libavfilter/vf_unsand.c b/libavfilter/vf_unsand.c new file mode 100644 -index 0000000000..7100f2fc9b +index 000000000000..7100f2fc9b1f --- /dev/null +++ b/libavfilter/vf_unsand.c @@ -0,0 +1,228 @@ @@ -4854,17 +4854,17 @@ index 0000000000..7100f2fc9b +}; + -From 6e61007b19544c573f1c2a4c6060d3d24b8d500e Mon Sep 17 00:00:00 2001 +From d154e34686db628b84d74d0808b080c1d1ce5c41 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:37:07 +0100 -Subject: [PATCH 007/161] Reduce mmal compile warnings +Subject: [PATCH 007/186] Reduce mmal compile warnings --- libavcodec/mmaldec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c -index 3092f58510..6f41b41ac4 100644 +index 3092f5851077..6f41b41ac4c0 100644 --- a/libavcodec/mmaldec.c +++ b/libavcodec/mmaldec.c @@ -24,6 +24,9 @@ @@ -4886,10 +4886,10 @@ index 3092f58510..6f41b41ac4 100644 #include "avcodec.h" -From 01aff455665e8f889330519096912ad0005add3c Mon Sep 17 00:00:00 2001 +From 1a7988f63e4137ebcc345470dcde20b62e71bdec Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 17:56:16 +0100 -Subject: [PATCH 008/161] Add chroma location to hevc parse +Subject: [PATCH 008/186] Add chroma location to hevc parse --- libavcodec/hevc_parser.c | 13 +++++++++++++ @@ -4897,7 +4897,7 @@ Subject: [PATCH 008/161] Add chroma location to hevc parse 2 files changed, 26 insertions(+) diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c -index 59f9a0ff3e..4ae7222e8b 100644 +index 59f9a0ff3e57..4ae7222e8b8d 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -97,6 +97,19 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, @@ -4921,7 +4921,7 @@ index 59f9a0ff3e..4ae7222e8b 100644 num = ps->vps->vps_num_units_in_tick; den = ps->vps->vps_time_scale; diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c -index 567e8d81d4..b6cfea64d3 100644 +index 0e2844f47cef..88482fd5215b 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -347,6 +347,19 @@ static void export_stream_params(HEVCContext *s, const HEVCSPS *sps) @@ -4945,10 +4945,10 @@ index 567e8d81d4..b6cfea64d3 100644 avctx->color_primaries = sps->vui.common.colour_primaries; avctx->color_trc = sps->vui.common.transfer_characteristics; -From c80aad5d2fb373f7564e4257b1272f2decb06dd0 Mon Sep 17 00:00:00 2001 +From 8e5f8555b5908ca720c4ffd8b3a784d956883317 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:20:50 +0100 -Subject: [PATCH 009/161] hwaccel: Add .abort_frame & use in hevcdec +Subject: [PATCH 009/186] hwaccel: Add .abort_frame & use in hevcdec --- libavcodec/avcodec.h | 11 +++++++++++ @@ -4956,7 +4956,7 @@ Subject: [PATCH 009/161] hwaccel: Add .abort_frame & use in hevcdec 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h -index 39881a1d2b..32bc78e2be 100644 +index 39881a1d2bcf..32bc78e2be25 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2221,6 +2221,17 @@ typedef struct AVHWAccel { @@ -4978,10 +4978,10 @@ index 39881a1d2b..32bc78e2be 100644 /** diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c -index b6cfea64d3..8a0246fa21 100644 +index 88482fd5215b..4ee564f3e028 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c -@@ -3375,8 +3375,13 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, +@@ -3378,8 +3378,13 @@ static int hevc_decode_frame(AVCodecContext *avctx, AVFrame *rframe, s->ref = NULL; ret = decode_nal_units(s, avpkt->data, avpkt->size); @@ -4997,10 +4997,10 @@ index b6cfea64d3..8a0246fa21 100644 if (avctx->hwaccel) { if (s->ref && (ret = avctx->hwaccel->end_frame(avctx)) < 0) { -From 317722fd652d9a1c1700319c80fc71acf68ddde6 Mon Sep 17 00:00:00 2001 +From f09419a30e1beae74ae167d8b33de4214cae6f0a Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:26:17 +0100 -Subject: [PATCH 010/161] hwaccel: Add CAP_MT_SAFE for accels that can use +Subject: [PATCH 010/186] hwaccel: Add CAP_MT_SAFE for accels that can use multi-thread --- @@ -5009,7 +5009,7 @@ Subject: [PATCH 010/161] hwaccel: Add CAP_MT_SAFE for accels that can use 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libavcodec/hwconfig.h b/libavcodec/hwconfig.h -index 721424912c..c43ad55245 100644 +index 721424912c46..c43ad55245ac 100644 --- a/libavcodec/hwconfig.h +++ b/libavcodec/hwconfig.h @@ -24,6 +24,7 @@ @@ -5021,7 +5021,7 @@ index 721424912c..c43ad55245 100644 typedef struct AVCodecHWConfigInternal { diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c -index d9d5afaa82..2cc89a41f5 100644 +index d9d5afaa82d8..2cc89a41f55f 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -204,7 +204,8 @@ static attribute_align_arg void *frame_worker_thread(void *arg) @@ -5046,10 +5046,10 @@ index d9d5afaa82..2cc89a41f5 100644 p->hwaccel_serializing = 1; } -From 9005b263450e154a5ec5258fda17d5998fe7896b Mon Sep 17 00:00:00 2001 +From 8142c4a1774c80ce059ddff3d6e4377803e3081d Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 17:59:08 +0100 -Subject: [PATCH 011/161] Weak link utils +Subject: [PATCH 011/186] Weak link utils --- libavcodec/weak_link.c | 102 +++++++++++++++++++++++++++++++++++++++++ @@ -5060,7 +5060,7 @@ Subject: [PATCH 011/161] Weak link utils diff --git a/libavcodec/weak_link.c b/libavcodec/weak_link.c new file mode 100644 -index 0000000000..f234a985b9 +index 000000000000..f234a985b9c1 --- /dev/null +++ b/libavcodec/weak_link.c @@ -0,0 +1,102 @@ @@ -5168,7 +5168,7 @@ index 0000000000..f234a985b9 + diff --git a/libavcodec/weak_link.h b/libavcodec/weak_link.h new file mode 100644 -index 0000000000..415b6a27a0 +index 000000000000..415b6a27a05c --- /dev/null +++ b/libavcodec/weak_link.h @@ -0,0 +1,23 @@ @@ -5196,10 +5196,10 @@ index 0000000000..415b6a27a0 + + -From 824be1710ca96d97c86836fdac0e7dcd28a4b92e Mon Sep 17 00:00:00 2001 +From 2610fffb3ca25f1a531876c80bf4c4b43c934386 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 19:23:26 +0100 -Subject: [PATCH 012/161] Add v4l2_req V4L2 request H265 drm_prime decode +Subject: [PATCH 012/186] Add v4l2_req V4L2 request H265 drm_prime decode Has the abiliy to switch between kernel API versions at runtime. This could be removed later once teher is no chance of usage on an old @@ -5249,7 +5249,7 @@ kernel. create mode 100644 libavcodec/v4l2_request_hevc.h diff --git a/configure b/configure -index 7712482bd5..199aa2b3d5 100755 +index 986f51b75b78..c09144673050 100755 --- a/configure +++ b/configure @@ -281,6 +281,7 @@ External library support: @@ -5330,7 +5330,7 @@ index 7712482bd5..199aa2b3d5 100755 test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index 389253f5d0..2d440b5648 100644 +index 389253f5d08e..2d440b56486b 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -170,6 +170,8 @@ OBJS-$(CONFIG_VP3DSP) += vp3dsp.o @@ -5353,7 +5353,7 @@ index 389253f5d0..2d440b5648 100644 OBJS-$(CONFIG_MJPEG_NVDEC_HWACCEL) += nvdec_mjpeg.o diff --git a/libavcodec/hevc-ctrls-v1.h b/libavcodec/hevc-ctrls-v1.h new file mode 100644 -index 0000000000..72cbba0953 +index 000000000000..72cbba0953dc --- /dev/null +++ b/libavcodec/hevc-ctrls-v1.h @@ -0,0 +1,229 @@ @@ -5588,7 +5588,7 @@ index 0000000000..72cbba0953 +#endif diff --git a/libavcodec/hevc-ctrls-v2.h b/libavcodec/hevc-ctrls-v2.h new file mode 100644 -index 0000000000..7cbbbf055f +index 000000000000..7cbbbf055f47 --- /dev/null +++ b/libavcodec/hevc-ctrls-v2.h @@ -0,0 +1,257 @@ @@ -5850,7 +5850,7 @@ index 0000000000..7cbbbf055f + +#endif diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c -index 8a0246fa21..2867cb2e16 100644 +index 4ee564f3e028..e892436f9405 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -416,6 +416,7 @@ static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps) @@ -5881,7 +5881,7 @@ index 8a0246fa21..2867cb2e16 100644 #endif break; case AV_PIX_FMT_YUV444P: -@@ -3749,6 +3756,9 @@ const FFCodec ff_hevc_decoder = { +@@ -3752,6 +3759,9 @@ const FFCodec ff_hevc_decoder = { #if CONFIG_HEVC_NVDEC_HWACCEL HWACCEL_NVDEC(hevc), #endif @@ -5892,7 +5892,7 @@ index 8a0246fa21..2867cb2e16 100644 HWACCEL_VAAPI(hevc), #endif diff --git a/libavcodec/hwaccels.h b/libavcodec/hwaccels.h -index aca55831f3..f32d1c4ec4 100644 +index aca55831f32f..f32d1c4ec4f8 100644 --- a/libavcodec/hwaccels.h +++ b/libavcodec/hwaccels.h @@ -40,6 +40,7 @@ extern const AVHWAccel ff_hevc_d3d11va_hwaccel; @@ -5904,7 +5904,7 @@ index aca55831f3..f32d1c4ec4 100644 extern const AVHWAccel ff_hevc_vdpau_hwaccel; extern const AVHWAccel ff_hevc_videotoolbox_hwaccel; diff --git a/libavcodec/hwconfig.h b/libavcodec/hwconfig.h -index c43ad55245..b8aa383071 100644 +index c43ad55245ac..b8aa38307169 100644 --- a/libavcodec/hwconfig.h +++ b/libavcodec/hwconfig.h @@ -71,6 +71,8 @@ typedef struct AVCodecHWConfigInternal { @@ -5918,7 +5918,7 @@ index c43ad55245..b8aa383071 100644 #define HWACCEL_VDPAU(codec) \ diff --git a/libavcodec/v4l2_req_decode_q.c b/libavcodec/v4l2_req_decode_q.c new file mode 100644 -index 0000000000..5b3fb958fa +index 000000000000..5b3fb958fac3 --- /dev/null +++ b/libavcodec/v4l2_req_decode_q.c @@ -0,0 +1,84 @@ @@ -6008,7 +6008,7 @@ index 0000000000..5b3fb958fa + diff --git a/libavcodec/v4l2_req_decode_q.h b/libavcodec/v4l2_req_decode_q.h new file mode 100644 -index 0000000000..af7bbe1de4 +index 000000000000..af7bbe1de462 --- /dev/null +++ b/libavcodec/v4l2_req_decode_q.h @@ -0,0 +1,25 @@ @@ -6039,7 +6039,7 @@ index 0000000000..af7bbe1de4 + diff --git a/libavcodec/v4l2_req_devscan.c b/libavcodec/v4l2_req_devscan.c new file mode 100644 -index 0000000000..cfa94d55c4 +index 000000000000..cfa94d55c49b --- /dev/null +++ b/libavcodec/v4l2_req_devscan.c @@ -0,0 +1,449 @@ @@ -6494,7 +6494,7 @@ index 0000000000..cfa94d55c4 + diff --git a/libavcodec/v4l2_req_devscan.h b/libavcodec/v4l2_req_devscan.h new file mode 100644 -index 0000000000..956d9234f1 +index 000000000000..956d9234f11f --- /dev/null +++ b/libavcodec/v4l2_req_devscan.h @@ -0,0 +1,23 @@ @@ -6523,7 +6523,7 @@ index 0000000000..956d9234f1 +#endif diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c new file mode 100644 -index 0000000000..ae6c648369 +index 000000000000..ae6c64836972 --- /dev/null +++ b/libavcodec/v4l2_req_dmabufs.c @@ -0,0 +1,266 @@ @@ -6795,7 +6795,7 @@ index 0000000000..ae6c648369 + diff --git a/libavcodec/v4l2_req_dmabufs.h b/libavcodec/v4l2_req_dmabufs.h new file mode 100644 -index 0000000000..cfb17e801d +index 000000000000..cfb17e801d59 --- /dev/null +++ b/libavcodec/v4l2_req_dmabufs.h @@ -0,0 +1,40 @@ @@ -6841,7 +6841,7 @@ index 0000000000..cfb17e801d +#endif diff --git a/libavcodec/v4l2_req_hevc_v1.c b/libavcodec/v4l2_req_hevc_v1.c new file mode 100644 -index 0000000000..169b532832 +index 000000000000..169b532832e0 --- /dev/null +++ b/libavcodec/v4l2_req_hevc_v1.c @@ -0,0 +1,3 @@ @@ -6850,7 +6850,7 @@ index 0000000000..169b532832 + diff --git a/libavcodec/v4l2_req_hevc_v2.c b/libavcodec/v4l2_req_hevc_v2.c new file mode 100644 -index 0000000000..42af98e156 +index 000000000000..42af98e1569b --- /dev/null +++ b/libavcodec/v4l2_req_hevc_v2.c @@ -0,0 +1,3 @@ @@ -6859,7 +6859,7 @@ index 0000000000..42af98e156 + diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c new file mode 100644 -index 0000000000..0ae03b10c4 +index 000000000000..0ae03b10c4a8 --- /dev/null +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -0,0 +1,1213 @@ @@ -8078,7 +8078,7 @@ index 0000000000..0ae03b10c4 + diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c new file mode 100644 -index 0000000000..eb00ecb406 +index 000000000000..eb00ecb40623 --- /dev/null +++ b/libavcodec/v4l2_req_media.c @@ -0,0 +1,1596 @@ @@ -9680,7 +9680,7 @@ index 0000000000..eb00ecb406 + diff --git a/libavcodec/v4l2_req_media.h b/libavcodec/v4l2_req_media.h new file mode 100644 -index 0000000000..2f826cfb14 +index 000000000000..2f826cfb14e7 --- /dev/null +++ b/libavcodec/v4l2_req_media.h @@ -0,0 +1,151 @@ @@ -9837,7 +9837,7 @@ index 0000000000..2f826cfb14 +#endif diff --git a/libavcodec/v4l2_req_pollqueue.c b/libavcodec/v4l2_req_pollqueue.c new file mode 100644 -index 0000000000..cc8a5d4001 +index 000000000000..cc8a5d400120 --- /dev/null +++ b/libavcodec/v4l2_req_pollqueue.c @@ -0,0 +1,361 @@ @@ -10204,7 +10204,7 @@ index 0000000000..cc8a5d4001 + diff --git a/libavcodec/v4l2_req_pollqueue.h b/libavcodec/v4l2_req_pollqueue.h new file mode 100644 -index 0000000000..e1182cb2fc +index 000000000000..e1182cb2fc92 --- /dev/null +++ b/libavcodec/v4l2_req_pollqueue.h @@ -0,0 +1,18 @@ @@ -10228,7 +10228,7 @@ index 0000000000..e1182cb2fc +#endif /* POLLQUEUE_H_ */ diff --git a/libavcodec/v4l2_req_utils.h b/libavcodec/v4l2_req_utils.h new file mode 100644 -index 0000000000..a31cc1f4ec +index 000000000000..a31cc1f4ec2a --- /dev/null +++ b/libavcodec/v4l2_req_utils.h @@ -0,0 +1,27 @@ @@ -10261,7 +10261,7 @@ index 0000000000..a31cc1f4ec +#endif diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c new file mode 100644 -index 0000000000..b0a5930844 +index 000000000000..b0a5930844a8 --- /dev/null +++ b/libavcodec/v4l2_request_hevc.c @@ -0,0 +1,297 @@ @@ -10564,7 +10564,7 @@ index 0000000000..b0a5930844 +}; diff --git a/libavcodec/v4l2_request_hevc.h b/libavcodec/v4l2_request_hevc.h new file mode 100644 -index 0000000000..f14f594564 +index 000000000000..f14f594564d7 --- /dev/null +++ b/libavcodec/v4l2_request_hevc.h @@ -0,0 +1,102 @@ @@ -10671,10 +10671,10 @@ index 0000000000..f14f594564 + +#endif -From c99a0fe4d59212079de9bed222114abf95f7c989 Mon Sep 17 00:00:00 2001 +From 43c7c3d42888304f2f5ca39739bf88baa3c1861e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 19:30:36 +0100 -Subject: [PATCH 013/161] Add no_cvt_hw option to ffmpeg +Subject: [PATCH 013/186] Add no_cvt_hw option to ffmpeg --- fftools/ffmpeg.c | 6 ++++-- @@ -10683,10 +10683,10 @@ Subject: [PATCH 013/161] Add no_cvt_hw option to ffmpeg 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c -index 15e084f0b2..5dc2cd73c1 100644 +index ca5431aeb401..719463016216 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c -@@ -2005,6 +2005,9 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_ref +@@ -2008,6 +2008,9 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame, int keep_ref (ifilter->hw_frames_ctx && ifilter->hw_frames_ctx->data != frame->hw_frames_ctx->data)) need_reinit = 1; @@ -10696,7 +10696,7 @@ index 15e084f0b2..5dc2cd73c1 100644 if (sd = av_frame_get_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX)) { if (!ifilter->displaymatrix || memcmp(sd->data, ifilter->displaymatrix, sizeof(int32_t) * 9)) need_reinit = 1; -@@ -2274,8 +2277,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_ +@@ -2277,8 +2280,7 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_ decoded_frame->top_field_first = ist->top_field_first; ist->frames_decoded++; @@ -10707,7 +10707,7 @@ index 15e084f0b2..5dc2cd73c1 100644 if (err < 0) goto fail; diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h -index f1412f6446..8f478619b3 100644 +index f1412f6446b8..8f478619b305 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -729,6 +729,8 @@ extern enum VideoSyncMethod video_sync_method; @@ -10720,7 +10720,7 @@ index f1412f6446..8f478619b3 100644 extern int do_pkt_dump; extern int copy_ts; diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c -index 055275d813..761db36588 100644 +index 055275d81394..761db365883b 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -71,6 +71,7 @@ enum VideoSyncMethod video_sync_method = VSYNC_AUTO; @@ -10741,10 +10741,10 @@ index 055275d813..761db36588 100644 "write program-readable progress information", "url" }, { "stdin", OPT_BOOL | OPT_EXPERT, { &stdin_interaction }, -From 27e0c78a2df53fb2337bee4c383cdb58cbbc717e Mon Sep 17 00:00:00 2001 +From 0b46976bcb9c699235dd9a3ff6528c2dfcdba4ec Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 10:16:39 +0100 -Subject: [PATCH 014/161] Add vout_drm +Subject: [PATCH 014/186] Add vout_drm --- configure | 4 + @@ -10755,7 +10755,7 @@ Subject: [PATCH 014/161] Add vout_drm create mode 100644 libavdevice/drm_vout.c diff --git a/configure b/configure -index 199aa2b3d5..49744cab19 100755 +index c09144673050..fb72aa89a60c 100755 --- a/configure +++ b/configure @@ -346,6 +346,7 @@ External library support: @@ -10786,7 +10786,7 @@ index 199aa2b3d5..49744cab19 100755 xcbgrab_indev_deps="libxcb" xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes" diff --git a/libavdevice/Makefile b/libavdevice/Makefile -index 8a62822b69..36aac30186 100644 +index 8a62822b69ec..36aac301861a 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -48,6 +48,7 @@ OBJS-$(CONFIG_SNDIO_OUTDEV) += sndio_enc.o sndio.o @@ -10798,7 +10798,7 @@ index 8a62822b69..36aac30186 100644 OBJS-$(CONFIG_XV_OUTDEV) += xv.o diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index 8a90fcb5d7..e2a8669f27 100644 +index 8a90fcb5d782..e2a8669f2712 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -52,6 +52,7 @@ extern const FFOutputFormat ff_sndio_muxer; @@ -10811,7 +10811,7 @@ index 8a90fcb5d7..e2a8669f27 100644 diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c new file mode 100644 -index 0000000000..cfb33ce7c3 +index 000000000000..cfb33ce7c319 --- /dev/null +++ b/libavdevice/drm_vout.c @@ -0,0 +1,638 @@ @@ -11454,10 +11454,10 @@ index 0000000000..cfb33ce7c3 +}; + -From cc536672adf4eefeaec16e9808f583c693ad7819 Mon Sep 17 00:00:00 2001 +From bfdfdd9ad94d8a9773c9069b930725ad44e9ddb3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 11:34:18 +0100 -Subject: [PATCH 015/161] Add vout_egl +Subject: [PATCH 015/186] Add vout_egl --- configure | 6 + @@ -11468,7 +11468,7 @@ Subject: [PATCH 015/161] Add vout_egl create mode 100644 libavdevice/egl_vout.c diff --git a/configure b/configure -index 49744cab19..b41663c794 100755 +index fb72aa89a60c..a4ffd8797690 100755 --- a/configure +++ b/configure @@ -347,6 +347,7 @@ External library support: @@ -11513,7 +11513,7 @@ index 49744cab19..b41663c794 100755 { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && warn "using libfdk without pkg-config"; } } diff --git a/libavdevice/Makefile b/libavdevice/Makefile -index 36aac30186..0989cb895f 100644 +index 36aac301861a..0989cb895f9e 100644 --- a/libavdevice/Makefile +++ b/libavdevice/Makefile @@ -49,6 +49,7 @@ OBJS-$(CONFIG_V4L2_INDEV) += v4l2.o v4l2-common.o timefilter.o @@ -11525,7 +11525,7 @@ index 36aac30186..0989cb895f 100644 OBJS-$(CONFIG_XV_OUTDEV) += xv.o diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c -index e2a8669f27..ffb410b92d 100644 +index e2a8669f2712..ffb410b92da8 100644 --- a/libavdevice/alldevices.c +++ b/libavdevice/alldevices.c @@ -53,6 +53,7 @@ extern const AVInputFormat ff_v4l2_demuxer; @@ -11538,7 +11538,7 @@ index e2a8669f27..ffb410b92d 100644 diff --git a/libavdevice/egl_vout.c b/libavdevice/egl_vout.c new file mode 100644 -index 0000000000..7b9c610ace +index 000000000000..7b9c610ace28 --- /dev/null +++ b/libavdevice/egl_vout.c @@ -0,0 +1,811 @@ @@ -12354,10 +12354,10 @@ index 0000000000..7b9c610ace +}; + -From 867bd7c243e66a1c1756878e20df8f35db8025ec Mon Sep 17 00:00:00 2001 +From 55cc6b4be80730d1bbd67c483e97921f39b58965 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 12:51:22 +0100 -Subject: [PATCH 016/161] V4L2 stateful rework +Subject: [PATCH 016/186] V4L2 stateful rework --- libavcodec/Makefile | 3 +- @@ -12371,7 +12371,7 @@ Subject: [PATCH 016/161] V4L2 stateful rework 8 files changed, 1286 insertions(+), 354 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index 2d440b5648..e1aa0ba014 100644 +index 2d440b56486b..e1aa0ba014ed 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -169,7 +169,8 @@ OBJS-$(CONFIG_VIDEODSP) += videodsp.o @@ -12385,7 +12385,7 @@ index 2d440b5648..e1aa0ba014 100644 v4l2_req_devscan.o weak_link.o OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 3f5471067a..a003934ca1 100644 +index 3f5471067a1a..a003934ca19e 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -21,6 +21,7 @@ @@ -13143,7 +13143,7 @@ index 3f5471067a..a003934ca1 100644 avbuf->status = V4L2BUF_IN_DRIVER; diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index 3d2ff1b9a5..111526aee3 100644 +index 3d2ff1b9a5d7..111526aee315 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -28,27 +28,37 @@ @@ -13223,7 +13223,7 @@ index 3d2ff1b9a5..111526aee3 100644 /** * Enqueues a V4L2Buffer diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index a40be94690..be76068af3 100644 +index a40be946904e..be76068af32d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -27,11 +27,13 @@ @@ -14024,7 +14024,7 @@ index a40be94690..be76068af3 100644 return ret; } diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 6f7460c89a..59009d11d1 100644 +index 6f7460c89a9d..59009d11d1e7 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -32,6 +32,8 @@ @@ -14088,7 +14088,7 @@ index 6f7460c89a..59009d11d1 100644 /** * Enqueues a buffer to a V4L2Context from an AVFrame diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 602efb7a16..516e6d9858 100644 +index 602efb7a1605..516e6d98583d 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -216,13 +216,7 @@ int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *s) @@ -14142,7 +14142,7 @@ index 602efb7a16..516e6d9858 100644 return 0; diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 04d86d7b92..24a9c94864 100644 +index 04d86d7b9222..24a9c9486468 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -30,6 +30,7 @@ @@ -14212,7 +14212,7 @@ index 04d86d7b92..24a9c94864 100644 /** diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 4944d08511..7f6033ac2c 100644 +index 4944d0851198..7f6033ac2c41 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -23,6 +23,10 @@ @@ -14777,10 +14777,10 @@ index 4944d08511..7f6033ac2c 100644 M2MDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb"); -From 12f8f12326b83dd3c22084f8922705d79a13d195 Mon Sep 17 00:00:00 2001 +From 8a5fcd215d3ac07df4807d207e8a337edccffaeb Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:46:21 +0100 -Subject: [PATCH 017/161] Fix crash in hw_device_default_name if type not found +Subject: [PATCH 017/186] Fix crash in hw_device_default_name if type not found (NONE) --- @@ -14788,7 +14788,7 @@ Subject: [PATCH 017/161] Fix crash in hw_device_default_name if type not found 1 file changed, 2 insertions(+) diff --git a/fftools/ffmpeg_hw.c b/fftools/ffmpeg_hw.c -index 88fa782470..740a5e7153 100644 +index 88fa7824701e..740a5e7153cf 100644 --- a/fftools/ffmpeg_hw.c +++ b/fftools/ffmpeg_hw.c @@ -75,6 +75,8 @@ static char *hw_device_default_name(enum AVHWDeviceType type) @@ -14801,10 +14801,10 @@ index 88fa782470..740a5e7153 100644 name = av_malloc(index_pos + 4); if (!name) -From 7f6bce459e683bff3a0b972922fbcc808e9177a6 Mon Sep 17 00:00:00 2001 +From 35c7187e199e4042d30165c015f525bfcb377796 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:59:18 +0100 -Subject: [PATCH 018/161] Allow v4l2m2m to select non-drm_prime output formats +Subject: [PATCH 018/186] Allow v4l2m2m to select non-drm_prime output formats --- libavcodec/v4l2_buffers.c | 2 +- @@ -14812,7 +14812,7 @@ Subject: [PATCH 018/161] Allow v4l2m2m to select non-drm_prime output formats 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index a003934ca1..1ca1128db6 100644 +index a003934ca19e..1ca1128db6f4 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -524,7 +524,7 @@ static int v4l2_buffer_swframe_to_buf(const AVFrame *frame, V4L2Buffer *out) @@ -14825,7 +14825,7 @@ index a003934ca1..1ca1128db6 100644 } diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 7f6033ac2c..a4b5a4e7e9 100644 +index 7f6033ac2c41..a4b5a4e7e991 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -455,10 +455,10 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx) @@ -14868,10 +14868,10 @@ index 7f6033ac2c..a4b5a4e7e9 100644 .hw_configs = v4l2_m2m_hw_configs, \ } -From 9b0d964b727d98271f7f2f4dcdbcb1b41a429e2b Mon Sep 17 00:00:00 2001 +From d5bfb5014aa4692820903ef7287bc0319ebc139f Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:59:38 +0100 -Subject: [PATCH 019/161] Fix YUV420P output from v4l2m2m +Subject: [PATCH 019/186] Fix YUV420P output from v4l2m2m Also put get_width get_height inlines in header as they are generally useful. @@ -14882,7 +14882,7 @@ useful. 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 1ca1128db6..f4c11ca8d0 100644 +index 1ca1128db6f4..f4c11ca8d06d 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -425,17 +425,17 @@ static int v4l2_buffer_buf_to_swframe(AVFrame *frame, V4L2Buffer *avbuf) @@ -14910,7 +14910,7 @@ index 1ca1128db6..f4c11ca8d0 100644 default: diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index be76068af3..6fe2586627 100644 +index be76068af32d..6fe258662786 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -55,16 +55,6 @@ static inline AVCodecContext *logger(V4L2Context *ctx) @@ -14964,7 +14964,7 @@ index be76068af3..6fe2586627 100644 V4L2_TYPE_IS_MULTIPLANAR(ctx->type) ? ctx->format.fmt.pix_mp.plane_fmt[0].bytesperline : ctx->format.fmt.pix.bytesperline); diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 24a9c94864..8f054f2f50 100644 +index 24a9c9486468..8f054f2f50f9 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -160,4 +160,16 @@ int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *ctx); @@ -14985,10 +14985,10 @@ index 24a9c94864..8f054f2f50 100644 + #endif /* AVCODEC_V4L2_M2M_H */ -From 14e9b4bf1b34b3d1e1e6a4fc755cc595416e7d7b Mon Sep 17 00:00:00 2001 +From 43b65c3e3d1c8e2c35694764b7ee93e7dbf75a1a Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 19:23:44 +0100 -Subject: [PATCH 020/161] Report buffer overflows in v4l2m2m +Subject: [PATCH 020/186] Report buffer overflows in v4l2m2m --- libavcodec/v4l2_buffers.c | 14 ++++++++++---- @@ -14996,7 +14996,7 @@ Subject: [PATCH 020/161] Report buffer overflows in v4l2m2m 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index f4c11ca8d0..de31f7ced9 100644 +index f4c11ca8d06d..de31f7ced93c 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -364,6 +364,7 @@ static int v4l2_buffer_export_drm(V4L2Buffer* avbuf) @@ -15045,7 +15045,7 @@ index f4c11ca8d0..de31f7ced9 100644 int ff_v4l2_buffer_avpkt_to_buf(const AVPacket *pkt, V4L2Buffer *out) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 6fe2586627..81aced0c2b 100644 +index 6fe258662786..81aced0c2b5d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -824,7 +824,10 @@ int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt, @@ -15061,10 +15061,10 @@ index 6fe2586627..81aced0c2b 100644 return ff_v4l2_buffer_enqueue(avbuf); -From 072907a7fcf160d12972997d24fdf62641687ea4 Mon Sep 17 00:00:00 2001 +From b02c14a2e1f9890370eb9d459feccacb7e652e82 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 14 Jun 2021 11:55:16 +0100 -Subject: [PATCH 021/161] Increase V4L2 H264 stateful coded buffer size +Subject: [PATCH 021/186] Increase V4L2 H264 stateful coded buffer size Try to set a min size of frame size / 2 for bitbuffers passed to V4l2. This fixes a few streams that have large I-frames. You would hope @@ -15081,7 +15081,7 @@ sensible now. 3 files changed, 53 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 81aced0c2b..a17ae027a6 100644 +index 81aced0c2b5d..a17ae027a666 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -902,7 +902,29 @@ int ff_v4l2_context_get_format(V4L2Context* ctx, int probe) @@ -15116,7 +15116,7 @@ index 81aced0c2b..a17ae027a6 100644 void ff_v4l2_context_release(V4L2Context* ctx) diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 59009d11d1..37b0431400 100644 +index 59009d11d1e7..37b0431400d8 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -75,6 +75,12 @@ typedef struct V4L2Context { @@ -15133,7 +15133,7 @@ index 59009d11d1..37b0431400 100644 * Indexed array of pointers to V4L2Buffers */ diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index a4b5a4e7e9..1851acbc93 100644 +index a4b5a4e7e991..1851acbc93fe 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -450,6 +450,27 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -15185,10 +15185,10 @@ index a4b5a4e7e9..1851acbc93 100644 /* the client requests the codec to generate DRM frames: * - data[0] will therefore point to the returned AVDRMFrameDescriptor -From 6087c8c054e1ff3d2e6e62d5e32705d079928b64 Mon Sep 17 00:00:00 2001 +From 1de32953e7f28a262ecb4727eaac0cfd3588379e Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 28 Jun 2021 12:13:35 +0100 -Subject: [PATCH 022/161] Fix raw video s.t. it respects any remaining cropping +Subject: [PATCH 022/186] Fix raw video s.t. it respects any remaining cropping This fixes the long standing CONFWIN_A conformance test failure for drm. --- @@ -15197,7 +15197,7 @@ This fixes the long standing CONFWIN_A conformance test failure for drm. 2 files changed, 130 insertions(+), 14 deletions(-) diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c -index 594a77c42a..8ca0379e12 100644 +index 594a77c42a64..8ca0379e1219 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -124,32 +124,41 @@ static int raw_sand30_as_yuv420(AVCodecContext *avctx, AVPacket *pkt, @@ -15267,7 +15267,7 @@ index 594a77c42a..8ca0379e12 100644 const FFCodec ff_rawvideo_encoder = { diff --git a/libavutil/hwcontext_drm.c b/libavutil/hwcontext_drm.c -index 7a9fdbd263..baf18920fa 100644 +index 7a9fdbd263d4..baf18920fa14 100644 --- a/libavutil/hwcontext_drm.c +++ b/libavutil/hwcontext_drm.c @@ -21,6 +21,7 @@ @@ -15455,17 +15455,17 @@ index 7a9fdbd263..baf18920fa 100644 map = av_frame_alloc(); if (!map) -From 597858c11fbfbe0f54c1b68d9683025929258bc1 Mon Sep 17 00:00:00 2001 +From 2214c119c420bb213917f1c6f85cb82d905772dc Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 13 Aug 2021 15:38:28 +0100 -Subject: [PATCH 023/161] Set frame interlace from V4L2 buffer field +Subject: [PATCH 023/186] Set frame interlace from V4L2 buffer field --- libavcodec/v4l2_buffers.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index de31f7ced9..97b8eb1db3 100644 +index de31f7ced93c..97b8eb1db362 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -222,6 +222,16 @@ static enum AVColorTransferCharacteristic v4l2_get_color_trc(V4L2Buffer *buf) @@ -15495,10 +15495,10 @@ index de31f7ced9..97b8eb1db3 100644 /* these values are updated also during re-init in v4l2_process_driver_event */ frame->height = ctx->height; -From 05906e2086b5087d615485ec9a09b1493dbb32e1 Mon Sep 17 00:00:00 2001 +From b81ad61c52f3b35cd1b1b4f0ea715758c524522b Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 13 Aug 2021 16:11:53 +0100 -Subject: [PATCH 024/161] Fix V4L2 stateful to avoid crash if flush before +Subject: [PATCH 024/186] Fix V4L2 stateful to avoid crash if flush before start --- @@ -15506,7 +15506,7 @@ Subject: [PATCH 024/161] Fix V4L2 stateful to avoid crash if flush before 1 file changed, 4 insertions(+) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index a17ae027a6..eb901e8fab 100644 +index a17ae027a666..eb901e8fabf6 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -713,6 +713,10 @@ static int v4l2_get_coded_format(V4L2Context* ctx, uint32_t *p) @@ -15521,10 +15521,10 @@ index a17ae027a6..eb901e8fab 100644 struct V4L2Buffer * const buf = (struct V4L2Buffer *)ctx->bufrefs[i]->data; if (buf->status == V4L2BUF_IN_DRIVER) -From 7157b6032e759078a7d751e5dd5762970f3d1e8c Mon Sep 17 00:00:00 2001 +From 2d975c0fbcb97b930b1e7164f439830ab2594d1d Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Sep 2021 17:44:13 +0100 -Subject: [PATCH 025/161] Copy properties from frame to v4l2 buffer +Subject: [PATCH 025/186] Copy properties from frame to v4l2 buffer Now copies all the properties in ff_v4l2_buffer_avframe_to_buf that ff_v4l2_buffer_buf_to_avframe copies @@ -15533,7 +15533,7 @@ ff_v4l2_buffer_buf_to_avframe copies 1 file changed, 126 insertions(+) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 97b8eb1db3..126d2a17f4 100644 +index 97b8eb1db362..126d2a17f4fe 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -128,6 +128,105 @@ static enum AVColorPrimaries v4l2_get_color_primaries(V4L2Buffer *buf) @@ -15692,10 +15692,10 @@ index 97b8eb1db3..126d2a17f4 100644 return v4l2_buffer_swframe_to_buf(frame, out); } -From 15415ab226f966fd12e70d79fde3cb80f3d09144 Mon Sep 17 00:00:00 2001 +From 29e4140983c9922f7375153d5ba515bb70b047be Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 16:49:01 +0000 -Subject: [PATCH 026/161] ffmpeg: Do not inc DTS on no decode output +Subject: [PATCH 026/186] ffmpeg: Do not inc DTS on no decode output V4L2 H264 decode has long latency and sometimes spits out a long stream of output without input. In this case incrementing DTS is wrong. There @@ -15706,10 +15706,10 @@ the cases which cause problems 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c -index 5dc2cd73c1..ba0c1898cf 100644 +index 719463016216..04bea4ef4fe9 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c -@@ -2609,7 +2609,12 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo +@@ -2612,7 +2612,12 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo case AVMEDIA_TYPE_VIDEO: ret = decode_video (ist, repeating ? NULL : avpkt, &got_output, &duration_pts, !pkt, &decode_failed); @@ -15724,10 +15724,10 @@ index 5dc2cd73c1..ba0c1898cf 100644 duration_dts = av_rescale_q(pkt->duration, ist->st->time_base, AV_TIME_BASE_Q); } else if(ist->dec_ctx->framerate.num != 0 && ist->dec_ctx->framerate.den != 0) { -From 7bf6c062ed8a1e635aa5722c0072724f236daf00 Mon Sep 17 00:00:00 2001 +From eebda1bffbbf81eb486665c73ace4a86303c1e69 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:32:59 +0000 -Subject: [PATCH 027/161] v4l2_m2m_dec: Adjust timebase if H264 +Subject: [PATCH 027/186] v4l2_m2m_dec: Adjust timebase if H264 Adjust AVCodecContext time_base if H264 in the same way that the software decoder does. @@ -15736,7 +15736,7 @@ software decoder does. 1 file changed, 10 insertions(+) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 1851acbc93..aa1e5c1597 100644 +index 1851acbc93fe..aa1e5c159720 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -481,6 +481,16 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx) @@ -15757,10 +15757,10 @@ index 1851acbc93..aa1e5c1597 100644 ret = ff_v4l2_m2m_create_context(priv, &s); if (ret < 0) -From 3cd23a761397ae75ed032c1687da5d6b76ddaaaa Mon Sep 17 00:00:00 2001 +From 4e12f09479a88b648f17fad0e475fdb60ac93541 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:38:27 +0000 -Subject: [PATCH 028/161] v4l2_m2m_dec: Produce best guess PTSs if none +Subject: [PATCH 028/186] v4l2_m2m_dec: Produce best guess PTSs if none supplied Filter scheduling gets confused by missing PTSs and makes poor guesses @@ -15772,7 +15772,7 @@ missing them. 2 files changed, 74 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 8f054f2f50..82feb0afdb 100644 +index 8f054f2f50f9..82feb0afdbe3 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -52,6 +52,16 @@ typedef struct V4L2m2mTrackEl { @@ -15802,7 +15802,7 @@ index 8f054f2f50..82feb0afdb 100644 int req_pkt; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index aa1e5c1597..a5a2afbd27 100644 +index aa1e5c159720..a5a2afbd273c 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -42,6 +42,62 @@ @@ -15892,10 +15892,10 @@ index aa1e5c1597..a5a2afbd27 100644 output = &s->output; -From ee8be1e900f98212b6c4940980cc7a80becfc07c Mon Sep 17 00:00:00 2001 +From 3a0fa83da24d5ec8739acf9f4cc713b7b1e49038 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:59:27 +0000 -Subject: [PATCH 029/161] v4l2_m2m_dec: Try harder to get an initial frame +Subject: [PATCH 029/186] v4l2_m2m_dec: Try harder to get an initial frame If the input Q is full then wait on a short timeout for a capture frame rather than stuffing yet still another frame into the input if we could @@ -15907,7 +15907,7 @@ buffering that ends up confusing the rest of the system. 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index eb901e8fab..ee5dc7b8d4 100644 +index eb901e8fabf6..ee5dc7b8d41d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -381,7 +381,7 @@ static V4L2Buffer* v4l2_dequeue_v4l2buf(V4L2Context *ctx, int timeout) @@ -15920,7 +15920,7 @@ index eb901e8fab..ee5dc7b8d4 100644 } else { pfd.events = POLLOUT | POLLWRNORM; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index a5a2afbd27..b49f470c0a 100644 +index a5a2afbd273c..b49f470c0a1e 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -442,7 +442,7 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -15933,10 +15933,10 @@ index a5a2afbd27..b49f470c0a 100644 if (dst_rv == AVERROR_EOF && (s->draining || s->capture.done)) av_log(avctx, AV_LOG_DEBUG, "Dequeue EOF: draining=%d, cap.done=%d\n", -From 72da14331c2160a12b69d666d493e0e74c5e8914 Mon Sep 17 00:00:00 2001 +From 33aa90c53d570527c8a8da70d6c805a5431d2f86 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 18:04:56 +0000 -Subject: [PATCH 030/161] Add a V4L2 M2M deinterlace filter +Subject: [PATCH 030/186] Add a V4L2 M2M deinterlace filter Add a V4L2 deinterlace filter that will accept DRMPRIME frames. @@ -15958,7 +15958,7 @@ lost at end of stream as the V4L2 filter has no flush control. create mode 100644 libavfilter/vf_deinterlace_v4l2m2m.c diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index ee5dc7b8d4..440dfaaba5 100644 +index ee5dc7b8d41d..440dfaaba551 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -498,10 +498,10 @@ dequeue: @@ -15975,7 +15975,7 @@ index ee5dc7b8d4..440dfaaba5 100644 avbuf = (V4L2Buffer *)ctx->bufrefs[buf.index]->data; avbuf->status = V4L2BUF_AVAILABLE; diff --git a/libavfilter/Makefile b/libavfilter/Makefile -index c14fc995a0..0e7b5856bd 100644 +index c14fc995a0b5..0e7b5856bdd4 100644 --- a/libavfilter/Makefile +++ b/libavfilter/Makefile @@ -262,6 +262,7 @@ OBJS-$(CONFIG_DEFLATE_FILTER) += vf_neighbor.o @@ -15987,7 +15987,7 @@ index c14fc995a0..0e7b5856bd 100644 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o OBJS-$(CONFIG_DENOISE_VAAPI_FILTER) += vf_misc_vaapi.o vaapi_vpp.o diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index b990a00152..357ff61ca8 100644 +index b990a001529b..357ff61ca803 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -248,6 +248,7 @@ extern const AVFilter ff_vf_derain; @@ -16000,7 +16000,7 @@ index b990a00152..357ff61ca8 100644 extern const AVFilter ff_vf_dilation_opencl; diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c new file mode 100644 -index 0000000000..1a933b7e0a +index 000000000000..1a933b7e0a5f --- /dev/null +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -0,0 +1,1269 @@ @@ -17274,10 +17274,10 @@ index 0000000000..1a933b7e0a + .activate = deint_v4l2m2m_activate, +}; -From 0fb00e51d1ca40eed22bfc66b7f309fdc56229bc Mon Sep 17 00:00:00 2001 +From 1956533e4c9b3f45f9fcb83da6e04beec0e0b517 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 2 Dec 2021 17:49:55 +0000 -Subject: [PATCH 031/161] Put no_pts_rescale in context which makes more sense +Subject: [PATCH 031/186] Put no_pts_rescale in context which makes more sense than an arg --- @@ -17289,7 +17289,7 @@ Subject: [PATCH 031/161] Put no_pts_rescale in context which makes more sense 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 126d2a17f4..22da6bd722 100644 +index 126d2a17f4fe..22da6bd72234 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -39,7 +39,7 @@ @@ -17402,7 +17402,7 @@ index 126d2a17f4..22da6bd722 100644 diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index 111526aee3..641e0e147b 100644 +index 111526aee315..641e0e147b19 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -83,12 +83,11 @@ typedef struct V4L2Buffer { @@ -17429,7 +17429,7 @@ index 111526aee3..641e0e147b 100644 /** * Extracts the data from an AVFrame to a V4L2Buffer diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 440dfaaba5..64540a37b3 100644 +index 440dfaaba551..64540a37b32e 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -808,7 +808,7 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame) @@ -17469,7 +17469,7 @@ index 440dfaaba5..64540a37b3 100644 int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt) diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 37b0431400..4cc164886c 100644 +index 37b0431400d8..4cc164886c3b 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -102,6 +102,13 @@ typedef struct V4L2Context { @@ -17510,7 +17510,7 @@ index 37b0431400..4cc164886c 100644 /** * Enqueues a buffer to a V4L2Context from an AVFrame diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index b49f470c0a..36754b314a 100644 +index b49f470c0a1e..36754b314a4b 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -360,7 +360,7 @@ static int try_enqueue_src(AVCodecContext * const avctx, V4L2m2mContext * const @@ -17555,17 +17555,17 @@ index b49f470c0a..36754b314a 100644 /* the client requests the codec to generate DRM frames: * - data[0] will therefore point to the returned AVDRMFrameDescriptor -From 5e36908e6f2f06b68e85873cbcd421c0973f6409 Mon Sep 17 00:00:00 2001 +From fdcdb8519c90f3d2038244b21abf165f56224f08 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 8 Dec 2021 15:00:37 +0000 -Subject: [PATCH 032/161] Use bitbuf min size for all streams +Subject: [PATCH 032/186] Use bitbuf min size for all streams --- libavcodec/v4l2_m2m_dec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 36754b314a..48a6810d18 100644 +index 36754b314a4b..48a6810d18b6 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -507,15 +507,12 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -17586,10 +17586,10 @@ index 36754b314a..48a6810d18 100644 // H.264 Annex A table A-1 gives minCR which is either 2 or 4 // unfortunately that doesn't yield an actually useful limit -From 5fcbcd31761eea31dc0157793f558eaaadfe2ac3 Mon Sep 17 00:00:00 2001 +From 6703c26d1e71bcb7a077b07e8cbef015a1204da9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 3 Dec 2021 12:54:18 +0000 -Subject: [PATCH 033/161] Track pending frames in v4l2 stateful +Subject: [PATCH 033/186] Track pending frames in v4l2 stateful Track which frames are pending decode in the v4l2 stateful decoder. This relies on DTS & PTS having some relationship to reality, so @@ -17603,7 +17603,7 @@ own structure. 2 files changed, 89 insertions(+), 26 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 82feb0afdb..3f86809623 100644 +index 82feb0afdbe3..3f8680962342 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -44,8 +44,10 @@ @@ -17645,7 +17645,7 @@ index 82feb0afdb..3f86809623 100644 pts_stats_t pts_stat; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 48a6810d18..d8ebb466cd 100644 +index 48a6810d18b6..d8ebb466cd56 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -242,22 +242,24 @@ static inline unsigned int pts_to_track(AVCodecContext *avctx, const int64_t pts @@ -17844,10 +17844,10 @@ index 48a6810d18..d8ebb466cd 100644 // resend extradata s->extdata_sent = 0; -From 6fae7b3f42c8e9e431a59323c0faa6c88fe951d9 Mon Sep 17 00:00:00 2001 +From 74854095e6aac7647a2a04d53110150dd83f3b09 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 17:58:21 +0000 -Subject: [PATCH 034/161] Use pending tracking to reduce v4l2 latency +Subject: [PATCH 034/186] Use pending tracking to reduce v4l2 latency If there are more than 5 pending decodes outstanding then add a small timeout to the capture poll to reduce the rate at which frames are @@ -17857,7 +17857,7 @@ added. 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index d8ebb466cd..7e7e4729d0 100644 +index d8ebb466cd56..7e7e4729d08b 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -370,16 +370,19 @@ static inline int stream_started(const V4L2m2mContext * const s) { @@ -17967,10 +17967,10 @@ index d8ebb466cd..7e7e4729d0 100644 #if 0 if (dst_rv == 0) -From 175abd2eb961a3718a660e1f9eda08b37b01b309 Mon Sep 17 00:00:00 2001 +From 584445b9041ff6faed2a9a1ad455f0ab30bf04c6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 12:23:54 +0000 -Subject: [PATCH 035/161] Allow logger() to take const ctx +Subject: [PATCH 035/186] Allow logger() to take const ctx --- libavcodec/v4l2_buffers.c | 2 +- @@ -17978,7 +17978,7 @@ Subject: [PATCH 035/161] Allow logger() to take const ctx 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 22da6bd722..39c0094aec 100644 +index 22da6bd72234..39c0094aec10 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -46,7 +46,7 @@ static inline V4L2m2mContext *buf_to_m2mctx(const V4L2Buffer * const buf) @@ -17991,7 +17991,7 @@ index 22da6bd722..39c0094aec 100644 return buf_to_m2mctx(buf)->avctx; } diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 64540a37b3..d3df48aed4 100644 +index 64540a37b32e..d3df48aed499 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -43,14 +43,14 @@ struct v4l2_format_update { @@ -18012,10 +18012,10 @@ index 64540a37b3..d3df48aed4 100644 return ctx_to_m2mctx(ctx)->avctx; } -From 21d4f3f644c45084c621cb5aa577169bf5c15017 Mon Sep 17 00:00:00 2001 +From 80ff275f1183fe466edbdfaadf17b2c40a45fa3e Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 13:00:27 +0000 -Subject: [PATCH 036/161] Track numbere of bufs qed with an atomic +Subject: [PATCH 036/186] Track numbere of bufs qed with an atomic Safer and faster than counting status --- @@ -18025,7 +18025,7 @@ Safer and faster than counting status 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 39c0094aec..2cf7be6632 100644 +index 39c0094aec10..2cf7be663263 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -922,6 +922,7 @@ fail: @@ -18051,7 +18051,7 @@ index 39c0094aec..2cf7be6632 100644 avbuf->status = V4L2BUF_IN_DRIVER; diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index d3df48aed4..268a057e53 100644 +index d3df48aed499..268a057e53cc 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -599,7 +599,7 @@ static int v4l2_release_buffers(V4L2Context* ctx) @@ -18072,7 +18072,7 @@ index d3df48aed4..268a057e53 100644 if (s->output_drm) { AVHWFramesContext *hwframes; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 4cc164886c..a4176448d5 100644 +index 4cc164886c3b..a4176448d595 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -110,8 +110,7 @@ typedef struct V4L2Context { @@ -18086,17 +18086,17 @@ index 4cc164886c..a4176448d5 100644 AVMutex lock; -From b2fa4ab3d63924597b8c3659123b145a786a2c13 Mon Sep 17 00:00:00 2001 +From c103328f28905a96632afece258c14cb726a7c48 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Dec 2021 12:01:25 +0000 -Subject: [PATCH 037/161] Clear pkt_buf on flush +Subject: [PATCH 037/186] Clear pkt_buf on flush --- libavcodec/v4l2_m2m_dec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 7e7e4729d0..09ec496351 100644 +index 7e7e4729d08b..09ec4963517b 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -715,6 +715,9 @@ static void v4l2_decode_flush(AVCodecContext *avctx) @@ -18110,10 +18110,10 @@ index 7e7e4729d0..09ec496351 100644 // so mark all frames we are tracking to be discarded if they appear xlat_flush(&s->xlat); -From 16cf94cb5e1d11f4c3a6b8a43557383ce78112e0 Mon Sep 17 00:00:00 2001 +From b7552e6e913b0b894106f735465742dbba915bba Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 12:52:56 +0000 -Subject: [PATCH 038/161] Rework v4l2 buffer dequeue +Subject: [PATCH 038/186] Rework v4l2 buffer dequeue --- libavcodec/v4l2_context.c | 543 ++++++++++++++++++-------------------- @@ -18124,7 +18124,7 @@ Subject: [PATCH 038/161] Rework v4l2 buffer dequeue 5 files changed, 327 insertions(+), 373 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 268a057e53..d765181645 100644 +index 268a057e53cc..d765181645fb 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -73,19 +73,27 @@ static AVRational v4l2_get_sar(V4L2Context *ctx) @@ -18835,7 +18835,7 @@ index 268a057e53..d765181645 100644 if (ret < 0) goto fail_unref_hwframes; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index a4176448d5..565858a1ed 100644 +index a4176448d595..565858a1ed17 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -102,6 +102,8 @@ typedef struct V4L2Context { @@ -18848,7 +18848,7 @@ index a4176448d5..565858a1ed 100644 * PTS rescale not wanted * If the PTS is just a dummy frame count then rescale is diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 516e6d9858..e26bd74c3e 100644 +index 516e6d98583d..e26bd74c3e9a 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -235,7 +235,6 @@ int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *s) @@ -18860,7 +18860,7 @@ index 516e6d9858..e26bd74c3e 100644 return 0; } diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 3f86809623..d71f6b721c 100644 +index 3f8680962342..d71f6b721c94 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -84,8 +84,6 @@ typedef struct V4L2m2mContext { @@ -18901,7 +18901,7 @@ index 3f86809623..d71f6b721c 100644 #endif /* AVCODEC_V4L2_M2M_H */ diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 09ec496351..e4b6569ba5 100644 +index 09ec4963517b..e4b6569ba5bd 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -113,9 +113,6 @@ static int check_output_streamon(AVCodecContext *const avctx, V4L2m2mContext *co @@ -19147,17 +19147,17 @@ index 09ec496351..e4b6569ba5 100644 // so mark all frames we are tracking to be discarded if they appear xlat_flush(&s->xlat); -From a2519f7a512edde7433aced70de4464e21805693 Mon Sep 17 00:00:00 2001 +From 935dad1739bafaa8bf8e24d9461207b71af0d617 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Dec 2021 18:51:00 +0000 -Subject: [PATCH 039/161] Honor result of ff_get_format if possible +Subject: [PATCH 039/186] Honor result of ff_get_format if possible --- libavcodec/v4l2_m2m_dec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index e4b6569ba5..c9655bcc3b 100644 +index e4b6569ba5bd..c9655bcc3b43 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -615,15 +615,19 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx) @@ -19182,10 +19182,10 @@ index e4b6569ba5..c9655bcc3b 100644 s->device_ref = av_hwdevice_ctx_alloc(AV_HWDEVICE_TYPE_DRM); if (!s->device_ref) { -From a1cd1cb98e48c631392b385ccac5ab7b09bb5ee9 Mon Sep 17 00:00:00 2001 +From 18e485cf1252bba30cfd5feef626ad9d90fcde6a Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 14 Dec 2021 16:11:10 +0000 -Subject: [PATCH 040/161] Add an always-reinit quirk +Subject: [PATCH 040/186] Add an always-reinit quirk --- libavcodec/v4l2_context.c | 7 +++++-- @@ -19194,7 +19194,7 @@ Subject: [PATCH 040/161] Add an always-reinit quirk 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index d765181645..c11b5e6863 100644 +index d765181645fb..c11b5e68637d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -188,6 +188,9 @@ static int do_source_change(V4L2m2mContext * const s) @@ -19221,7 +19221,7 @@ index d765181645..c11b5e6863 100644 if (reinit) { if (avctx) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index d71f6b721c..f1923bb26d 100644 +index d71f6b721c94..f1923bb26d57 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -113,6 +113,11 @@ typedef struct V4L2m2mContext { @@ -19237,7 +19237,7 @@ index d71f6b721c..f1923bb26d 100644 typedef struct V4L2m2mPriv { diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index c9655bcc3b..e2b10f5e3a 100644 +index c9655bcc3b43..e2b10f5e3ac3 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -540,6 +540,34 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -19288,10 +19288,10 @@ index c9655bcc3b..e2b10f5e3a 100644 static av_cold int v4l2_decode_close(AVCodecContext *avctx) -From 2470968adf0d28bbaf310e782720dd00d57d7bf6 Mon Sep 17 00:00:00 2001 +From 9536a97e9a1119192cdb67b33799e68f39ce7630 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jan 2022 16:58:31 +0000 -Subject: [PATCH 041/161] v4l2_buffers: rework flags for keyframe +Subject: [PATCH 041/186] v4l2_buffers: rework flags for keyframe Previously flags could become confused and keyframe info could be lost. This fixes that and removes the duplicate flags field in V4L2Buffer. @@ -19302,7 +19302,7 @@ This fixes that and removes the duplicate flags field in V4L2Buffer. 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 2cf7be6632..62d1c26053 100644 +index 2cf7be663263..62d1c2605363 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -680,7 +680,9 @@ static int v4l2_buffer_swframe_to_buf(const AVFrame *frame, V4L2Buffer *out) @@ -19349,7 +19349,7 @@ index 2cf7be6632..62d1c26053 100644 av_log(logger(avbuf), AV_LOG_DEBUG, "--- %s pre VIDIOC_QBUF: index %d, ts=%ld.%06ld count=%d\n", avbuf->context->name, avbuf->buf.index, diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index 641e0e147b..3b7ca4d99e 100644 +index 641e0e147b19..3b7ca4d99e1e 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -73,7 +73,6 @@ typedef struct V4L2Buffer { @@ -19361,7 +19361,7 @@ index 641e0e147b..3b7ca4d99e 100644 } V4L2Buffer; diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index c11b5e6863..53b522d43e 100644 +index c11b5e68637d..53b522d43e09 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -527,6 +527,22 @@ get_qbuf(V4L2Context * const ctx, V4L2Buffer ** const ppavbuf, const int timeout @@ -19397,10 +19397,10 @@ index c11b5e6863..53b522d43e 100644 return NULL; -From 5dc38f5d088beea4da57e82969643cc831c40cf0 Mon Sep 17 00:00:00 2001 +From a1280d98cefbf5ef7d92a51261ad3485e0a2ca74 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 22 Mar 2022 11:44:30 +0000 -Subject: [PATCH 042/161] v4l2m2m: Rework decode to wait for missing buffer, +Subject: [PATCH 042/186] v4l2m2m: Rework decode to wait for missing buffer, add dynamic pending Previously receive_frame exited with EAGAIN if no capture buffer @@ -19420,7 +19420,7 @@ false alarms. 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 62d1c26053..8c4f18dbed 100644 +index 62d1c2605363..8c4f18dbede2 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -947,12 +947,14 @@ int ff_v4l2_buffer_enqueue(V4L2Buffer* avbuf) @@ -19441,7 +19441,7 @@ index 62d1c26053..8c4f18dbed 100644 return 0; } diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 53b522d43e..7ddb759810 100644 +index 53b522d43e09..7ddb7598109c 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -300,6 +300,7 @@ static int v4l2_stop_encode(V4L2Context *ctx) @@ -19487,7 +19487,7 @@ index 53b522d43e..7ddb759810 100644 if (s->output_drm) { diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 565858a1ed..0efff58f18 100644 +index 565858a1ed17..0efff58f1892 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -116,6 +116,7 @@ typedef struct V4L2Context { @@ -19508,7 +19508,7 @@ index 565858a1ed..0efff58f18 100644 int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* f, int timeout); diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index f1923bb26d..9a20447030 100644 +index f1923bb26d57..9a20447030e2 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -105,6 +105,8 @@ typedef struct V4L2m2mContext { @@ -19521,7 +19521,7 @@ index f1923bb26d..9a20447030 100644 pts_stats_t pts_stat; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index e2b10f5e3a..2e30449dfc 100644 +index e2b10f5e3ac3..2e30449dfc1b 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -251,7 +251,8 @@ xlat_pts_out(AVCodecContext *const avctx, @@ -19617,10 +19617,10 @@ index e2b10f5e3a..2e30449dfc 100644 capture = &s->capture; output = &s->output; -From 33765b769b4301e03f31b65e225fcdb0eff4c0e4 Mon Sep 17 00:00:00 2001 +From b88b2c555f42688db681aab4d612c29d862246f7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 25 Mar 2022 15:37:58 +0000 -Subject: [PATCH 043/161] v4l2_m2m2_dec: Avoid loop if unable to resize buffers +Subject: [PATCH 043/186] v4l2_m2m2_dec: Avoid loop if unable to resize buffers If source change signals a buffer size that cannot be honored give up rather than looping indefinitely. This happens on Pi if (say) a @@ -19630,7 +19630,7 @@ rather than looping indefinitely. This happens on Pi if (say) a 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 7ddb759810..007a58c8f1 100644 +index 7ddb7598109c..007a58c8f1db 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -205,8 +205,9 @@ static int do_source_change(V4L2m2mContext * const s) @@ -19664,10 +19664,10 @@ index 7ddb759810..007a58c8f1 100644 avctx->pix_fmt = AV_PIX_FMT_DRM_PRIME; avctx->sw_pix_fmt = s->capture.av_pix_fmt; -From bb7ad2392ce83149a1ba40ecacb36e051b6bf785 Mon Sep 17 00:00:00 2001 +From 0ec92a29d4cd4baa7820f20918d78cf117200a3b Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 25 Mar 2022 18:14:40 +0000 -Subject: [PATCH 044/161] v4l2dec: Improve size/format validation on init +Subject: [PATCH 044/186] v4l2dec: Improve size/format validation on init --- libavcodec/v4l2_m2m_dec.c | 84 ++++++++++++++++++++++++++++++++-- @@ -19675,7 +19675,7 @@ Subject: [PATCH 044/161] v4l2dec: Improve size/format validation on init 2 files changed, 92 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 2e30449dfc..8dcadf461b 100644 +index 2e30449dfc1b..8dcadf461bb8 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -592,6 +592,76 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -19784,7 +19784,7 @@ index 2e30449dfc..8dcadf461b 100644 static av_cold int v4l2_decode_close(AVCodecContext *avctx) diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index b0a5930844..76ab0916cd 100644 +index b0a5930844a8..76ab0916cd6a 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -147,6 +147,17 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) @@ -19806,10 +19806,10 @@ index b0a5930844..76ab0916cd 100644 av_log(avctx, AV_LOG_WARNING, "Failed to find any V4L2 devices\n"); return (AVERROR(-ret)); -From 4646b558c0e45f506578a5a452820f55983abc82 Mon Sep 17 00:00:00 2001 +From 5d3752246afe17f69f896bfdee6faa61162c948a Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 13 Apr 2022 16:05:56 +0000 -Subject: [PATCH 045/161] v4l2 stateless hevc: Add another API variation for +Subject: [PATCH 045/186] v4l2 stateless hevc: Add another API variation for linux 5.18 This is probably going to be a short lived variation and may end up @@ -19828,7 +19828,7 @@ being reverted if no release using it ever ends up in the wild. create mode 100644 libavcodec/v4l2_req_hevc_v3.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index e1aa0ba014..2b3c16185d 100644 +index e1aa0ba014ed..2b3c16185d75 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1000,7 +1000,7 @@ OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o @@ -19842,7 +19842,7 @@ index e1aa0ba014..2b3c16185d 100644 OBJS-$(CONFIG_MJPEG_NVDEC_HWACCEL) += nvdec_mjpeg.o diff --git a/libavcodec/hevc-ctrls-v3.h b/libavcodec/hevc-ctrls-v3.h new file mode 100644 -index 0000000000..4e35bd583d +index 000000000000..4e35bd583d58 --- /dev/null +++ b/libavcodec/hevc-ctrls-v3.h @@ -0,0 +1,255 @@ @@ -20103,7 +20103,7 @@ index 0000000000..4e35bd583d +#endif diff --git a/libavcodec/v4l2_req_hevc_v3.c b/libavcodec/v4l2_req_hevc_v3.c new file mode 100644 -index 0000000000..dcc8d95632 +index 000000000000..dcc8d9563209 --- /dev/null +++ b/libavcodec/v4l2_req_hevc_v3.c @@ -0,0 +1,3 @@ @@ -20111,7 +20111,7 @@ index 0000000000..dcc8d95632 +#include "v4l2_req_hevc_vx.c" + diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 0ae03b10c4..611fa21cc3 100644 +index 0ae03b10c4a8..611fa21cc319 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -16,6 +16,8 @@ @@ -20168,7 +20168,7 @@ index 0ae03b10c4..611fa21cc3 100644 av_log(avctx, AV_LOG_DEBUG, "Probed V%d control missing\n", HEVC_CTRLS_VERSION); return AVERROR(EINVAL); diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c -index eb00ecb406..980b306b8a 100644 +index eb00ecb40623..980b306b8a72 100644 --- a/libavcodec/v4l2_req_media.c +++ b/libavcodec/v4l2_req_media.c @@ -604,6 +604,7 @@ struct mediabufs_ctl { @@ -20210,7 +20210,7 @@ index eb00ecb406..980b306b8a 100644 if ((caps & V4L2_CAP_VIDEO_M2M_MPLANE) != 0) { mbc->src_fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; diff --git a/libavcodec/v4l2_req_media.h b/libavcodec/v4l2_req_media.h -index 2f826cfb14..0307a831de 100644 +index 2f826cfb14e7..0307a831defd 100644 --- a/libavcodec/v4l2_req_media.h +++ b/libavcodec/v4l2_req_media.h @@ -142,6 +142,9 @@ MediaBufsStatus mediabufs_src_pool_create(struct mediabufs_ctl *const rw, @@ -20224,7 +20224,7 @@ index 2f826cfb14..0307a831de 100644 const char *vpath, struct pollqueue *const pq); void mediabufs_ctl_unref(struct mediabufs_ctl **const pmbc); diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index 76ab0916cd..20e4e0ab15 100644 +index 76ab0916cd6a..20e4e0ab1559 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -210,7 +210,11 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) @@ -20241,7 +20241,7 @@ index 76ab0916cd..20e4e0ab15 100644 ctx->fns = &V2(ff_v4l2_req_hevc, 2); } diff --git a/libavcodec/v4l2_request_hevc.h b/libavcodec/v4l2_request_hevc.h -index f14f594564..ed48d62e2d 100644 +index f14f594564d7..ed48d62e2d53 100644 --- a/libavcodec/v4l2_request_hevc.h +++ b/libavcodec/v4l2_request_hevc.h @@ -98,5 +98,6 @@ typedef struct v4l2_req_decode_fns { @@ -20252,10 +20252,10 @@ index f14f594564..ed48d62e2d 100644 #endif -From 92160173e701aa7e2f1011e63596e48d15e691a9 Mon Sep 17 00:00:00 2001 +From a9773d356f79d719d96e2c59434647c0cb1295fd Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 3 May 2022 12:44:42 +0000 -Subject: [PATCH 046/161] Remove V4l2 frame size check for meson-vdec +Subject: [PATCH 046/186] Remove V4l2 frame size check for meson-vdec --- libavcodec/v4l2_m2m.h | 3 ++- @@ -20263,7 +20263,7 @@ Subject: [PATCH 046/161] Remove V4l2 frame size check for meson-vdec 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 9a20447030..6bd5e8eda7 100644 +index 9a20447030e2..6bd5e8eda76a 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -116,7 +116,8 @@ typedef struct V4L2m2mContext { @@ -20277,7 +20277,7 @@ index 9a20447030..6bd5e8eda7 100644 unsigned int quirks; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 8dcadf461b..888ba67fea 100644 +index 8dcadf461bb8..888ba67fea8c 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -604,6 +604,10 @@ check_size(AVCodecContext * const avctx, V4L2m2mContext * const s) @@ -20312,10 +20312,10 @@ index 8dcadf461b..888ba67fea 100644 av_log(avctx, AV_LOG_DEBUG, "Driver '%s': Quirks=%#x\n", cap.driver, s->quirks); return 0; -From 8ba5576e7fcd24c2f450f0295cc3b6d8e82e8649 Mon Sep 17 00:00:00 2001 +From 2e80c1992c272b3b23d47e7afae817f45b0b2a88 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 23 May 2022 18:05:20 +0100 -Subject: [PATCH 047/161] v4l2m2m_dec: Make some error rturns a bit more robust +Subject: [PATCH 047/186] v4l2m2m_dec: Make some error rturns a bit more robust --- libavcodec/v4l2_context.c | 5 ++--- @@ -20323,7 +20323,7 @@ Subject: [PATCH 047/161] v4l2m2m_dec: Make some error rturns a bit more robust 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 007a58c8f1..b3662aedaa 100644 +index 007a58c8f1db..b3662aedaa9f 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -765,7 +765,7 @@ static int stuff_all_buffers(AVCodecContext * avctx, V4L2Context* ctx) @@ -20346,7 +20346,7 @@ index 007a58c8f1..b3662aedaa 100644 av_log(avctx, AV_LOG_ERROR, "%s set status %d (%s) failed: err=%d\n", ctx->name, cmd, (cmd == VIDIOC_STREAMON) ? "ON" : "OFF", err); diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 888ba67fea..88a341aae2 100644 +index 888ba67fea8c..88a341aae2c2 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -110,16 +110,21 @@ static int check_output_streamon(AVCodecContext *const avctx, V4L2m2mContext *co @@ -20381,10 +20381,10 @@ index 888ba67fea..88a341aae2 100644 static int v4l2_try_start(AVCodecContext *avctx) -From aafa5968f8713319be35cf26069c98566d5bf59b Mon Sep 17 00:00:00 2001 +From 1c9856de210cdf151f53ce249cb4781722adfb3d Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 24 May 2022 17:02:58 +0000 -Subject: [PATCH 048/161] v4l2m2m_dec: Support in-pkt AV_PKT_DATA_NEW_EXTRADATA +Subject: [PATCH 048/186] v4l2m2m_dec: Support in-pkt AV_PKT_DATA_NEW_EXTRADATA Support packet side-data containing AV_PKT_DATA_NEW_EXTRADATA. Should also detect and complain about unexpected streams of empty packets. @@ -20398,7 +20398,7 @@ NEW_EXTRADATA side data. 3 files changed, 50 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index e26bd74c3e..6dd01e2e00 100644 +index e26bd74c3e9a..6dd01e2e0085 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -251,6 +251,7 @@ static void v4l2_m2m_destroy_context(void *opaque, uint8_t *context) @@ -20410,7 +20410,7 @@ index e26bd74c3e..6dd01e2e00 100644 av_log(s->avctx, AV_LOG_DEBUG, "V4L2 Context destroyed\n"); diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 6bd5e8eda7..19d618698d 100644 +index 6bd5e8eda76a..19d618698dd7 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -115,6 +115,9 @@ typedef struct V4L2m2mContext { @@ -20424,7 +20424,7 @@ index 6bd5e8eda7..19d618698d 100644 #define FF_V4L2_QUIRK_REINIT_ALWAYS 1 #define FF_V4L2_QUIRK_ENUM_FRAMESIZES_BROKEN 2 diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 88a341aae2..392a68f0c7 100644 +index 88a341aae2c2..392a68f0c7d2 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -343,7 +343,46 @@ static int try_enqueue_src(AVCodecContext * const avctx, V4L2m2mContext * const @@ -20491,17 +20491,17 @@ index 88a341aae2..392a68f0c7 100644 if (ret == AVERROR(EAGAIN)) { // Out of input buffers - keep packet -From e9bced67bdb40096d31067d41956276e9e1af11a Mon Sep 17 00:00:00 2001 +From f128df5af073fb4cece2393c1fd0a19defb5675e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 24 May 2022 20:02:48 +0000 -Subject: [PATCH 049/161] v4l2m2m_dec: Catch repeated Q fulls +Subject: [PATCH 049/186] v4l2m2m_dec: Catch repeated Q fulls --- libavcodec/v4l2_m2m_dec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 392a68f0c7..7e17044706 100644 +index 392a68f0c7d2..7e170447064a 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -504,13 +504,14 @@ static int qbuf_wait(AVCodecContext * const avctx, V4L2Context * const ctx) @@ -20533,10 +20533,10 @@ index 392a68f0c7..7e17044706 100644 // (a) we haven't already got one AND // (b) enqueue returned a status indicating that decode should be attempted -From 0c974e4da2c0311836145f2fd42081d40eb15998 Mon Sep 17 00:00:00 2001 +From 3997265fa559c38feaf4458625e3ec0e353e505b Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 25 May 2022 15:22:12 +0000 -Subject: [PATCH 050/161] Remove requirement for epoxy & libudev config options +Subject: [PATCH 050/186] Remove requirement for epoxy & libudev config options --- configure | 26 +++++++++++++++++--------- @@ -20544,7 +20544,7 @@ Subject: [PATCH 050/161] Remove requirement for epoxy & libudev config options 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/configure b/configure -index b41663c794..fdc95146bf 100755 +index a4ffd8797690..f3991452e4a5 100755 --- a/configure +++ b/configure @@ -205,6 +205,7 @@ External library support: @@ -20647,7 +20647,7 @@ index b41663c794..fdc95146bf 100755 if enabled gcrypt; then GCRYPT_CONFIG="${cross_prefix}libgcrypt-config" diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh -index 65576846e8..37cea71756 100755 +index 65576846e81f..37cea71756ae 100755 --- a/pi-util/conf_native.sh +++ b/pi-util/conf_native.sh @@ -91,8 +91,6 @@ $FFSRC/configure \ @@ -20660,10 +20660,10 @@ index 65576846e8..37cea71756 100755 --enable-vout-drm\ $SHARED_LIBS\ -From 9f234d8cbde2829e6a70fd3cb6324998df8a31f3 Mon Sep 17 00:00:00 2001 +From bcc9de26a54ab85a5f225706f6de36c885d7cb4c Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 27 May 2022 09:36:51 +0000 -Subject: [PATCH 051/161] hevc: If hwaccel avoid creation of s/w only vars +Subject: [PATCH 051/186] hevc: If hwaccel avoid creation of s/w only vars --- libavcodec/hevc_refs.c | 35 +++++++++++++++++++++-------------- @@ -20671,7 +20671,7 @@ Subject: [PATCH 051/161] hevc: If hwaccel avoid creation of s/w only vars 2 files changed, 50 insertions(+), 27 deletions(-) diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c -index 811e8feff8..f7cf14eabc 100644 +index 811e8feff8a1..f7cf14eabccc 100644 --- a/libavcodec/hevc_refs.c +++ b/libavcodec/hevc_refs.c @@ -98,18 +98,22 @@ static HEVCFrame *alloc_frame(HEVCContext *s) @@ -20730,7 +20730,7 @@ index 811e8feff8..f7cf14eabc 100644 return 0; } diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c -index 2867cb2e16..17f53322fb 100644 +index e892436f9405..a2c29a611c5a 100644 --- a/libavcodec/hevcdec.c +++ b/libavcodec/hevcdec.c @@ -536,6 +536,16 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps, @@ -20750,7 +20750,7 @@ index 2867cb2e16..17f53322fb 100644 ret = pic_arrays_init(s, sps); if (ret < 0) goto fail; -@@ -2890,11 +2900,13 @@ static int hevc_frame_start(HEVCContext *s) +@@ -2893,11 +2903,13 @@ static int hevc_frame_start(HEVCContext *s) ((s->ps.sps->height >> s->ps.sps->log2_min_cb_size) + 1); int ret; @@ -20769,7 +20769,7 @@ index 2867cb2e16..17f53322fb 100644 s->is_decoded = 0; s->first_nal_type = s->nal_unit_type; -@@ -3438,15 +3450,19 @@ static int hevc_ref_frame(HEVCContext *s, HEVCFrame *dst, HEVCFrame *src) +@@ -3441,15 +3453,19 @@ static int hevc_ref_frame(HEVCContext *s, HEVCFrame *dst, HEVCFrame *src) dst->needs_fg = 1; } @@ -20798,10 +20798,10 @@ index 2867cb2e16..17f53322fb 100644 dst->rpl_buf = av_buffer_ref(src->rpl_buf); if (!dst->rpl_buf) -From bb2ddc480634141bed9afd3f66e7f63f5091bb2f Mon Sep 17 00:00:00 2001 +From af130585ebdfcda7ee01819b6869aa6eb6a0172d Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 30 May 2022 17:51:44 +0100 -Subject: [PATCH 052/161] rpi_sand: Add SAND30->NV12 conversion +Subject: [PATCH 052/186] rpi_sand: Add SAND30->NV12 conversion C code only. Reworks the hwcontext_drm conversion to use the rpi_sand_fns generic frame convert fn rather than calling the @@ -20814,7 +20814,7 @@ size logic in a single place. 3 files changed, 111 insertions(+), 29 deletions(-) diff --git a/libavutil/hwcontext_drm.c b/libavutil/hwcontext_drm.c -index baf18920fa..137a952d2c 100644 +index baf18920fa14..137a952d2c3c 100644 --- a/libavutil/hwcontext_drm.c +++ b/libavutil/hwcontext_drm.c @@ -234,14 +234,14 @@ static int drm_transfer_get_formats(AVHWFramesContext *ctx, @@ -20890,7 +20890,7 @@ index baf18920fa..137a952d2c 100644 av_log(hwfc, AV_LOG_ERROR, "%s: Incompatible output pixfmt for sand\n", __func__); err = AVERROR(EINVAL); diff --git a/libavutil/rpi_sand_fns.c b/libavutil/rpi_sand_fns.c -index 1f543e9357..256c3d532f 100644 +index 1f543e935701..256c3d532f38 100644 --- a/libavutil/rpi_sand_fns.c +++ b/libavutil/rpi_sand_fns.c @@ -229,6 +229,75 @@ void av_rpi_sand30_to_planar_c16(uint8_t * dst_u, const unsigned int dst_stride_ @@ -21004,7 +21004,7 @@ index 1f543e9357..256c3d532f 100644 return -1; } diff --git a/libavutil/rpi_sand_fns.h b/libavutil/rpi_sand_fns.h -index 634b55e800..462ccb8abd 100644 +index 634b55e800dc..462ccb8abd18 100644 --- a/libavutil/rpi_sand_fns.h +++ b/libavutil/rpi_sand_fns.h @@ -85,6 +85,11 @@ void av_rpi_sand30_to_planar_c16(uint8_t * dst_u, const unsigned int dst_stride_ @@ -21020,10 +21020,10 @@ index 634b55e800..462ccb8abd 100644 // w/h in pixels void av_rpi_sand16_to_sand8(uint8_t * dst, const unsigned int dst_stride1, const unsigned int dst_stride2, -From b55c351e6954c800229d97dc6c982ca8f998c848 Mon Sep 17 00:00:00 2001 +From 474c3010278bb385614f536968681bd5043e81ae Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 1 Jun 2022 17:49:26 +0000 -Subject: [PATCH 053/161] rpi_sand: Add SAND30->NV12 asm for Armv7 & Armv8 +Subject: [PATCH 053/186] rpi_sand: Add SAND30->NV12 asm for Armv7 & Armv8 Also reworks the previous Armv8 SAND30->Y16 function in a slightly more efficient way that makes it look more like the Armv7 version. @@ -21036,7 +21036,7 @@ efficient way that makes it look more like the Armv7 version. 5 files changed, 541 insertions(+), 264 deletions(-) diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S -index cdcf71ee67..2f07d9674c 100644 +index cdcf71ee6740..2f07d9674c9f 100644 --- a/libavutil/aarch64/rpi_sand_neon.S +++ b/libavutil/aarch64/rpi_sand_neon.S @@ -248,228 +248,6 @@ incomplete_block_loop_end_c8: @@ -21600,7 +21600,7 @@ index cdcf71ee67..2f07d9674c 100644 +endfunc + diff --git a/libavutil/aarch64/rpi_sand_neon.h b/libavutil/aarch64/rpi_sand_neon.h -index b3aa481ea4..2a56135bc3 100644 +index b3aa481ea497..2a56135bc327 100644 --- a/libavutil/aarch64/rpi_sand_neon.h +++ b/libavutil/aarch64/rpi_sand_neon.h @@ -49,6 +49,10 @@ void ff_rpi_sand30_lines_to_planar_c16(uint8_t * dst_u, unsigned int dst_stride_ @@ -21615,7 +21615,7 @@ index b3aa481ea4..2a56135bc3 100644 } #endif diff --git a/libavutil/arm/rpi_sand_neon.S b/libavutil/arm/rpi_sand_neon.S -index 80890fe985..60e697f681 100644 +index 80890fe9854b..60e697f6819b 100644 --- a/libavutil/arm/rpi_sand_neon.S +++ b/libavutil/arm/rpi_sand_neon.S @@ -360,7 +360,6 @@ function ff_rpi_sand30_lines_to_planar_y16, export=1 @@ -21925,7 +21925,7 @@ index 80890fe985..60e697f681 100644 + diff --git a/libavutil/arm/rpi_sand_neon.h b/libavutil/arm/rpi_sand_neon.h -index 447f367bea..d457c10870 100644 +index 447f367bea8f..d457c1087082 100644 --- a/libavutil/arm/rpi_sand_neon.h +++ b/libavutil/arm/rpi_sand_neon.h @@ -95,5 +95,16 @@ void ff_rpi_sand30_lines_to_planar_p010( @@ -21946,7 +21946,7 @@ index 447f367bea..d457c10870 100644 #endif // AVUTIL_ARM_SAND_NEON_H diff --git a/libavutil/rpi_sand_fns.c b/libavutil/rpi_sand_fns.c -index 256c3d532f..b6071e2928 100644 +index 256c3d532f38..b6071e2928f7 100644 --- a/libavutil/rpi_sand_fns.c +++ b/libavutil/rpi_sand_fns.c @@ -247,7 +247,7 @@ void av_rpi_sand30_to_planar_y8(uint8_t * dst, const unsigned int dst_stride, @@ -21959,10 +21959,10 @@ index 256c3d532f..b6071e2928 100644 ff_rpi_sand30_lines_to_planar_y8(dst, dst_stride, src, stride1, stride2, _x, y, _w, h); return; -From 24c3eef4487a36d5189ecd934b65a7c6a0b53d03 Mon Sep 17 00:00:00 2001 +From 76556eb5987c43cc46decc0d642ed7d762113613 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 7 Jun 2022 14:46:12 +0000 -Subject: [PATCH 054/161] v4l2_m2m_enc: Add the ability to encode DRM_PRIME +Subject: [PATCH 054/186] v4l2_m2m_enc: Add the ability to encode DRM_PRIME frames --- @@ -21977,7 +21977,7 @@ Subject: [PATCH 054/161] v4l2_m2m_enc: Add the ability to encode DRM_PRIME 8 files changed, 643 insertions(+), 198 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 8c4f18dbed..9ef2f40e39 100644 +index 8c4f18dbede2..9ef2f40e3991 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -29,6 +29,8 @@ @@ -22211,7 +22211,7 @@ index 8c4f18dbed..9ef2f40e39 100644 if (avbuf->plane_info[i].mm_addr == MAP_FAILED) { diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index 3b7ca4d99e..1ac32c5989 100644 +index 3b7ca4d99e1e..1ac32c5989f1 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -59,6 +59,10 @@ typedef struct V4L2Buffer { @@ -22269,7 +22269,7 @@ index 3b7ca4d99e..1ac32c5989 100644 #endif // AVCODEC_V4L2_BUFFERS_H diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index b3662aedaa..7a707d21fc 100644 +index b3662aedaa9f..7a707d21fc7a 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -43,6 +43,160 @@ struct v4l2_format_update { @@ -22606,7 +22606,7 @@ index b3662aedaa..7a707d21fc 100644 goto fail_unref_hwframes; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 0efff58f18..21265f1bd7 100644 +index 0efff58f1892..21265f1bd77b 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -91,11 +91,19 @@ typedef struct V4L2Context { @@ -22645,7 +22645,7 @@ index 0efff58f18..21265f1bd7 100644 AVBufferRef *frames_ref; atomic_int q_count; diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 6dd01e2e00..1e30d15fd8 100644 +index 6dd01e2e0085..1e30d15fd866 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -35,6 +35,14 @@ @@ -22725,7 +22725,7 @@ index 6dd01e2e00..1e30d15fd8 100644 return 0; } diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 19d618698d..d6cdaf65e1 100644 +index 19d618698dd7..d6cdaf65e183 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -103,6 +103,9 @@ typedef struct V4L2m2mContext { @@ -22739,7 +22739,7 @@ index 19d618698d..d6cdaf65e1 100644 xlat_track_t xlat; int pending_hw; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 7e17044706..fbbfc81342 100644 +index 7e170447064a..fbbfc81342d5 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -169,96 +169,17 @@ static int v4l2_prepare_decoder(V4L2m2mContext *s) @@ -22973,7 +22973,7 @@ index 7e17044706..fbbfc81342 100644 /* the client requests the codec to generate DRM frames: * - data[0] will therefore point to the returned AVDRMFrameDescriptor diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index 9a0837ecf3..05ff6ba726 100644 +index 9a0837ecf3d7..05ff6ba72655 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -24,6 +24,8 @@ @@ -23334,10 +23334,10 @@ index 9a0837ecf3..05ff6ba726 100644 av_log(avctx, AV_LOG_ERROR, "Encoder requires %s pixel format.\n", desc->name); return AVERROR(EINVAL); -From 6b437ce70582c67971aa81871a6694a08b709784 Mon Sep 17 00:00:00 2001 +From e073991161bc9fc70a5ea3079d6b25c9d9008a4b Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 8 Jun 2022 16:13:31 +0000 -Subject: [PATCH 055/161] v4l2_m2m_dec: Use DTS for best effort PTS if PTS is +Subject: [PATCH 055/186] v4l2_m2m_dec: Use DTS for best effort PTS if PTS is always NO_PTS If we do have DTS but don't have PTS then assume PTS=DTS. @@ -23350,7 +23350,7 @@ useful in any way. 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 7a707d21fc..6b97eab41e 100644 +index 7a707d21fc7a..6b97eab41ed7 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -73,7 +73,6 @@ xlat_pts_pkt_in(AVCodecContext *const avctx, xlat_track_t *const x, const AVPack @@ -23388,7 +23388,7 @@ index 7a707d21fc..6b97eab41e 100644 frame->pkt_pos = t->pkt_pos; frame->pkt_duration = t->pkt_duration; diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index d6cdaf65e1..ee72beb052 100644 +index d6cdaf65e183..ee72beb0522b 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -67,7 +67,6 @@ typedef struct pts_stats_s @@ -23400,7 +23400,7 @@ index d6cdaf65e1..ee72beb052 100644 V4L2m2mTrackEl track_els[FF_V4L2_M2M_TRACK_SIZE]; } xlat_track_t; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index fbbfc81342..485a96f4b4 100644 +index fbbfc81342d5..485a96f4b487 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -177,7 +177,13 @@ set_best_effort_pts(AVCodecContext *const avctx, @@ -23419,10 +23419,10 @@ index fbbfc81342..485a96f4b4 100644 frame->pts, frame->best_effort_timestamp, frame->pkt_dts); } -From ec8d1c2c0b6bd3544e5e30500a167fc31abde17a Mon Sep 17 00:00:00 2001 +From 256637631cb246663c310d0bc8c3769b4af70692 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 30 Jun 2022 15:59:23 +0000 -Subject: [PATCH 056/161] v4l2: Update H265 request for current API +Subject: [PATCH 056/186] v4l2: Update H265 request for current API This works with v9 of the H265 patch set which hopefully will be the last one. Hevc controls extracted from patched v4l2-controls into @@ -23440,7 +23440,7 @@ those will be used instead. create mode 100644 libavcodec/v4l2_req_hevc_v4.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index 2b3c16185d..d433a71236 100644 +index 2b3c16185d75..d433a712366f 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1000,7 +1000,7 @@ OBJS-$(CONFIG_HEVC_DXVA2_HWACCEL) += dxva2_hevc.o @@ -23454,7 +23454,7 @@ index 2b3c16185d..d433a71236 100644 OBJS-$(CONFIG_MJPEG_NVDEC_HWACCEL) += nvdec_mjpeg.o diff --git a/libavcodec/hevc-ctrls-v4.h b/libavcodec/hevc-ctrls-v4.h new file mode 100644 -index 0000000000..7e05f6e7c3 +index 000000000000..7e05f6e7c39b --- /dev/null +++ b/libavcodec/hevc-ctrls-v4.h @@ -0,0 +1,515 @@ @@ -23975,7 +23975,7 @@ index 0000000000..7e05f6e7c3 +#endif diff --git a/libavcodec/v4l2_req_hevc_v4.c b/libavcodec/v4l2_req_hevc_v4.c new file mode 100644 -index 0000000000..c35579d8e0 +index 000000000000..c35579d8e0ab --- /dev/null +++ b/libavcodec/v4l2_req_hevc_v4.c @@ -0,0 +1,3 @@ @@ -23983,7 +23983,7 @@ index 0000000000..c35579d8e0 +#include "v4l2_req_hevc_vx.c" + diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 611fa21cc3..761c5b2dc7 100644 +index 611fa21cc319..761c5b2dc74b 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -6,8 +6,6 @@ @@ -24180,7 +24180,7 @@ index 611fa21cc3..761c5b2dc7 100644 return AVERROR(EINVAL); } diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index 20e4e0ab15..cd79aad563 100644 +index 20e4e0ab1559..cd79aad5631a 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -210,7 +210,11 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) @@ -24197,7 +24197,7 @@ index 20e4e0ab15..cd79aad563 100644 ctx->fns = &V2(ff_v4l2_req_hevc, 3); } diff --git a/libavcodec/v4l2_request_hevc.h b/libavcodec/v4l2_request_hevc.h -index ed48d62e2d..d4adb3f812 100644 +index ed48d62e2d53..d4adb3f812a6 100644 --- a/libavcodec/v4l2_request_hevc.h +++ b/libavcodec/v4l2_request_hevc.h @@ -99,5 +99,6 @@ typedef struct v4l2_req_decode_fns { @@ -24208,10 +24208,10 @@ index ed48d62e2d..d4adb3f812 100644 #endif -From 21a348ae3282318fa96d3a6e2c70f3d4b90a7d52 Mon Sep 17 00:00:00 2001 +From d6457f1d161c7430750b1cc925e370314ba9b83c Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 3 Jul 2022 13:40:41 +0000 -Subject: [PATCH 057/161] v4l2_req: Observe limit on size of slice_array +Subject: [PATCH 057/186] v4l2_req: Observe limit on size of slice_array This in fact provides some minor simplifications by combing the multi-slice and single-slice paths. @@ -24223,7 +24223,7 @@ multi-slice and single-slice paths. 2 files changed, 17 insertions(+), 27 deletions(-) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 761c5b2dc7..9d08d13d9e 100644 +index 761c5b2dc74b..9d08d13d9e68 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -840,18 +840,21 @@ static int v4l2_request_hevc_decode_slice(AVCodecContext *avctx, const uint8_t * @@ -24314,7 +24314,7 @@ index 761c5b2dc7..9d08d13d9e 100644 ctrls[0].value = ctx->decode_mode; ctrls[1].value = ctx->start_code; diff --git a/libavcodec/v4l2_request_hevc.h b/libavcodec/v4l2_request_hevc.h -index d4adb3f812..0029e23309 100644 +index d4adb3f812a6..0029e2330977 100644 --- a/libavcodec/v4l2_request_hevc.h +++ b/libavcodec/v4l2_request_hevc.h @@ -46,8 +46,6 @@ @@ -24339,10 +24339,10 @@ index d4adb3f812..0029e23309 100644 req_decode_q decode_q; -From 4f1d74cc8eea6a1bd6f2317a10c0ecf620315dec Mon Sep 17 00:00:00 2001 +From d4794c95cd25fb87a3dcc7585eb7b057211a87dd Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 14:43:20 +0100 -Subject: [PATCH 058/161] v4l2_req: Add entry point offsets array control +Subject: [PATCH 058/186] v4l2_req: Add entry point offsets array control --- libavcodec/v4l2_req_hevc_vx.c | 88 +++++++++++++++++++++++++++------- @@ -24350,7 +24350,7 @@ Subject: [PATCH 058/161] v4l2_req: Add entry point offsets array control 2 files changed, 72 insertions(+), 19 deletions(-) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 9d08d13d9e..43ef6631ed 100644 +index 9d08d13d9e68..43ef6631edc1 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -82,11 +82,16 @@ typedef struct V4L2MediaReqDescriptor { @@ -24563,7 +24563,7 @@ index 9d08d13d9e..43ef6631ed 100644 av_free(rd); } diff --git a/libavcodec/v4l2_request_hevc.h b/libavcodec/v4l2_request_hevc.h -index 0029e23309..99c90064ea 100644 +index 0029e2330977..99c90064eab8 100644 --- a/libavcodec/v4l2_request_hevc.h +++ b/libavcodec/v4l2_request_hevc.h @@ -64,7 +64,8 @@ typedef struct V4L2RequestContextHEVC { @@ -24577,17 +24577,17 @@ index 0029e23309..99c90064ea 100644 req_decode_q decode_q; -From d0e5ed2dff1b8f8909ceb968cb3afe2b20093fda Mon Sep 17 00:00:00 2001 +From b6e9c32d7a2cab41f9fbce46989173f32e2135d8 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 16:22:54 +0100 -Subject: [PATCH 059/161] v4l2_req: Support Annex B +Subject: [PATCH 059/186] v4l2_req: Support Annex B --- libavcodec/v4l2_req_hevc_vx.c | 61 +++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 43ef6631ed..5e0db9850a 100644 +index 43ef6631edc1..5e0db9850aad 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -879,6 +879,18 @@ static int v4l2_request_hevc_decode_slice(AVCodecContext *avctx, const uint8_t * @@ -24691,17 +24691,17 @@ index 43ef6631ed..5e0db9850a 100644 ctrls[1].value = ctx->start_code; -From a75506e18a964c9f50efa224a3fa4179c9ef2127 Mon Sep 17 00:00:00 2001 +From ed654f6e2703c556582de06129a8052c95e1d934 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 18:24:03 +0100 -Subject: [PATCH 060/161] v4l2_req: Add frame mode decode +Subject: [PATCH 060/186] v4l2_req: Add frame mode decode --- libavcodec/v4l2_req_hevc_vx.c | 69 +++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 23 deletions(-) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 5e0db9850a..ada53d0d44 100644 +index 5e0db9850aad..ada53d0d44df 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -814,9 +814,9 @@ set_req_ctls(V4L2RequestContextHEVC *ctx, struct media_request * const mreq, @@ -24817,17 +24817,17 @@ index 5e0db9850a..ada53d0d44 100644 ctrls[1].value = ctx->start_code; -From 9cf01f1485dcf71bcad7981d45029425d9abf115 Mon Sep 17 00:00:00 2001 +From 765b4048cbe852cb857b64cab54afc2c4aed92cc Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 5 Jul 2022 12:54:22 +0000 -Subject: [PATCH 061/161] v4l2_req: Fix probe for frame based decode +Subject: [PATCH 061/186] v4l2_req: Fix probe for frame based decode --- libavcodec/v4l2_req_hevc_vx.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index ada53d0d44..5d083016f8 100644 +index ada53d0d44df..5d083016f89a 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -1082,6 +1082,12 @@ fail: @@ -24900,10 +24900,10 @@ index ada53d0d44..5d083016f8 100644 static int set_controls(AVCodecContext * const avctx, V4L2RequestContextHEVC * const ctx) -From e7a62226f26073149d35c89268f56e17c8f45d76 Mon Sep 17 00:00:00 2001 +From 64b8c3987f022ed871ba9ed835de13e18c7e38ee Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 26 Jul 2022 15:46:14 +0000 -Subject: [PATCH 062/161] vf_deinterlace_v4l2m2m: Support NV12 through +Subject: [PATCH 062/186] vf_deinterlace_v4l2m2m: Support NV12 through deinterlace Supports NV12 (though not yet NV12M) through deinterlace. @@ -24915,7 +24915,7 @@ No longer leaks frame structures. 1 file changed, 107 insertions(+), 53 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 1a933b7e0a..1a3bef5bcb 100644 +index 1a933b7e0a5f..1a3bef5bcba6 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -373,14 +373,16 @@ static int deint_v4l2m2m_try_format(V4L2Queue *queue) @@ -25226,10 +25226,10 @@ index 1a933b7e0a..1a3bef5bcb 100644 if (n < 6) { -From 3d07826bcf588ad0384d00b210415664aa4489fb Mon Sep 17 00:00:00 2001 +From b24e23b1a87bc51508e8fb2cf4ea31385059e150 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 19 Aug 2022 15:29:11 +0000 -Subject: [PATCH 063/161] v4l2_req: Enable use of MMAP for buffer alloc +Subject: [PATCH 063/186] v4l2_req: Enable use of MMAP for buffer alloc Use MMAP rather than DMABUF if either the dmabuf device can't be opened or create_buf doesn't set the capability. @@ -25242,7 +25242,7 @@ or create_buf doesn't set the capability. 5 files changed, 307 insertions(+), 44 deletions(-) diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c -index ae6c648369..c4bbed18c6 100644 +index ae6c64836972..c4bbed18c680 100644 --- a/libavcodec/v4l2_req_dmabufs.c +++ b/libavcodec/v4l2_req_dmabufs.c @@ -36,6 +36,26 @@ static unsigned int total_bufs = 0; @@ -25282,7 +25282,7 @@ index ae6c648369..c4bbed18c6 100644 const int err = errno; if (errno == EINTR) diff --git a/libavcodec/v4l2_req_dmabufs.h b/libavcodec/v4l2_req_dmabufs.h -index cfb17e801d..c1d3d8c8d7 100644 +index cfb17e801d59..c1d3d8c8d751 100644 --- a/libavcodec/v4l2_req_dmabufs.h +++ b/libavcodec/v4l2_req_dmabufs.h @@ -18,6 +18,9 @@ static inline struct dmabuf_h * dmabuf_alloc(struct dmabufs_ctl * dbsc, size_t s @@ -25296,7 +25296,7 @@ index cfb17e801d..c1d3d8c8d7 100644 /* flags from linux/dmabuf.h DMA_BUF_SYNC_xxx */ diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c -index 980b306b8a..910ac77bb6 100644 +index 980b306b8a72..910ac77bb6f9 100644 --- a/libavcodec/v4l2_req_media.c +++ b/libavcodec/v4l2_req_media.c @@ -33,9 +33,11 @@ @@ -25800,7 +25800,7 @@ index 980b306b8a..910ac77bb6 100644 static void mediabufs_ctl_delete(struct mediabufs_ctl *const mbc) diff --git a/libavcodec/v4l2_req_media.h b/libavcodec/v4l2_req_media.h -index 0307a831de..890947b2e2 100644 +index 0307a831defd..890947b2e210 100644 --- a/libavcodec/v4l2_req_media.h +++ b/libavcodec/v4l2_req_media.h @@ -43,6 +43,7 @@ typedef enum media_buf_status { @@ -25860,7 +25860,7 @@ index 0307a831de..890947b2e2 100644 #define MEDIABUFS_DRIVER_VERSION(a, b, c) (((a) << 16) | ((b) << 8) | (c)) unsigned int mediabufs_ctl_driver_version(struct mediabufs_ctl *const mbc); diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index cd79aad563..5cf17dd5e3 100644 +index cd79aad5631a..5cf17dd5e3fb 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -144,6 +144,8 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) @@ -25958,17 +25958,17 @@ index cd79aad563..5cf17dd5e3 100644 return 0; -From 79c2fcac56586ce9eea0cc8c6b13d2cd54f3e468 Mon Sep 17 00:00:00 2001 +From 3087f58ab5abfac2a3d50359db08431a89d446df Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 22 Aug 2022 12:35:40 +0000 -Subject: [PATCH 064/161] Set buffer lengths on DQ +Subject: [PATCH 064/186] Set buffer lengths on DQ --- libavcodec/v4l2_req_media.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c -index 910ac77bb6..1a9944774a 100644 +index 910ac77bb6f9..1a9944774a48 100644 --- a/libavcodec/v4l2_req_media.c +++ b/libavcodec/v4l2_req_media.c @@ -733,6 +733,14 @@ static struct qent_base * qe_dequeue(struct buf_pool *const bp, @@ -25987,10 +25987,10 @@ index 910ac77bb6..1a9944774a 100644 be->status = (buffer.flags & V4L2_BUF_FLAG_ERROR) ? QENT_ERROR : QENT_DONE; return be; -From 8f3245ca1e4b2ec7e13fc2f3bffbc964ee8fc290 Mon Sep 17 00:00:00 2001 +From d761ce983b4738df798b02636433bfc342e387c1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 22 Aug 2022 17:11:24 +0000 -Subject: [PATCH 065/161] Fix compile if videodev2.h defines V4L2 HEVC request +Subject: [PATCH 065/186] Fix compile if videodev2.h defines V4L2 HEVC request API If videodev2.h does define the HEVC request API it is really hard to @@ -26005,7 +26005,7 @@ against the system includes and remove the back compatability. 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/configure b/configure -index fdc95146bf..5c00a183e3 100755 +index f3991452e4a5..055944934476 100755 --- a/configure +++ b/configure @@ -1946,6 +1946,7 @@ FEATURE_LIST=" @@ -26032,7 +26032,7 @@ index fdc95146bf..5c00a183e3 100755 test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index d433a71236..11f183c9b9 100644 +index d433a712366f..11f183c9b9ba 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -999,8 +999,8 @@ OBJS-$(CONFIG_HEVC_D3D11VA_HWACCEL) += dxva2_hevc.o @@ -26047,7 +26047,7 @@ index d433a71236..11f183c9b9 100644 OBJS-$(CONFIG_HEVC_VDPAU_HWACCEL) += vdpau_hevc.o h265_profile_level.o OBJS-$(CONFIG_MJPEG_NVDEC_HWACCEL) += nvdec_mjpeg.o diff --git a/libavcodec/hevc-ctrls-v4.h b/libavcodec/hevc-ctrls-v4.h -index 7e05f6e7c3..7829d82084 100644 +index 7e05f6e7c39b..7829d8208435 100644 --- a/libavcodec/hevc-ctrls-v4.h +++ b/libavcodec/hevc-ctrls-v4.h @@ -53,6 +53,8 @@ @@ -26060,7 +26060,7 @@ index 7e05f6e7c3..7829d82084 100644 #define V4L2_CID_STATELESS_HEVC_PPS (V4L2_CID_CODEC_STATELESS_BASE + 401) #define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS (V4L2_CID_CODEC_STATELESS_BASE + 402) diff --git a/libavcodec/v4l2_req_hevc_vx.c b/libavcodec/v4l2_req_hevc_vx.c -index 5d083016f8..e1bd5c6a1f 100644 +index 5d083016f89a..e1bd5c6a1f09 100644 --- a/libavcodec/v4l2_req_hevc_vx.c +++ b/libavcodec/v4l2_req_hevc_vx.c @@ -40,11 +40,6 @@ @@ -26076,7 +26076,7 @@ index 5d083016f8..e1bd5c6a1f 100644 #include "libavutil/hwcontext_drm.h" diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index 5cf17dd5e3..614a1b4d99 100644 +index 5cf17dd5e3fb..614a1b4d99e4 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -17,7 +17,7 @@ @@ -26114,10 +26114,10 @@ index 5cf17dd5e3..614a1b4d99 100644 av_log(avctx, AV_LOG_ERROR, "No HEVC version probed successfully\n"); ret = AVERROR(EINVAL); -From 35ec6af32c4f05b076f84ab343a8fc0d3263ba44 Mon Sep 17 00:00:00 2001 +From 8fff782ad6a053a67e3621ffaa06dfa6d6b6bba6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Sep 2022 17:59:22 +0100 -Subject: [PATCH 066/161] v4l2_m2m_enc: Send headers in in pkt side_data +Subject: [PATCH 066/186] v4l2_m2m_enc: Send headers in in pkt side_data If GLOBAL_HEADERS are requested then we can't provide them at init time so send as NEW_EXTRADATA side data in a similar way to some AV1 @@ -26127,7 +26127,7 @@ encoders. 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index 05ff6ba726..099ad23928 100644 +index 05ff6ba72655..099ad23928d3 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -544,14 +544,12 @@ dequeue: @@ -26195,10 +26195,10 @@ index 05ff6ba726..099ad23928 100644 static av_cold int v4l2_encode_init(AVCodecContext *avctx) -From dfc754491cea9192945b92ca9c8d3919321e30ad Mon Sep 17 00:00:00 2001 +From 9d4bafaf9c0f149c2ad4b4b26d5c55a4c2deaaa0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 14 Sep 2022 15:44:10 +0000 -Subject: [PATCH 067/161] matroskaenc: Allow H264 SPS/PPS headers in packet +Subject: [PATCH 067/186] matroskaenc: Allow H264 SPS/PPS headers in packet sidedata --- @@ -26206,7 +26206,7 @@ Subject: [PATCH 067/161] matroskaenc: Allow H264 SPS/PPS headers in packet 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c -index 113541bd9a..61e4c976ef 100644 +index 113541bd9a20..61e4c976ef76 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -77,6 +77,10 @@ @@ -26264,17 +26264,17 @@ index 113541bd9a..61e4c976ef 100644 if (side_data_size) av_log(s, AV_LOG_DEBUG, "Ignoring new extradata in a packet for stream %d.\n", pkt->stream_index); -From 30c6ca4e24ae2acbd7f7f122f5275beb62b625c6 Mon Sep 17 00:00:00 2001 +From 969917342459c78f480f327ea682d8880357a2df Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 14 Sep 2022 15:55:15 +0000 -Subject: [PATCH 068/161] movenc: Allow H264 SPS/PPS headers in packet sidedata +Subject: [PATCH 068/186] movenc: Allow H264 SPS/PPS headers in packet sidedata --- libavformat/movenc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c -index c4fcb5f8b1..891adbf7b2 100644 +index c4fcb5f8b1b3..891adbf7b26c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6343,6 +6343,7 @@ static int mov_write_single_packet(AVFormatContext *s, AVPacket *pkt) @@ -26286,10 +26286,10 @@ index c4fcb5f8b1..891adbf7b2 100644 size_t side_size; uint8_t *side = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, &side_size); -From 1c7c3e99e9ed90f241aecbe7b2269229587d1e03 Mon Sep 17 00:00:00 2001 +From a78c7c1a9afc53f0ef71d251cb06789763babb26 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 12:45:05 +0100 -Subject: [PATCH 069/161] Allow ffmpeg to select codec internal hwfmts if +Subject: [PATCH 069/186] Allow ffmpeg to select codec internal hwfmts if no_cvt_hw This allows the selection of DRM_PRIME from v4l2m2m without forcing it @@ -26301,10 +26301,10 @@ Not utterly sure this is the right method for 5.1 but it does work 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c -index ba0c1898cf..839da7b472 100644 +index 04bea4ef4fe9..0de534618323 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c -@@ -2763,12 +2763,15 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat +@@ -2766,12 +2766,15 @@ static enum AVPixelFormat get_format(AVCodecContext *s, const enum AVPixelFormat break; if (ist->hwaccel_id == HWACCEL_GENERIC || @@ -26323,10 +26323,10 @@ index ba0c1898cf..839da7b472 100644 continue; if (config->pix_fmt == *p) -From ecf273fd02e8aafe8775b1f291b9664b1b49572e Mon Sep 17 00:00:00 2001 +From 72c4c2e860365d46301c688d8586b2f4f023ac8d Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 1 Sep 2022 11:42:41 +0000 -Subject: [PATCH 070/161] vf_deinterlace_v4l2m2m: Add a v4l2m2m scaler +Subject: [PATCH 070/186] vf_deinterlace_v4l2m2m: Add a v4l2m2m scaler The logic for running an isp based scaler is pretty much identical to that for the deinterlacer so add to the deinterlacer. This requires @@ -26339,7 +26339,7 @@ based on operation. 2 files changed, 877 insertions(+), 247 deletions(-) diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c -index 357ff61ca8..d504fa1bc8 100644 +index 357ff61ca803..d504fa1bc8de 100644 --- a/libavfilter/allfilters.c +++ b/libavfilter/allfilters.c @@ -421,6 +421,7 @@ extern const AVFilter ff_vf_scale; @@ -26351,7 +26351,7 @@ index 357ff61ca8..d504fa1bc8 100644 extern const AVFilter ff_vf_scale_vulkan; extern const AVFilter ff_vf_scale2ref; diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 1a3bef5bcb..2df39ec0f1 100644 +index 1a3bef5bcba6..2df39ec0f19f 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -52,31 +52,36 @@ @@ -27806,10 +27806,10 @@ index 1a3bef5bcb..2df39ec0f1 100644 +}; + -From 7e7147d50bc6e3f13834525dba3a47d170422f07 Mon Sep 17 00:00:00 2001 +From ce9d8c33e7d64ba11d1f1df4ee5340b63ab84c2f Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 14:54:46 +0000 -Subject: [PATCH 071/161] v4l2_m2m: Adjust buffer allocation based on min/max +Subject: [PATCH 071/186] v4l2_m2m: Adjust buffer allocation based on min/max controls Clip requested buffer count to min/max declared by driver. @@ -27821,7 +27821,7 @@ minimum which helps with flow control. 1 file changed, 19 insertions(+) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 6b97eab41e..ba36689ff3 100644 +index 6b97eab41ed7..ba36689ff3a6 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -1187,6 +1187,7 @@ fail_release: @@ -27858,10 +27858,10 @@ index 6b97eab41e..ba36689ff3 100644 if (ret < 0) goto fail_unref_hwframes; -From b69a2707a192ac509174899233a094373a3f5dc9 Mon Sep 17 00:00:00 2001 +From d67aed711e1ad85b3d4dfc3d363c0bdd3ac40001 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 15:00:12 +0000 -Subject: [PATCH 072/161] v4l2_m2m_dec: If src Q is full then wait indefinitely +Subject: [PATCH 072/186] v4l2_m2m_dec: If src Q is full then wait indefinitely for buffer If it is not possible to add another buffer to the src Q then alawys @@ -27875,7 +27875,7 @@ the current scheme confuses ffmpegs pipeline scheduling. 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 485a96f4b4..bb183097f6 100644 +index 485a96f4b487..bb183097f6f5 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -456,9 +456,9 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -27891,10 +27891,10 @@ index 485a96f4b4..bb183097f6 100644 // Dequeue frame will unref any previous contents of frame // if it returns success so we don't need an explicit unref -From b1d37be81bbf683a0eb16923c9b9f045fd0ea0c0 Mon Sep 17 00:00:00 2001 +From 04ed865af7885364c4ae7d5e790a887c2c500275 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 15:12:27 +0000 -Subject: [PATCH 073/161] vf_deinterlace_v4l2m2m: Add Q name to structure for +Subject: [PATCH 073/186] vf_deinterlace_v4l2m2m: Add Q name to structure for debug --- @@ -27902,7 +27902,7 @@ Subject: [PATCH 073/161] vf_deinterlace_v4l2m2m: Add Q name to structure for 1 file changed, 3 insertions(+) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 2df39ec0f1..4edecc02bf 100644 +index 2df39ec0f19f..4edecc02bff5 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -84,6 +84,7 @@ typedef struct V4L2Queue { @@ -27925,10 +27925,10 @@ index 2df39ec0f1..4edecc02bf 100644 ctx->field_order = V4L2_FIELD_ANY; -From 794a5bfc3ec74fdc7664508a287a075708d5deef Mon Sep 17 00:00:00 2001 +From 8194a72e9599b4beacce6676e86b08028a4c979d Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 16:08:42 +0000 -Subject: [PATCH 074/161] v4l2_m2m_enc: Set src buffer count to min+2 by +Subject: [PATCH 074/186] v4l2_m2m_enc: Set src buffer count to min+2 by default Set output.num_buffers to 0 by default which will then be set to min+2 @@ -27940,7 +27940,7 @@ creating deadlock in the ffmpeg filter chain. 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index 099ad23928..b8ba815c37 100644 +index 099ad23928d3..b8ba815c379d 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -672,9 +672,10 @@ static av_cold int v4l2_encode_close(AVCodecContext *avctx) @@ -27957,10 +27957,10 @@ index 099ad23928..b8ba815c37 100644 static const AVOption mpeg4_options[] = { V4L_M2M_CAPTURE_OPTS, -From 85c42743046a05b347f33b1933e6d52ea1d17e00 Mon Sep 17 00:00:00 2001 +From f949fe93ac776f6a2e9cec6c171a8c47c2b00c44 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 16:13:57 +0000 -Subject: [PATCH 075/161] vf_deinterlace_m2m: For deinterlace set outlink FR to +Subject: [PATCH 075/186] vf_deinterlace_m2m: For deinterlace set outlink FR to twice inlink We used to set the outlink framerate to unknown but it turns out that @@ -27971,7 +27971,7 @@ which will copy FR from inlink to outlink. 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 4edecc02bf..c52dae1c44 100644 +index 4edecc02bff5..c52dae1c44a8 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -1534,13 +1534,16 @@ static int deint_v4l2m2m_config_props(AVFilterLink *outlink) @@ -27994,10 +27994,10 @@ index 4edecc02bf..c52dae1c44 100644 if (inlink->sample_aspect_ratio.num) outlink->sample_aspect_ratio = av_mul_q((AVRational){outlink->h * inlink->w, outlink->w * inlink->h}, inlink->sample_aspect_ratio); -From 34a24bc0b0d427c75659d3907cb75afb6a9dc255 Mon Sep 17 00:00:00 2001 +From e207d1dab82d5c1684cb87ed8c957d93b3913a4e Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 23 Sep 2022 11:30:56 +0000 -Subject: [PATCH 076/161] v4l2m2m: Add ff_v4l2_dq_all to drain all buffers from +Subject: [PATCH 076/186] v4l2m2m: Add ff_v4l2_dq_all to drain all buffers from a Q Useful for where (encode) we might have drmprime buffers that we want to @@ -28008,7 +28008,7 @@ return to the source ASAP. 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index ba36689ff3..4a359bf45e 100644 +index ba36689ff3a6..4a359bf45e30 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -707,17 +707,22 @@ clean_v4l2_buffer(V4L2Buffer * const avbuf) @@ -28041,7 +28041,7 @@ index ba36689ff3..4a359bf45e 100644 for (i = 0; i < ctx->num_buffers; i++) { V4L2Buffer * const avbuf = (V4L2Buffer *)ctx->bufrefs[i]->data; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 21265f1bd7..523c53e97d 100644 +index 21265f1bd77b..523c53e97dc5 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -218,4 +218,6 @@ int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt, const @@ -28052,10 +28052,10 @@ index 21265f1bd7..523c53e97d 100644 + #endif // AVCODEC_V4L2_CONTEXT_H -From 95dfc168c74f7b0f282c1b2ad9deb8fba10a7ce5 Mon Sep 17 00:00:00 2001 +From fb8f90688761ae011e9b4cca65a51e13416a498c Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 23 Sep 2022 11:38:36 +0000 -Subject: [PATCH 077/161] v4l2_m2m_enc: DQ output more frequently +Subject: [PATCH 077/186] v4l2_m2m_enc: DQ output more frequently Ensure that we DQ any released src buffers on every op to avoid deadlock with source. @@ -28067,7 +28067,7 @@ should be integrated into dq_buf, but that is a further reaching delta. 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index b8ba815c37..a992a3cccc 100644 +index b8ba815c379d..a992a3cccc68 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -421,6 +421,8 @@ static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame) @@ -28111,17 +28111,17 @@ index b8ba815c37..a992a3cccc 100644 } -From a40b1c38b0615fce0c0d9eb97510ab9e77b3e1ac Mon Sep 17 00:00:00 2001 +From c90d17e99a8d66762c890bca316b6f52da2e6278 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:20:00 +0100 -Subject: [PATCH 078/161] conf_native: Remove --enable-rpi from all builds +Subject: [PATCH 078/186] conf_native: Remove --enable-rpi from all builds --- pi-util/conf_native.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh -index 37cea71756..f22d531ca4 100755 +index 37cea71756ae..f22d531ca448 100755 --- a/pi-util/conf_native.sh +++ b/pi-util/conf_native.sh @@ -54,9 +54,9 @@ if [ $MMAL ]; then @@ -28145,10 +28145,10 @@ index 37cea71756..f22d531ca4 100755 --enable-libdrm\ --enable-vout-egl\ -From 8fddfc8f1e3c95caded18705ed29be0ae95517bc Mon Sep 17 00:00:00 2001 +From 976ada8fe321b41bb2989b83b232b99d3c6720d1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 29 Sep 2022 19:48:08 +0000 -Subject: [PATCH 079/161] v4l2_m2m_dec: Deal correctly with avcC H264 data in +Subject: [PATCH 079/186] v4l2_m2m_dec: Deal correctly with avcC H264 data in extradata Decoders expect AnnexB style headers, mkv and similar formats have @@ -28159,7 +28159,7 @@ somewhat oddly wrapped extradata. Convert to annex-b style before use. 2 files changed, 169 insertions(+), 10 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index ee72beb052..babf101d65 100644 +index ee72beb0522b..babf101d650a 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -118,7 +118,7 @@ typedef struct V4L2m2mContext { @@ -28172,7 +28172,7 @@ index ee72beb052..babf101d65 100644 #define FF_V4L2_QUIRK_REINIT_ALWAYS 1 diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index bb183097f6..6bd9926b3f 100644 +index bb183097f6f5..6bd9926b3f31 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -46,6 +46,71 @@ @@ -28388,10 +28388,10 @@ index bb183097f6..6bd9926b3f 100644 return ret; -From 70227ebbc2999bc49075a3b683392d94618ecd89 Mon Sep 17 00:00:00 2001 +From 4c7e2544e1bb6a5517ef45b9520cf1a50a2f04c3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Sep 2022 14:20:23 +0000 -Subject: [PATCH 080/161] v4l2_request_hevc: Fix up +Subject: [PATCH 080/186] v4l2_request_hevc: Fix up V4L2_CID_CODEC_STATELESS_BASE if missing --- @@ -28399,7 +28399,7 @@ Subject: [PATCH 080/161] v4l2_request_hevc: Fix up 1 file changed, 7 insertions(+) diff --git a/libavcodec/hevc-ctrls-v4.h b/libavcodec/hevc-ctrls-v4.h -index 7829d82084..c02fdbe5a8 100644 +index 7829d8208435..c02fdbe5a8e9 100644 --- a/libavcodec/hevc-ctrls-v4.h +++ b/libavcodec/hevc-ctrls-v4.h @@ -53,6 +53,13 @@ @@ -28417,10 +28417,10 @@ index 7829d82084..c02fdbe5a8 100644 #define V4L2_CID_STATELESS_HEVC_SPS (V4L2_CID_CODEC_STATELESS_BASE + 400) -From 22d2000382839dbd04588af1bb20cc9d9b3a4362 Mon Sep 17 00:00:00 2001 +From af32492d37a1d898c05422ba405423ced65adbd7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Oct 2022 13:40:57 +0000 -Subject: [PATCH 081/161] vf_deinterlace_v4l2m2m: Fix compile on m/c without +Subject: [PATCH 081/186] vf_deinterlace_v4l2m2m: Fix compile on m/c without V4L2 SAND --- @@ -28428,7 +28428,7 @@ Subject: [PATCH 081/161] vf_deinterlace_v4l2m2m: Fix compile on m/c without 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index c52dae1c44..716789f988 100644 +index c52dae1c44a8..716789f9881c 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -35,6 +35,8 @@ @@ -28551,10 +28551,10 @@ index c52dae1c44..716789f988 100644 break; } -From f06f9ee41bf0f6f74240503f0cb427328cf6792f Mon Sep 17 00:00:00 2001 +From d13ef67d14056374de1d66962e067633a5ca1e95 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 2 Oct 2022 12:36:43 +0000 -Subject: [PATCH 082/161] configure: Fix v4l2_req_hevc_vx setup; set after deps +Subject: [PATCH 082/186] configure: Fix v4l2_req_hevc_vx setup; set after deps fixups --- @@ -28562,7 +28562,7 @@ Subject: [PATCH 082/161] configure: Fix v4l2_req_hevc_vx setup; set after deps 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/configure b/configure -index 5c00a183e3..94c8161b91 100755 +index 055944934476..c57b24bf8946 100755 --- a/configure +++ b/configure @@ -6914,12 +6914,6 @@ fi @@ -28589,10 +28589,10 @@ index 5c00a183e3..94c8161b91 100755 haiku) disable memalign -From 7d7709fb68561711f893269227147974fd6a46f3 Mon Sep 17 00:00:00 2001 +From ea9b52297f42fd55758be7944de7c5b24c77d900 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Oct 2022 12:39:45 +0000 -Subject: [PATCH 083/161] vf_deinterlace_v4l2m2m: Ensure we get consistent +Subject: [PATCH 083/186] vf_deinterlace_v4l2m2m: Ensure we get consistent final frames On getting EOS at the input of the filster do not simply drop everything @@ -28607,7 +28607,7 @@ an encode stop and wait for the last frame marker to emerge from CAPTURE 1 file changed, 148 insertions(+), 24 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 716789f988..ce875c2c61 100644 +index 716789f9881c..ce875c2c619c 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -94,6 +94,7 @@ typedef struct V4L2Buffer { @@ -28941,10 +28941,10 @@ index 716789f988..ce875c2c61 100644 ctx->logctx = NULL; // Log to NULL works, log to missing crashes pts_track_uninit(&ctx->track); -From f893891df8f4e7738b2d9b49df4386fb160eb25f Mon Sep 17 00:00:00 2001 +From 87f4f5cf8cadb5db52d474138e20dbcf53d865ed Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 5 Oct 2022 16:12:02 +0000 -Subject: [PATCH 084/161] v4l2_m2m_dec: Rework decode pending heuristic +Subject: [PATCH 084/186] v4l2_m2m_dec: Rework decode pending heuristic The old code measured the length of the entire Q in the decoder and attempted to dynamically guess an appropriate length. This was prone to @@ -28960,7 +28960,7 @@ avoids all need for reorder buffer size guesswork. 2 files changed, 34 insertions(+), 45 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index babf101d65..26a7161042 100644 +index babf101d650a..26a7161042b5 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -107,8 +107,6 @@ typedef struct V4L2m2mContext { @@ -28973,7 +28973,7 @@ index babf101d65..26a7161042 100644 pts_stats_t pts_stat; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 6bd9926b3f..bec9b22fcf 100644 +index 6bd9926b3f31..bec9b22fcf3f 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -349,41 +349,54 @@ static void @@ -29112,10 +29112,10 @@ index 6bd9926b3f..bec9b22fcf 100644 capture = &s->capture; output = &s->output; -From 7048e7e6b8621cf09b96cc7e44b8d82ba8619913 Mon Sep 17 00:00:00 2001 +From a7bdc67135c3d0e69b0f8b58bb317194bbabe105 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 21 Oct 2022 13:48:07 +0000 -Subject: [PATCH 085/161] pthread_frame: Fix MT hwaccel. Recent change broke +Subject: [PATCH 085/186] pthread_frame: Fix MT hwaccel. Recent change broke it. Revert the effects of 35aa7e70e7ec350319e7634a30d8d8aa1e6ecdda if the @@ -29125,7 +29125,7 @@ hwaccel is marked MT_SAFE. 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c -index 2cc89a41f5..b14f8e9360 100644 +index 2cc89a41f55f..b14f8e9360b5 100644 --- a/libavcodec/pthread_frame.c +++ b/libavcodec/pthread_frame.c @@ -231,7 +231,7 @@ static attribute_align_arg void *frame_worker_thread(void *arg) @@ -29219,10 +29219,10 @@ index 2cc89a41f5..b14f8e9360 100644 av_freep(&avctx->internal->thread_ctx); } -From 033056bd8ec63b16fe081446f70f41b5d5789b81 Mon Sep 17 00:00:00 2001 +From 9d2cf061d17a54ac854fb53574fa1006968cedeb Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:18:27 +0000 -Subject: [PATCH 086/161] v4l2_req: Add swfmt to init logging +Subject: [PATCH 086/186] v4l2_req: Add swfmt to init logging (cherry picked from commit dfa03b702baaf2952bcd2bbf8badcc2f9c961ddf) --- @@ -29230,7 +29230,7 @@ Subject: [PATCH 086/161] v4l2_req: Add swfmt to init logging 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index 614a1b4d99..767ecb036a 100644 +index 614a1b4d99e4..767ecb036ad2 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -26,6 +26,7 @@ @@ -29256,10 +29256,10 @@ index 614a1b4d99..767ecb036a 100644 return 0; -From 70779e742b93015e3e8aaa8f945a12d35917844d Mon Sep 17 00:00:00 2001 +From c848f442ed183086c17ca83a9401f33e6b36ce80 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:39:54 +0000 -Subject: [PATCH 087/161] v4l2_m2m: Avoid polling on a queue that is streamoff +Subject: [PATCH 087/186] v4l2_m2m: Avoid polling on a queue that is streamoff (cherry picked from commit b2658bc56d3034a17db7f39597fc7d71bfe9a43b) --- @@ -29267,7 +29267,7 @@ Subject: [PATCH 087/161] v4l2_m2m: Avoid polling on a queue that is streamoff 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 4a359bf45e..b296dc111c 100644 +index 4a359bf45e30..b296dc111c1c 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -578,6 +578,11 @@ get_event(V4L2m2mContext * const m) @@ -29301,10 +29301,10 @@ index 4a359bf45e..b296dc111c 100644 return AVERROR(ENOSPC); } -From 438fed3702eb689f836c885ebbd813e48d4d4c4a Mon Sep 17 00:00:00 2001 +From 3e501d4ca4266ef8ffbf19808c42ccb3e40d6392 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:07:04 +0000 -Subject: [PATCH 088/161] v4l2_m2m: Add function to get number of queued +Subject: [PATCH 088/186] v4l2_m2m: Add function to get number of queued buffers (cherry picked from commit f9ac6485c00b4531dcff354222aef450b29728f4) @@ -29313,7 +29313,7 @@ Subject: [PATCH 088/161] v4l2_m2m: Add function to get number of queued 1 file changed, 11 insertions(+) diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 523c53e97d..8e4f681643 100644 +index 523c53e97dc5..8e4f68164351 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -220,4 +220,15 @@ int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* f); @@ -29333,10 +29333,10 @@ index 523c53e97d..8e4f681643 100644 + #endif // AVCODEC_V4L2_CONTEXT_H -From 95ff4a65ed4c88ea7e02ee55e260e37a0ce2ba88 Mon Sep 17 00:00:00 2001 +From c0eac42165afdf7a7efad03bd140506263948940 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:48:20 +0000 -Subject: [PATCH 089/161] v4l2_m2m: Add timeouts to dq_all and dequeue_packet +Subject: [PATCH 089/186] v4l2_m2m: Add timeouts to dq_all and dequeue_packet Add timeouts and use them to have better flow control in encode @@ -29348,7 +29348,7 @@ Add timeouts and use them to have better flow control in encode 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index b296dc111c..7031f3d340 100644 +index b296dc111c1c..7031f3d3409d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -712,13 +712,19 @@ clean_v4l2_buffer(V4L2Buffer * const avbuf) @@ -29401,7 +29401,7 @@ index b296dc111c..7031f3d340 100644 if ((rv = ff_v4l2_buffer_buf_to_avpkt(pkt, avbuf)) != 0) return rv; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 8e4f681643..5afed3e6ec 100644 +index 8e4f68164351..5afed3e6ecb4 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -179,7 +179,7 @@ int ff_v4l2_context_set_status(V4L2Context* ctx, uint32_t cmd); @@ -29434,7 +29434,7 @@ index 8e4f681643..5afed3e6ec 100644 /** * Returns the number of buffers currently queued diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index a992a3cccc..d0d27e5bc2 100644 +index a992a3cccc68..d0d27e5bc2f4 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -420,16 +420,24 @@ static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame) @@ -29502,10 +29502,10 @@ index a992a3cccc..d0d27e5bc2 100644 return ret; } -From e6654c1997a6f4dfd43b0f74b0168f5d644c1c74 Mon Sep 17 00:00:00 2001 +From f09618a055068582ebe7f6e704212b04f8d00bc7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:23:32 +0000 -Subject: [PATCH 090/161] v4l2_m2m_enc: Improve debug trace +Subject: [PATCH 090/186] v4l2_m2m_enc: Improve debug trace (cherry picked from commit 113e89daffb329a0cd3d920abd483a4025664bf5) --- @@ -29513,7 +29513,7 @@ Subject: [PATCH 090/161] v4l2_m2m_enc: Improve debug trace 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index d0d27e5bc2..c8c2de3d47 100644 +index d0d27e5bc2f4..c8c2de3d4706 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -427,6 +427,7 @@ static int v4l2_send_frame(AVCodecContext *avctx, const AVFrame *frame) @@ -29562,10 +29562,10 @@ index d0d27e5bc2..c8c2de3d47 100644 av_packet_unref(avpkt); return ret; -From 02dca2b845125af7ec6dfb68bdc34726a45fee9c Mon Sep 17 00:00:00 2001 +From 739483231401288794ff9e4acc253ef1129436cf Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:22:36 +0000 -Subject: [PATCH 091/161] v4l2_m2m_enc: Copy dest packets to memory if short of +Subject: [PATCH 091/186] v4l2_m2m_enc: Copy dest packets to memory if short of v4l2 buffers (cherry picked from commit aa4ebbda400b42db952fc713b26927fc8636b0e5) @@ -29574,7 +29574,7 @@ Subject: [PATCH 091/161] v4l2_m2m_enc: Copy dest packets to memory if short of 1 file changed, 16 insertions(+) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index c8c2de3d47..c23187e6e6 100644 +index c8c2de3d4706..c23187e6e67a 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -621,6 +621,22 @@ dequeue: @@ -29601,10 +29601,10 @@ index c8c2de3d47..c23187e6e6 100644 capture->first_buf = 0; return 0; -From ced9a7d442a04be08fc23e0af310312299a5d5a0 Mon Sep 17 00:00:00 2001 +From 680669b95cae532061fef61d972fb3c9c2b92d67 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 11:00:16 +0000 -Subject: [PATCH 092/161] v4l2_m2m_dec: Fix pts_best_effort guessing for +Subject: [PATCH 092/186] v4l2_m2m_dec: Fix pts_best_effort guessing for initial pts (cherry picked from commit 1af32e5c87586a0f7e76cdf19a012ddbcf3eac67) @@ -29613,7 +29613,7 @@ Subject: [PATCH 092/161] v4l2_m2m_dec: Fix pts_best_effort guessing for 1 file changed, 2 insertions(+) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index bec9b22fcf..47b2735f82 100644 +index bec9b22fcf3f..47b2735f8252 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -113,6 +113,8 @@ log_dump(void * logctx, int lvl, const void * const data, const size_t len) @@ -29626,10 +29626,10 @@ index bec9b22fcf..47b2735f82 100644 stats->last_interval == 0 || stats->last_count >= STATS_LAST_COUNT_MAX) -From 3e3cf6ed7280d8ad4f3eed17a6d18c2df3c0cd31 Mon Sep 17 00:00:00 2001 +From 3da063bb46e1d4ed5804d97230d74762076e1b13 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:47:04 +0000 -Subject: [PATCH 093/161] v4l2_m2m_enc: Wait for frame or space in src Q in +Subject: [PATCH 093/186] v4l2_m2m_enc: Wait for frame or space in src Q in rx_pkt If receive_packet we should ensure that there is space in the source Q @@ -29642,7 +29642,7 @@ the source Q is currently full. 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c -index c23187e6e6..524e9424a5 100644 +index c23187e6e67a..524e9424a5e8 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -415,13 +415,17 @@ static int fmt_eq(const struct v4l2_format * const a, const struct v4l2_format * @@ -29688,10 +29688,10 @@ index c23187e6e6..524e9424a5 100644 return (s->draining && ret == AVERROR(EAGAIN)) ? AVERROR_EOF : ret; -From de9ec2bf6421b199aad9ea9dc7896a46c8813d94 Mon Sep 17 00:00:00 2001 +From 90a2740b29653aaddb67b309899f50475b76c330 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:54:29 +0000 -Subject: [PATCH 094/161] vf_deinterlace_v4l2m2m: Print dts rather that NOPTS +Subject: [PATCH 094/186] vf_deinterlace_v4l2m2m: Print dts rather that NOPTS in trace (cherry picked from commit e9b468f35f0c6ad9bfe96f5a05e449afa8ae074a) @@ -29700,7 +29700,7 @@ Subject: [PATCH 094/161] vf_deinterlace_v4l2m2m: Print dts rather that NOPTS 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index ce875c2c61..7c6751b69c 100644 +index ce875c2c619c..7c6751b69c65 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -1668,8 +1668,8 @@ static int deint_v4l2m2m_filter_frame(AVFilterLink *link, AVFrame *in) @@ -29715,10 +29715,10 @@ index ce875c2c61..7c6751b69c 100644 avctx->inputs[0]->status_in, avctx->inputs[0]->status_out, avctx->outputs[0]->status_in, avctx->outputs[0]->status_out); -From d71a0a173240e18d518ae0b921ac43849524bd66 Mon Sep 17 00:00:00 2001 +From 56e2c1564e5288ad8642bb4e1954505586566765 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:55:21 +0000 -Subject: [PATCH 095/161] vf_deinterlace_v4l2m2m: Ignore "wanted" when +Subject: [PATCH 095/186] vf_deinterlace_v4l2m2m: Ignore "wanted" when processing input If we gate send a frame to the outlink on its frame_wanted flag then we @@ -29732,7 +29732,7 @@ much better. 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c -index 7c6751b69c..a173a291f8 100644 +index 7c6751b69c65..a173a291f837 100644 --- a/libavfilter/vf_deinterlace_v4l2m2m.c +++ b/libavfilter/vf_deinterlace_v4l2m2m.c @@ -1812,10 +1812,7 @@ static int deint_v4l2m2m_activate(AVFilterContext *avctx) @@ -29748,10 +29748,10 @@ index 7c6751b69c..a173a291f8 100644 AVFrame * frame = av_frame_alloc(); int rv; -From 842e0a00288f9a2a862720990791b8eca9546955 Mon Sep 17 00:00:00 2001 +From ec50574d7b8ae1188e3d1f4f526e09a827485052 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 15:00:43 +0000 -Subject: [PATCH 096/161] conf_native: Add --enable-gpl +Subject: [PATCH 096/186] conf_native: Add --enable-gpl (cherry picked from commit bab9bf4a2e39391940d88af2ce5d70236ac21f15) --- @@ -29759,7 +29759,7 @@ Subject: [PATCH 096/161] conf_native: Add --enable-gpl 1 file changed, 1 insertion(+) diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh -index f22d531ca4..082d9b5832 100755 +index f22d531ca448..082d9b58320e 100755 --- a/pi-util/conf_native.sh +++ b/pi-util/conf_native.sh @@ -94,6 +94,7 @@ $FFSRC/configure \ @@ -29771,10 +29771,10 @@ index f22d531ca4..082d9b5832 100755 $RPIOPTS\ --extra-cflags="-ggdb $RPI_KEEPS $RPI_DEFINES $RPI_INCLUDES"\ -From bf9aaf30818308a4651e00a2a64a0f65dc9a36e5 Mon Sep 17 00:00:00 2001 +From 491ca2cc58d75d0fe16ba6be000e92c47219e7f2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 15 Nov 2022 13:33:00 +0000 -Subject: [PATCH 097/161] egl_vout: Make formatting consistent - no code +Subject: [PATCH 097/186] egl_vout: Make formatting consistent - no code changes --- @@ -29782,7 +29782,7 @@ Subject: [PATCH 097/161] egl_vout: Make formatting consistent - no code 1 file changed, 369 insertions(+), 372 deletions(-) diff --git a/libavdevice/egl_vout.c b/libavdevice/egl_vout.c -index 7b9c610ace..a52cabb082 100644 +index 7b9c610ace28..a52cabb082e9 100644 --- a/libavdevice/egl_vout.c +++ b/libavdevice/egl_vout.c @@ -48,20 +48,20 @@ @@ -30755,17 +30755,17 @@ index 7b9c610ace..a52cabb082 100644 }; -From 4d3a3973a07994b0a6ec35626e514fc40f439fe3 Mon Sep 17 00:00:00 2001 +From a132ef51a831edfa36f52ba699922fdb06acd1b0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 16:49:43 +0000 -Subject: [PATCH 098/161] v4l2m2m: reporganise get_raw_format for loop logic +Subject: [PATCH 098/186] v4l2m2m: reporganise get_raw_format for loop logic --- libavcodec/v4l2_context.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 7031f3d340..79a31cf930 100644 +index 7031f3d3409d..79a31cf9300b 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -828,28 +828,22 @@ static int v4l2_get_raw_format(V4L2Context* ctx, enum AVPixelFormat *p) @@ -30803,10 +30803,10 @@ index 7031f3d340..79a31cf930 100644 return AVERROR(EINVAL); -From 123c5ef429ec6bd7d1875d621df88bb2ad7af0bd Mon Sep 17 00:00:00 2001 +From 0189b1c3bb002b0385a419f4140371ea1ac4153c Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:49:12 +0000 -Subject: [PATCH 099/161] drm_vout: Set zpos on the plane we pick to ensure it +Subject: [PATCH 099/186] drm_vout: Set zpos on the plane we pick to ensure it is at the front --- @@ -30814,7 +30814,7 @@ Subject: [PATCH 099/161] drm_vout: Set zpos on the plane we pick to ensure it 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c -index cfb33ce7c3..9bd9e04421 100644 +index cfb33ce7c319..9bd9e04421d7 100644 --- a/libavdevice/drm_vout.c +++ b/libavdevice/drm_vout.c @@ -115,9 +115,11 @@ static int find_plane(struct AVFormatContext * const avctx, @@ -30873,10 +30873,10 @@ index cfb33ce7c3..9bd9e04421 100644 static void da_uninit(drm_display_env_t * const de, drm_aux_t * da) -From 0ee1c3b41774d05595376f8d25de2a901dbb12c7 Mon Sep 17 00:00:00 2001 +From 386acb23dd6196fac68a39fa945a5b6b9c18c6a8 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:51:46 +0000 -Subject: [PATCH 100/161] drm_vout: Only set modifier flag and pass modifiers +Subject: [PATCH 100/186] drm_vout: Only set modifier flag and pass modifiers if there are some --- @@ -30884,7 +30884,7 @@ Subject: [PATCH 100/161] drm_vout: Only set modifier flag and pass modifiers 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c -index 9bd9e04421..a56adea866 100644 +index 9bd9e04421d7..a56adea86625 100644 --- a/libavdevice/drm_vout.c +++ b/libavdevice/drm_vout.c @@ -34,6 +34,7 @@ @@ -30933,17 +30933,17 @@ index 9bd9e04421..a56adea866 100644 return -1; } -From 4534e6981c1718eaeec4c5f58cdf5592ee7f0329 Mon Sep 17 00:00:00 2001 +From 66cc08dbaec01e45af9c09a06829fcb2db58e30c Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:52:58 +0000 -Subject: [PATCH 101/161] drm_vout: Fix typo in error message +Subject: [PATCH 101/186] drm_vout: Fix typo in error message --- libavdevice/drm_vout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c -index a56adea866..351abf1d60 100644 +index a56adea86625..351abf1d60aa 100644 --- a/libavdevice/drm_vout.c +++ b/libavdevice/drm_vout.c @@ -596,7 +596,7 @@ static int drm_vout_init(struct AVFormatContext * s) @@ -30956,17 +30956,17 @@ index a56adea866..351abf1d60 100644 } -From 0469d1fb132a0d55593611c56e83733efe58045b Mon Sep 17 00:00:00 2001 +From e11c24968da620816853eb0a7d33cb3e9488afb1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 18:00:41 +0000 -Subject: [PATCH 102/161] drm_vout: Add option to name the drm_module to use +Subject: [PATCH 102/186] drm_vout: Add option to name the drm_module to use --- libavdevice/drm_vout.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c -index 351abf1d60..491e1dc608 100644 +index 351abf1d60aa..491e1dc60861 100644 --- a/libavdevice/drm_vout.c +++ b/libavdevice/drm_vout.c @@ -70,7 +70,9 @@ typedef struct drm_display_env_s @@ -31009,17 +31009,17 @@ index 351abf1d60..491e1dc608 100644 }; -From 61cb9fc3ce06e0ecaeeec3add143bc3a82956853 Mon Sep 17 00:00:00 2001 +From 397c9473723e936b86ff26fc5c0d5ba381874be3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 13:01:00 +0000 -Subject: [PATCH 103/161] dmabufs: Rework to allow for non-CMA backends +Subject: [PATCH 103/186] dmabufs: Rework to allow for non-CMA backends --- libavcodec/v4l2_req_dmabufs.c | 161 ++++++++++++++++++++++++---------- 1 file changed, 116 insertions(+), 45 deletions(-) diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c -index c4bbed18c6..1c3a5e861f 100644 +index c4bbed18c680..1c3a5e861f0c 100644 --- a/libavcodec/v4l2_req_dmabufs.c +++ b/libavcodec/v4l2_req_dmabufs.c @@ -1,3 +1,4 @@ @@ -31263,10 +31263,10 @@ index c4bbed18c6..1c3a5e861f 100644 +} -From 288807720443bbddf4c83c3589d1877c7fd418c3 Mon Sep 17 00:00:00 2001 +From c788ac962a1a4221d3fe9ab2b0d19ebf43964519 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 13:07:58 +0000 -Subject: [PATCH 104/161] dmabufs: Use unref rather than deleet on cmabufs_ctl +Subject: [PATCH 104/186] dmabufs: Use unref rather than deleet on cmabufs_ctl --- libavcodec/v4l2_req_dmabufs.c | 12 +++++++++++- @@ -31275,7 +31275,7 @@ Subject: [PATCH 104/161] dmabufs: Use unref rather than deleet on cmabufs_ctl 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c -index 1c3a5e861f..acc0366e76 100644 +index 1c3a5e861f0c..acc0366e7630 100644 --- a/libavcodec/v4l2_req_dmabufs.c +++ b/libavcodec/v4l2_req_dmabufs.c @@ -31,6 +31,7 @@ struct dmabuf_fns { @@ -31315,7 +31315,7 @@ index 1c3a5e861f..acc0366e76 100644 // // Alloc dmabuf via CMA diff --git a/libavcodec/v4l2_req_dmabufs.h b/libavcodec/v4l2_req_dmabufs.h -index c1d3d8c8d7..381ba2708d 100644 +index c1d3d8c8d751..381ba2708da6 100644 --- a/libavcodec/v4l2_req_dmabufs.h +++ b/libavcodec/v4l2_req_dmabufs.h @@ -7,7 +7,8 @@ struct dmabufs_ctl; @@ -31329,7 +31329,7 @@ index c1d3d8c8d7..381ba2708d 100644 // Need not preserve old contents // On NULL return old buffer is freed diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c -index 767ecb036a..db7ed13b6d 100644 +index 767ecb036ad2..db7ed13b6d76 100644 --- a/libavcodec/v4l2_request_hevc.c +++ b/libavcodec/v4l2_request_hevc.c @@ -105,7 +105,7 @@ static int v4l2_request_hevc_uninit(AVCodecContext *avctx) @@ -31351,17 +31351,17 @@ index 767ecb036a..db7ed13b6d 100644 devscan_delete(&ctx->devscan); return ret; -From 9115f40c5f55873102312085f2e328d1a2101ae4 Mon Sep 17 00:00:00 2001 +From 95d64bce0aaeb0f2e1b2bcd15e8345349efe295b Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 14:21:40 +0000 -Subject: [PATCH 105/161] egl_vout: Remove redundant & completely broken debug +Subject: [PATCH 105/186] egl_vout: Remove redundant & completely broken debug --- libavdevice/egl_vout.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/libavdevice/egl_vout.c b/libavdevice/egl_vout.c -index a52cabb082..afc7afd13e 100644 +index a52cabb082e9..afc7afd13ea0 100644 --- a/libavdevice/egl_vout.c +++ b/libavdevice/egl_vout.c @@ -515,31 +515,6 @@ static int do_display(AVFormatContext *const s, egl_display_env_t *const de, AVF @@ -31397,10 +31397,10 @@ index a52cabb082..afc7afd13e 100644 glClearColor(0.5, 0.5, 0.5, 0.5); -From 34711d5a1429213b6f4cf8ad163e8e8d108626e7 Mon Sep 17 00:00:00 2001 +From b79c28a0644c4d8b83c616dab6005ca862ec99df Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 16:12:12 +0000 -Subject: [PATCH 106/161] v4l2m2m: Use offset from querybuf rather than always +Subject: [PATCH 106/186] v4l2m2m: Use offset from querybuf rather than always 0 --- @@ -31409,7 +31409,7 @@ Subject: [PATCH 106/161] v4l2m2m: Use offset from querybuf rather than always 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 9ef2f40e39..5ca58ea593 100644 +index 9ef2f40e3991..5ca58ea5935b 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -379,7 +379,7 @@ static uint8_t * v4l2_get_drm_frame(V4L2Buffer *avbuf) @@ -31438,7 +31438,7 @@ index 9ef2f40e39..5ca58ea593 100644 if (want_mmap) avbuf->plane_info[i].mm_addr = mmap(NULL, avbuf->buf.length, diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index 1ac32c5989..d91d5d1dd0 100644 +index 1ac32c5989f1..d91d5d1dd07b 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -66,7 +66,8 @@ typedef struct V4L2Buffer { @@ -31452,10 +31452,10 @@ index 1ac32c5989..d91d5d1dd0 100644 size_t length; } plane_info[VIDEO_MAX_PLANES]; -From 15458be3fe79c14f4fdcc2ad786508d1b647c914 Mon Sep 17 00:00:00 2001 +From 920d901527cbe17accc42659db548229318ac855 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 17:57:27 +0000 -Subject: [PATCH 107/161] v4l2m2m: Fix crash if init errors out before setting +Subject: [PATCH 107/186] v4l2m2m: Fix crash if init errors out before setting avctx --- @@ -31463,7 +31463,7 @@ Subject: [PATCH 107/161] v4l2m2m: Fix crash if init errors out before setting 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 1e30d15fd8..ac6bae0dc3 100644 +index 1e30d15fd866..ac6bae0dc327 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -278,7 +278,7 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) @@ -31476,17 +31476,17 @@ index 1e30d15fd8..ac6bae0dc3 100644 if (s->fd >= 0) { -From 9f7f94c680b8aaedede9b3bcad37b645216cfcff Mon Sep 17 00:00:00 2001 +From c339fbc23b3d0698e29301d7740cba39c9993fbc Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 18:10:30 +0000 -Subject: [PATCH 108/161] v4l2_buffers: Add and use ctx_to_m2mctx + error debug +Subject: [PATCH 108/186] v4l2_buffers: Add and use ctx_to_m2mctx + error debug --- libavcodec/v4l2_buffers.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index 5ca58ea593..e28ef2d1e8 100644 +index 5ca58ea5935b..e28ef2d1e802 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -41,11 +41,16 @@ @@ -31543,10 +31543,10 @@ index 5ca58ea593..e28ef2d1e8 100644 } -From 6b8bb2c41828351cd3a6f40be353696ae36450b7 Mon Sep 17 00:00:00 2001 +From 5959f5fb7ef1d1cab901393035e7a6ac31d0d78b Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 18:53:22 +0000 -Subject: [PATCH 109/161] v4l2m2m: Add ability to use cma alloced dmabufs as +Subject: [PATCH 109/186] v4l2m2m: Add ability to use cma alloced dmabufs as well as v4l2 mmap --- @@ -31559,7 +31559,7 @@ Subject: [PATCH 109/161] v4l2m2m: Add ability to use cma alloced dmabufs as 6 files changed, 71 insertions(+), 24 deletions(-) diff --git a/libavcodec/Makefile b/libavcodec/Makefile -index 11f183c9b9..8b1d669834 100644 +index 11f183c9b9ba..8b1d66983423 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -170,7 +170,7 @@ OBJS-$(CONFIG_VP3DSP) += vp3dsp.o @@ -31572,7 +31572,7 @@ index 11f183c9b9..8b1d669834 100644 v4l2_req_devscan.o weak_link.o OBJS-$(CONFIG_WMA_FREQS) += wma_freqs.o diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c -index e28ef2d1e8..8d80d19788 100644 +index e28ef2d1e802..8d80d1978830 100644 --- a/libavcodec/v4l2_buffers.c +++ b/libavcodec/v4l2_buffers.c @@ -36,6 +36,7 @@ @@ -31670,7 +31670,7 @@ index e28ef2d1e8..8d80d19788 100644 av_buffer_unref(&avbuf->ref_buf); diff --git a/libavcodec/v4l2_buffers.h b/libavcodec/v4l2_buffers.h -index d91d5d1dd0..444ad94b14 100644 +index d91d5d1dd07b..444ad94b145e 100644 --- a/libavcodec/v4l2_buffers.h +++ b/libavcodec/v4l2_buffers.h @@ -46,6 +46,7 @@ enum V4L2Buffer_status { @@ -31690,7 +31690,7 @@ index d91d5d1dd0..444ad94b14 100644 /** diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index ac6bae0dc3..f802687b1b 100644 +index ac6bae0dc327..f802687b1bb2 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -34,6 +34,7 @@ @@ -31734,7 +31734,7 @@ index ac6bae0dc3..f802687b1b 100644 s->fd = -1; diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 26a7161042..0f41f94694 100644 +index 26a7161042b5..0f41f94694d3 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -71,6 +71,8 @@ typedef struct xlat_track_s { @@ -31763,7 +31763,7 @@ index 26a7161042..0f41f94694 100644 } V4L2m2mPriv; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 47b2735f82..4d17057298 100644 +index 47b2735f8252..4d170572980e 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -41,6 +41,7 @@ @@ -31804,10 +31804,10 @@ index 47b2735f82..4d17057298 100644 }; -From 499bcdc4ed82c737ceab166a07b46e8ed8ccbc88 Mon Sep 17 00:00:00 2001 +From 778d48c8652016879f09d7ac4aff7592f9ea9d13 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 19:05:47 +0000 -Subject: [PATCH 110/161] testfilt: Skeleton of hw filter test code +Subject: [PATCH 110/186] testfilt: Skeleton of hw filter test code --- pi-util/testfilt.py | 83 +++++++++++++++++++++++++++++++++++++++++++++ @@ -31816,7 +31816,7 @@ Subject: [PATCH 110/161] testfilt: Skeleton of hw filter test code diff --git a/pi-util/testfilt.py b/pi-util/testfilt.py new file mode 100755 -index 0000000000..b322dac0c2 +index 000000000000..b322dac0c22d --- /dev/null +++ b/pi-util/testfilt.py @@ -0,0 +1,83 @@ @@ -31904,10 +31904,10 @@ index 0000000000..b322dac0c2 + "-c:v", "h264_v4l2m2m", "-b:v", "2M"], ".mkv", + [valid_regex(r'Output stream #0:0 \(video\): 900 frames encoded; 900 packets muxed')]) -From 50ac318a472fd98e1e58605316ea6a2e8cde0a04 Mon Sep 17 00:00:00 2001 +From 2ac054adfa1e9ebece8a9594ac37b61ccff7e440 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 5 Jan 2023 14:39:30 +0000 -Subject: [PATCH 111/161] pixfmt: Add a #define to indicate presence of SAND +Subject: [PATCH 111/186] pixfmt: Add a #define to indicate presence of SAND formats --- @@ -31915,7 +31915,7 @@ Subject: [PATCH 111/161] pixfmt: Add a #define to indicate presence of SAND 1 file changed, 2 insertions(+) diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h -index 22f70007c3..5cc780e7d5 100644 +index 22f70007c3df..5cc780e7d56c 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -378,6 +378,8 @@ enum AVPixelFormat { @@ -31928,17 +31928,17 @@ index 22f70007c3..5cc780e7d5 100644 AV_PIX_FMT_SAND64_10, ///< 4:2:0 10-bit 64x*Y stripe, 32x*UV stripe, then next x stripe, mysterious padding AV_PIX_FMT_SAND64_16, ///< 4:2:0 16-bit 64x*Y stripe, 32x*UV stripe, then next x stripe, mysterious padding -From 23a3132e094d449ea05657704c0cffc3f0762c28 Mon Sep 17 00:00:00 2001 +From 426d93c7bd910d9222a5cbeb011ede5d9890dcbf Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 11 Jan 2023 16:30:37 +0000 -Subject: [PATCH 112/161] v4l2_m2m_dec: Fix initial pkt send if no extradata +Subject: [PATCH 112/186] v4l2_m2m_dec: Fix initial pkt send if no extradata --- libavcodec/v4l2_m2m_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 4d17057298..9daf05adfe 100644 +index 4d170572980e..9daf05adfe74 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -240,7 +240,7 @@ copy_extradata(AVCodecContext * const avctx, @@ -31960,10 +31960,10 @@ index 4d17057298..9daf05adfe 100644 if (ret == AVERROR(EAGAIN)) { -From f4f6b9f1af137153e574c704804033e83f2ed1a8 Mon Sep 17 00:00:00 2001 +From da6cd7985ffa515607e68116aa923fda23a40beb Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 16 Jan 2023 16:05:09 +0000 -Subject: [PATCH 113/161] v4l2m2m_dec: Make capture timeout long once pending +Subject: [PATCH 113/186] v4l2m2m_dec: Make capture timeout long once pending count > 31 For some applications (ffmpeg command line) the current heuristic of adding @@ -31982,7 +31982,7 @@ number should reduce the unexpected consequences. 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index 0f41f94694..ded1478a49 100644 +index 0f41f94694d3..ded1478a49da 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -66,7 +66,7 @@ typedef struct pts_stats_s @@ -32003,7 +32003,7 @@ index 0f41f94694..ded1478a49 100644 /* Reference to a frame. Only used during encoding */ diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 9daf05adfe..c8ab883d7e 100644 +index 9daf05adfe74..c8ab883d7ef2 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -582,7 +582,7 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -32057,10 +32057,10 @@ index 9daf05adfe..c8ab883d7e 100644 output->done = 0; capture->done = 0; -From 39f49cdaefa4483914f703c3f352c8894b3b81fd Mon Sep 17 00:00:00 2001 +From 58854764f365ac020b2d353f1db6b4d7ffa099a4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 6 Feb 2023 19:23:16 +0000 -Subject: [PATCH 114/161] Initial buffersink alloc callback code +Subject: [PATCH 114/186] Initial buffersink alloc callback code (cherry picked from commit dde8d3c8f3cc279b9b92ed4f10a2e3990f4aadeb) --- @@ -32069,7 +32069,7 @@ Subject: [PATCH 114/161] Initial buffersink alloc callback code 2 files changed, 47 insertions(+) diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c -index 306c283f77..d3c82aabf3 100644 +index 9ab83696ce1b..837579946d65 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -62,6 +62,11 @@ typedef struct BufferSinkContext { @@ -32138,7 +32138,7 @@ index 306c283f77..d3c82aabf3 100644 }; diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h -index 64e08de53e..09737d322f 100644 +index 64e08de53ee5..09737d322fb7 100644 --- a/libavfilter/buffersink.h +++ b/libavfilter/buffersink.h @@ -166,6 +166,9 @@ int av_buffersink_get_frame(AVFilterContext *ctx, AVFrame *frame); @@ -32152,10 +32152,10 @@ index 64e08de53e..09737d322f 100644 * @} */ -From a63ae21e74ae48f1aedac53c18142b7596d041ad Mon Sep 17 00:00:00 2001 +From d6e844180b9f50a33b837ec5cc897d5387edf2be Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 30 Jan 2023 17:23:12 +0000 -Subject: [PATCH 115/161] v4l2_m2m_dec: Add a profile check +Subject: [PATCH 115/186] v4l2_m2m_dec: Add a profile check Check the profile in avctx aginst what the v4l2 driver advertises. If the driver doesn't support the check then just accept anything. @@ -32166,7 +32166,7 @@ the driver doesn't support the check then just accept anything. 1 file changed, 125 insertions(+) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index c8ab883d7e..098adf4821 100644 +index c8ab883d7ef2..098adf4821eb 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -715,6 +715,127 @@ static int v4l2_receive_frame(AVCodecContext *avctx, AVFrame *frame) @@ -32309,10 +32309,10 @@ index c8ab883d7e..098adf4821 100644 } -From f734a6ead04a8381fccfae53066866a02a9516d2 Mon Sep 17 00:00:00 2001 +From d0992e458d9017cbb0383961b92589a015337aa3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 1 Feb 2023 17:24:39 +0000 -Subject: [PATCH 116/161] v4l2_m2m_dec: Add extradata parse for h264 & hevc +Subject: [PATCH 116/186] v4l2_m2m_dec: Add extradata parse for h264 & hevc If we have extradata we can extract profile & level and potentailly other useful info from it. Use the codec parser to get it if the decoder @@ -32324,7 +32324,7 @@ is configured. 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 098adf4821..e64bc707d3 100644 +index 098adf4821eb..e64bc707d3c6 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -21,6 +21,8 @@ @@ -32440,10 +32440,10 @@ index 098adf4821..e64bc707d3 100644 if (ret < 0) return ret; -From e28421e397743a94f5e37327ad234f59b6ae613d Mon Sep 17 00:00:00 2001 +From 7753c3a64821de5104f46068e9753d7ac86b8a5d Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 20 Mar 2023 18:12:51 +0000 -Subject: [PATCH 117/161] clean_usr_libs: Now wipes the include files too +Subject: [PATCH 117/186] clean_usr_libs: Now wipes the include files too When swapping ffmpeg versions obsolete makefiles could confuse configure utilities. @@ -32452,7 +32452,7 @@ configure utilities. 1 file changed, 16 insertions(+) diff --git a/pi-util/clean_usr_libs.sh b/pi-util/clean_usr_libs.sh -index b3b2d5509d..01bd6a6a22 100755 +index b3b2d5509de0..01bd6a6a2254 100755 --- a/pi-util/clean_usr_libs.sh +++ b/pi-util/clean_usr_libs.sh @@ -1,4 +1,20 @@ @@ -32477,10 +32477,10 @@ index b3b2d5509d..01bd6a6a22 100755 rm -f $U/libavcodec.* rm -f $U/libavdevice.* -From dcabd30310b88b45359609bac27d5d0f9bbc6dc1 Mon Sep 17 00:00:00 2001 +From 4116d51b48e57cfbe9a7986d38aa6818cb65bfbb Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 20 Mar 2023 18:15:08 +0000 -Subject: [PATCH 118/161] vulkan: Add missing decode extension defines +Subject: [PATCH 118/186] vulkan: Add missing decode extension defines When building on bookworm the video decode extension names were missing. This adds them. I expect this patch will be @@ -32490,7 +32490,7 @@ obsolete shortly but it solves a current problem. 1 file changed, 8 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c -index 2a9b5f4aac..11e7945f18 100644 +index ffd4f5dec4ec..d59f9409dd7c 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -57,6 +57,14 @@ @@ -32509,10 +32509,10 @@ index 2a9b5f4aac..11e7945f18 100644 VkFence fence; VkQueue queue; -From 0231c208843a5badc799590eb5b9de907d1c26b2 Mon Sep 17 00:00:00 2001 +From cebdcff3a25a64706c9a863e543260923c823237 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 21 Mar 2023 14:20:05 +0000 -Subject: [PATCH 119/161] v4l2_m2m_dec: Fix config file for finding if decoder +Subject: [PATCH 119/186] v4l2_m2m_dec: Fix config file for finding if decoder enabled Fixes parsing of extradata for profile testing. 5.x changed where that @@ -32522,7 +32522,7 @@ info is defined. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index e64bc707d3..91136f03da 100644 +index e64bc707d3c6..91136f03da80 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -21,7 +21,7 @@ @@ -32535,10 +32535,10 @@ index e64bc707d3..91136f03da 100644 #include #include -From 822baefed69372b3380144ab44226e2c6ad3e298 Mon Sep 17 00:00:00 2001 +From d091812c90f3fc6bca97e6efbb1fd30ebc112043 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 21 Mar 2023 14:23:20 +0000 -Subject: [PATCH 120/161] v4l2_m2m_dec: Display profile given if skipped in +Subject: [PATCH 120/186] v4l2_m2m_dec: Display profile given if skipped in debug --- @@ -32546,7 +32546,7 @@ Subject: [PATCH 120/161] v4l2_m2m_dec: Display profile given if skipped in 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 91136f03da..d124c7b1fc 100644 +index 91136f03da80..d124c7b1fc43 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -792,7 +792,7 @@ check_profile(AVCodecContext *const avctx, V4L2m2mContext *const s) @@ -32559,10 +32559,10 @@ index 91136f03da..d124c7b1fc 100644 } -From 6859fc2a8791c0fcc25851b77fed15a691ceb332 Mon Sep 17 00:00:00 2001 +From cbc083d57efdadef70b0b218cc252b24ed501596 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 22 Mar 2023 16:08:08 +0000 -Subject: [PATCH 121/161] conf_native: Fix for 64-bit kernel with 32-bit +Subject: [PATCH 121/186] conf_native: Fix for 64-bit kernel with 32-bit userspace (cherry picked from commit 5bb1e09cea95b4215c6904b9b1a726e83bc5d327) @@ -32571,7 +32571,7 @@ Subject: [PATCH 121/161] conf_native: Fix for 64-bit kernel with 32-bit 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh -index 082d9b5832..0a7d230f1b 100755 +index 082d9b58320e..0a7d230f1b70 100755 --- a/pi-util/conf_native.sh +++ b/pi-util/conf_native.sh @@ -33,18 +33,28 @@ RPI_LIBDIRS= @@ -32615,10 +32615,10 @@ index 082d9b5832..0a7d230f1b 100755 fi -From c35f074854a922c0c025159ddddd1abfc562a3d2 Mon Sep 17 00:00:00 2001 +From 17d3d7a9750f8cb7954d0f396ea68eb408411c7e Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:48:25 +0000 -Subject: [PATCH 122/161] conf_native: Add install prefix variation +Subject: [PATCH 122/186] conf_native: Add install prefix variation (cherry picked from commit 73c3019b534cb8f4b4e4c21995653f6ce440086d) --- @@ -32627,7 +32627,7 @@ Subject: [PATCH 122/161] conf_native: Add install prefix variation 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/pi-util/BUILD.txt b/pi-util/BUILD.txt -index b050971f63..2b62d660c0 100644 +index b050971f63c5..2b62d660c0d1 100644 --- a/pi-util/BUILD.txt +++ b/pi-util/BUILD.txt @@ -24,6 +24,8 @@ There are a few choices here @@ -32682,7 +32682,7 @@ index b050971f63..2b62d660c0 100644 +easy to do otherwise. diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh -index 0a7d230f1b..f0ed159594 100755 +index 0a7d230f1b70..f0ed1595948b 100755 --- a/pi-util/conf_native.sh +++ b/pi-util/conf_native.sh @@ -9,6 +9,7 @@ RPI_KEEPS="" @@ -32729,10 +32729,10 @@ index 0a7d230f1b..f0ed159594 100755 # gcc option for getting asm listing # -Wa,-ahls -From 91ea652a95370a428f1353932b2a55dae7158acc Mon Sep 17 00:00:00 2001 +From 5c43e72236ef247a0a68e5ca9417496ee2e179a5 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Apr 2023 10:47:58 +0000 -Subject: [PATCH 123/161] swcale: Add explicit bgr24->yv12 conversion +Subject: [PATCH 123/186] swcale: Add explicit bgr24->yv12 conversion (cherry picked from commit 9a22d429f46a038321c66a0cd54737177641b434) --- @@ -32743,7 +32743,7 @@ Subject: [PATCH 123/161] swcale: Add explicit bgr24->yv12 conversion 4 files changed, 65 insertions(+), 5 deletions(-) diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c -index e98fdac8ea..84bb56e60e 100644 +index e98fdac8ead6..84bb56e60e94 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -83,6 +83,11 @@ void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, @@ -32759,7 +32759,7 @@ index e98fdac8ea..84bb56e60e 100644 int srcStride, int dstStride); void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h -index f3951d523e..0028ab345f 100644 +index f3951d523ef7..0028ab345fc9 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -79,6 +79,9 @@ void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size); @@ -32784,7 +32784,7 @@ index f3951d523e..0028ab345f 100644 int srcStride, int dstStride); diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c -index 42c69801ba..e2437826dd 100644 +index 42c69801ba40..e2437826dd41 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -646,13 +646,14 @@ static inline void uyvytoyv12_c(const uint8_t *src, uint8_t *ydst, @@ -32847,7 +32847,7 @@ index 42c69801ba..e2437826dd 100644 deinterleaveBytes = deinterleaveBytes_c; vu9_to_vu12 = vu9_to_vu12_c; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c -index 9af2e7ecc3..9047030ae4 100644 +index 9af2e7ecc30d..9047030ae426 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1654,6 +1654,23 @@ static int bgr24ToYv12Wrapper(SwsContext *c, const uint8_t *src[], @@ -32887,10 +32887,10 @@ index 9af2e7ecc3..9047030ae4 100644 /* RGB/BGR -> RGB/BGR (no dither needed forms) */ if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) -From 207ea47b2153b276b53cd5a87528dbc532a9f551 Mon Sep 17 00:00:00 2001 +From 9161e42a5f914181fa97d86f20498632e9827556 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:26:10 +0000 -Subject: [PATCH 124/161] swscale: Add unscaled XRGB->YUV420P functions +Subject: [PATCH 124/186] swscale: Add unscaled XRGB->YUV420P functions (cherry picked from commit 04cc32ee3f390de513ad8c6156c0c66b2c60abc8) --- @@ -32901,7 +32901,7 @@ Subject: [PATCH 124/161] swscale: Add unscaled XRGB->YUV420P functions 4 files changed, 236 insertions(+), 12 deletions(-) diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c -index 84bb56e60e..c3b9079d2b 100644 +index 84bb56e60e94..c3b9079d2b3e 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -88,6 +88,26 @@ void (*ff_bgr24toyv12)(const uint8_t *src, uint8_t *ydst, @@ -32932,7 +32932,7 @@ index 84bb56e60e..c3b9079d2b 100644 int srcStride, int dstStride); void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h -index 0028ab345f..a0dd3ffb79 100644 +index 0028ab345fc9..a0dd3ffb79ab 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -135,6 +135,22 @@ extern void (*ff_bgr24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, @@ -32959,7 +32959,7 @@ index 0028ab345f..a0dd3ffb79 100644 int srcStride, int dstStride); diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c -index e2437826dd..703de90690 100644 +index e2437826dd41..703de90690d3 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -708,30 +708,125 @@ static void rgb24toyv12_x(const uint8_t *src, uint8_t *ydst, uint8_t *udst, @@ -33112,7 +33112,7 @@ index e2437826dd..703de90690 100644 deinterleaveBytes = deinterleaveBytes_c; vu9_to_vu12 = vu9_to_vu12_c; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c -index 9047030ae4..053c06adf5 100644 +index 9047030ae426..053c06adf5d1 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1671,6 +1671,74 @@ static int rgb24ToYv12Wrapper(SwsContext *c, const uint8_t *src[], @@ -33219,10 +33219,10 @@ index 9047030ae4..053c06adf5 100644 if (isAnyRGB(srcFormat) && isAnyRGB(dstFormat) && findRgbConvFn(c) && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) -From b5672a2d361ec4f064ae116a3452282996cc87a0 Mon Sep 17 00:00:00 2001 +From 2452146f774e85a1f0fe1c8c2551811cd98adc87 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:35:44 +0000 -Subject: [PATCH 125/161] swscale: Add aarch64 unscaled RGB24->YUV420P +Subject: [PATCH 125/186] swscale: Add aarch64 unscaled RGB24->YUV420P (cherry picked from commit 0cf416312095ce5bea3d2f7e9b14736d4b3ed160) --- @@ -33231,7 +33231,7 @@ Subject: [PATCH 125/161] swscale: Add aarch64 unscaled RGB24->YUV420P 2 files changed, 221 insertions(+) diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c -index a9bf6ff9e0..6d3e0000dc 100644 +index a9bf6ff9e0a8..6d3e0000dc9a 100644 --- a/libswscale/aarch64/rgb2rgb.c +++ b/libswscale/aarch64/rgb2rgb.c @@ -30,6 +30,44 @@ @@ -33288,7 +33288,7 @@ index a9bf6ff9e0..6d3e0000dc 100644 } } diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S -index d81110ec57..8cf40b65f5 100644 +index d81110ec5714..8cf40b65f520 100644 --- a/libswscale/aarch64/rgb2rgb_neon.S +++ b/libswscale/aarch64/rgb2rgb_neon.S @@ -77,3 +77,184 @@ function ff_interleave_bytes_neon, export=1 @@ -33477,10 +33477,10 @@ index d81110ec57..8cf40b65f5 100644 + ret +endfunc -From f62603136ee2eaf781519bd70e445b03f80960da Mon Sep 17 00:00:00 2001 +From 95900ef928a5254db60ce7182f4903ad6d27a181 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 27 Apr 2023 13:03:52 +0000 -Subject: [PATCH 126/161] rgb2rgb: Fix rgb24->yuv420p with arbitrary wxh +Subject: [PATCH 126/186] rgb2rgb: Fix rgb24->yuv420p with arbitrary wxh (cherry picked from commit 58771fdf0218dc670d8a343824f540e2f6e8785d) --- @@ -33489,7 +33489,7 @@ Subject: [PATCH 126/161] rgb2rgb: Fix rgb24->yuv420p with arbitrary wxh 2 files changed, 355 insertions(+), 90 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c -index 6d3e0000dc..f10c4ef2de 100644 +index 6d3e0000dc9a..f10c4ef2ded9 100644 --- a/libswscale/aarch64/rgb2rgb.c +++ b/libswscale/aarch64/rgb2rgb.c @@ -44,8 +44,9 @@ void ff_rgb24toyv12_aarch64(const uint8_t *src, uint8_t *ydst, uint8_t *udst, @@ -33505,7 +33505,7 @@ index 6d3e0000dc..f10c4ef2de 100644 static void rgb24toyv12_check(const uint8_t *src, uint8_t *ydst, uint8_t *udst, diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S -index 8cf40b65f5..978ab443ea 100644 +index 8cf40b65f520..978ab443ea52 100644 --- a/libswscale/aarch64/rgb2rgb_neon.S +++ b/libswscale/aarch64/rgb2rgb_neon.S @@ -116,6 +116,25 @@ endfunc @@ -34007,10 +34007,10 @@ index 8cf40b65f5..978ab443ea 100644 ret endfunc -From cf020c89ac47620c4a5390d0333e9ea70fbfa7b8 Mon Sep 17 00:00:00 2001 +From d33e534ad9a45463b0433767a28256d737827b8c Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Apr 2023 15:36:07 +0000 -Subject: [PATCH 127/161] rgb2rgb: Use asm unconditionally +Subject: [PATCH 127/186] rgb2rgb: Use asm unconditionally (cherry picked from commit 7c216c0804836b31c0ea093bb1dde5ab387724b1) --- @@ -34018,7 +34018,7 @@ Subject: [PATCH 127/161] rgb2rgb: Use asm unconditionally 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c -index f10c4ef2de..6a0e2dcc09 100644 +index f10c4ef2ded9..6a0e2dcc09f8 100644 --- a/libswscale/aarch64/rgb2rgb.c +++ b/libswscale/aarch64/rgb2rgb.c @@ -37,46 +37,13 @@ void ff_rgb24toyv12_aarch64(const uint8_t *src, uint8_t *ydst, uint8_t *udst, @@ -34071,10 +34071,10 @@ index f10c4ef2de..6a0e2dcc09 100644 } } -From 1895fdcaf403f403736ab52d1cb69dce7c964b66 Mon Sep 17 00:00:00 2001 +From 79640085d62275d96b2c53f18776cfd773d9fde4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 27 Apr 2023 13:01:43 +0000 -Subject: [PATCH 128/161] tests/swscale: Add options for width and height on +Subject: [PATCH 128/186] tests/swscale: Add options for width and height on the command line (cherry picked from commit eb8a09779688fc05bf204fdfcd063b04cda07271) @@ -34083,7 +34083,7 @@ Subject: [PATCH 128/161] tests/swscale: Add options for width and height on 1 file changed, 59 insertions(+), 25 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c -index 6c38041ddb..4cf41d9f64 100644 +index 6c38041ddb81..4cf41d9f64a4 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -355,56 +355,71 @@ static int fileTest(const uint8_t * const ref[4], int refStride[4], @@ -34230,10 +34230,10 @@ index 6c38041ddb..4cf41d9f64 100644 } error: -From 94e48653a6bd1b8438887b486927e87b56651455 Mon Sep 17 00:00:00 2001 +From 7fcd6aa72879fad5f0a4d2144b65c37c7a50ecfc Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Apr 2023 16:31:23 +0000 -Subject: [PATCH 129/161] tests/swscale: Add a timing option +Subject: [PATCH 129/186] tests/swscale: Add a timing option -t Where n is the number of time to loop the scale op. Often useful to do it 10 times or so for better resolution @@ -34244,7 +34244,7 @@ Subject: [PATCH 129/161] tests/swscale: Add a timing option 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/libswscale/tests/swscale.c b/libswscale/tests/swscale.c -index 4cf41d9f64..12776ffec7 100644 +index 4cf41d9f64a4..12776ffec7ae 100644 --- a/libswscale/tests/swscale.c +++ b/libswscale/tests/swscale.c @@ -23,6 +23,7 @@ @@ -34315,10 +34315,10 @@ index 4cf41d9f64..12776ffec7 100644 } } else { -From 406806d0b9d9cb113deb0d083a28cbccabab6825 Mon Sep 17 00:00:00 2001 +From fabd4e3e197737f27684a17e817c186a350213d4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 13:40:36 +0000 -Subject: [PATCH 130/161] swscale: RGB->YUV420 fix C template to allow odd +Subject: [PATCH 130/186] swscale: RGB->YUV420 fix C template to allow odd widths (cherry picked from commit 08b2023e7b5292df0adc6593e4d20087f9cef5c8) @@ -34328,7 +34328,7 @@ Subject: [PATCH 130/161] swscale: RGB->YUV420 fix C template to allow odd 2 files changed, 49 insertions(+), 6 deletions(-) diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c -index 703de90690..e711589e1e 100644 +index 703de90690d3..e711589e1e1a 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -679,6 +679,19 @@ static void rgb24toyv12_x(const uint8_t *src, uint8_t *ydst, uint8_t *udst, @@ -34404,7 +34404,7 @@ index 703de90690..e711589e1e 100644 vdst += chromStride; ydst += lumStride; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c -index 053c06adf5..52469b2e4a 100644 +index 053c06adf5d1..52469b2e4a7b 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -2062,7 +2062,6 @@ void ff_get_unscaled_swscale(SwsContext *c) @@ -34452,10 +34452,10 @@ index 053c06adf5..52469b2e4a 100644 /* RGB/BGR -> RGB/BGR (no dither needed forms) */ -From 68c6482d9473ce774e87cac2455a8c7b3e2d99b4 Mon Sep 17 00:00:00 2001 +From 7d6f3a7ede0f4bf03a410bc2a8a8f38a47ac15a9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 4 May 2023 14:26:14 +0000 -Subject: [PATCH 131/161] rtpenc: Add code to send H264 new extradata in +Subject: [PATCH 131/186] rtpenc: Add code to send H264 new extradata in sidedata Fixes issue with pi V4L2 H264 encode which cannot create extradata @@ -34467,7 +34467,7 @@ at init time. 1 file changed, 18 insertions(+) diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c -index a8d296a154..f67dc2a15a 100644 +index a8d296a1542f..f67dc2a15ae1 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -19,6 +19,7 @@ @@ -34505,10 +34505,10 @@ index a8d296a154..f67dc2a15a 100644 ff_rtp_send_h261(s1, pkt->data, size); break; -From 5240cc7fc3abed8af5f178c5461ca9fe11a7d5e4 Mon Sep 17 00:00:00 2001 +From 7ba7eb37305530b4eef1637c87088da8d93911aa Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 5 Jun 2023 08:34:38 +0000 -Subject: [PATCH 132/161] rgb2rgb: Fix luma narrow+saturation instruction +Subject: [PATCH 132/186] rgb2rgb: Fix luma narrow+saturation instruction (cherry picked from commit 9cdac1c08ad5c0aea28907d1d3fd0bdda387955a) --- @@ -34516,7 +34516,7 @@ Subject: [PATCH 132/161] rgb2rgb: Fix luma narrow+saturation instruction 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S -index 978ab443ea..476ca723a0 100644 +index 978ab443ea52..476ca723a0ef 100644 --- a/libswscale/aarch64/rgb2rgb_neon.S +++ b/libswscale/aarch64/rgb2rgb_neon.S @@ -203,11 +203,11 @@ function ff_bgr24toyv12_aarch64, export=1 @@ -34576,10 +34576,10 @@ index 978ab443ea..476ca723a0 100644 // Here: -From 9474d9d227f2af488d5d2bd614c5c707479ca3c3 Mon Sep 17 00:00:00 2001 +From 0d553f498626e936ef1f48505ee260dbe2478d0c Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 4 Jun 2023 13:37:59 +0000 -Subject: [PATCH 133/161] v4l2_m2m_dec: Tweak pending count to use dts & +Subject: [PATCH 133/186] v4l2_m2m_dec: Tweak pending count to use dts & reorder size (cherry picked from commit ca438b382c90f9a5f58f4708205e6ac25395db2a) @@ -34589,7 +34589,7 @@ Subject: [PATCH 133/161] v4l2_m2m_dec: Tweak pending count to use dts & 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h -index ded1478a49..a506e69d67 100644 +index ded1478a49da..a506e69d674b 100644 --- a/libavcodec/v4l2_m2m.h +++ b/libavcodec/v4l2_m2m.h @@ -115,6 +115,7 @@ typedef struct V4L2m2mContext { @@ -34601,7 +34601,7 @@ index ded1478a49..a506e69d67 100644 /* Ext data sent */ int extdata_sent; diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index d124c7b1fc..13af62e819 100644 +index d124c7b1fc43..13af62e819bc 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -121,13 +121,18 @@ log_dump(void * logctx, int lvl, const void * const data, const size_t len) @@ -34741,10 +34741,10 @@ index d124c7b1fc..13af62e819 100644 pts_stats_init(&s->pts_stat, avctx, "decoder"); -From 2145b9c9177f0fe9569ce39e2d4eb629caf8bd47 Mon Sep 17 00:00:00 2001 +From 244b56393e0f6f1d63b894d942d148c6dd9a3862 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 7 Jun 2023 11:14:52 +0000 -Subject: [PATCH 134/161] v4l2_m2m: Add encode size check +Subject: [PATCH 134/186] v4l2_m2m: Add encode size check Previously an out of bounds size would fail whilst trying to copy the buffer with an unhelpful message. This produces a better error at init @@ -34756,7 +34756,7 @@ time. 1 file changed, 43 insertions(+) diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index f802687b1b..28d9ed4988 100644 +index f802687b1bb2..28d9ed49887e 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -109,6 +109,44 @@ static int v4l2_prepare_contexts(V4L2m2mContext *s, int probe) @@ -34817,10 +34817,10 @@ index f802687b1b..28d9ed4988 100644 if (ret) { av_log(log_ctx, AV_LOG_DEBUG, "v4l2 capture format not supported\n"); -From 805985ea191c98885a74dbf994b1ca11551cd81e Mon Sep 17 00:00:00 2001 +From 834a78de7eda652d34ad72ff6d63d4ba86d22fa3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 9 Jun 2023 10:28:12 +0000 -Subject: [PATCH 135/161] vf_bwdif: Add attributes to ask for vectorization +Subject: [PATCH 135/186] vf_bwdif: Add attributes to ask for vectorization (cherry picked from commit 281250290ba5c2dcd8676e9a261050e65c10bcb7) --- @@ -34828,7 +34828,7 @@ Subject: [PATCH 135/161] vf_bwdif: Add attributes to ask for vectorization 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 65c617ebb3..09e68523bb 100644 +index 65c617ebb335..09e68523bbfa 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -74,10 +74,10 @@ typedef struct ThreadData { @@ -34930,10 +34930,10 @@ index 65c617ebb3..09e68523bb 100644 int parity, int clip_max, int spat) { -From f4012f09da1c57a0aa5db01f9096992d0c385f7b Mon Sep 17 00:00:00 2001 +From b4f4f90c9bda485a07a894f2700aecad25ff1781 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Jun 2023 13:07:55 +0000 -Subject: [PATCH 136/161] v4l2m2m_dec: Fix h264 reorder size if no sps +Subject: [PATCH 136/186] v4l2m2m_dec: Fix h264 reorder size if no sps initially (cherry picked from commit 8832f7924bf47cbca0de251d7b406917f958ebf4) @@ -34942,7 +34942,7 @@ Subject: [PATCH 136/161] v4l2m2m_dec: Fix h264 reorder size if no sps 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 13af62e819..11c83b2d66 100644 +index 13af62e819bc..11c83b2d6643 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -1024,8 +1024,8 @@ parse_extradata(AVCodecContext * const avctx, V4L2m2mContext * const s) @@ -34956,17 +34956,17 @@ index 13af62e819..11c83b2d66 100644 ff_h264_ps_uninit(&ps); break; -From fd31937e4befa2368d48e234d66fb962246bf777 Mon Sep 17 00:00:00 2001 +From f9124edee3874fc5ac9633f59248a9122f22e9a1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 18:03:29 +0000 -Subject: [PATCH 137/161] sand_fns: Add missing uxtw for neon stride +Subject: [PATCH 137/186] sand_fns: Add missing uxtw for neon stride --- libavutil/aarch64/rpi_sand_neon.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S -index 2f07d9674c..19411cf3f1 100644 +index 2f07d9674c9f..19411cf3f19a 100644 --- a/libavutil/aarch64/rpi_sand_neon.S +++ b/libavutil/aarch64/rpi_sand_neon.S @@ -469,6 +469,7 @@ endfunc @@ -34986,10 +34986,10 @@ index 2f07d9674c..19411cf3f1 100644 uxtw x6, w6 add x8, x2, x6, lsl #7 -From f6a19a36ffe0dbe0a6e2e450dafec6711db19057 Mon Sep 17 00:00:00 2001 +From feed60f18216ea49b2ec7d54c71d342cb7c16c6e Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 18:12:16 +0000 -Subject: [PATCH 138/161] sand_fns: Rework aarch64 neon +Subject: [PATCH 138/186] sand_fns: Rework aarch64 neon sand30_lines_to_planar_c16 Previous version could overflow its write buffer on small buffers @@ -35001,7 +35001,7 @@ This version is probably faster too 1 file changed, 151 insertions(+), 178 deletions(-) diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S -index 19411cf3f1..af7e2a88c4 100644 +index 19411cf3f19a..af7e2a88c44b 100644 --- a/libavutil/aarch64/rpi_sand_neon.S +++ b/libavutil/aarch64/rpi_sand_neon.S @@ -248,199 +248,172 @@ incomplete_block_loop_end_c8: @@ -35356,17 +35356,17 @@ index 19411cf3f1..af7e2a88c4 100644 // uint8_t * dest, // unsigned int dst_stride, -From 68356e594ff32e18e419a476889d958dc24af4b2 Mon Sep 17 00:00:00 2001 +From 7f8e8bb693607117f5f7bff2ee7ac7f841f3f726 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 19:41:06 +0000 -Subject: [PATCH 139/161] sand_fns: Minor optimisations to aarch64 neon +Subject: [PATCH 139/186] sand_fns: Minor optimisations to aarch64 neon --- libavutil/aarch64/rpi_sand_neon.S | 140 ++++++------------------------ 1 file changed, 28 insertions(+), 112 deletions(-) diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S -index af7e2a88c4..11658de0c8 100644 +index af7e2a88c44b..11658de0c8c2 100644 --- a/libavutil/aarch64/rpi_sand_neon.S +++ b/libavutil/aarch64/rpi_sand_neon.S @@ -279,18 +279,37 @@ endfunc @@ -35555,10 +35555,10 @@ index af7e2a88c4..11658de0c8 100644 blt 2f -From 3abb0dcc453aba0a069bc1a8f26ba77913c5ef2b Mon Sep 17 00:00:00 2001 +From 700b43043a725509ef9cb6e1d51b28d1b96a6914 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Jul 2023 18:43:32 +0000 -Subject: [PATCH 140/161] sand_fns: Add test for neon to sand30 fns so they can +Subject: [PATCH 140/186] sand_fns: Add test for neon to sand30 fns so they can be tested by checkasm --- @@ -35566,7 +35566,7 @@ Subject: [PATCH 140/161] sand_fns: Add test for neon to sand30 fns so they can 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavutil/rpi_sand_fns.c b/libavutil/rpi_sand_fns.c -index b6071e2928..0626bb06cb 100644 +index b6071e2928f7..0626bb06cb1b 100644 --- a/libavutil/rpi_sand_fns.c +++ b/libavutil/rpi_sand_fns.c @@ -35,10 +35,12 @@ Authors: John Cox @@ -35603,10 +35603,10 @@ index b6071e2928..0626bb06cb 100644 src, stride1, stride2, _x, y, _w, h); return; -From fb72aa34ec2c42fc595bb1a6c32b599da870fa2b Mon Sep 17 00:00:00 2001 +From a0a5898d3d19aaa5324e5c64e526c6bb7f39f62b Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Jul 2023 18:43:57 +0000 -Subject: [PATCH 141/161] checkasm: Add tests for rpi_sand sand30 fns +Subject: [PATCH 141/186] checkasm: Add tests for rpi_sand sand30 fns Something of a kludge for function selection as, at the moment, the rpi_sand fns don't have a jump table that we could use for selection. @@ -35620,7 +35620,7 @@ rpi_sand fns don't have a jump table that we could use for selection. create mode 100644 tests/checkasm/rpi_sand.c diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile -index a6f06c7007..66291baf33 100644 +index a6f06c7007c2..66291baf3375 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -59,8 +59,9 @@ CHECKASMOBJS-$(CONFIG_SWSCALE) += $(SWSCALEOBJS) @@ -35635,7 +35635,7 @@ index a6f06c7007..66291baf33 100644 CHECKASMOBJS-$(ARCH_AARCH64) += aarch64/checkasm.o CHECKASMOBJS-$(HAVE_ARMV5TE_EXTERNAL) += arm/checkasm.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c -index e96d84a7da..57e0091b80 100644 +index e96d84a7daef..57e0091b806a 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -210,6 +210,9 @@ static const struct { @@ -35649,7 +35649,7 @@ index e96d84a7da..57e0091b80 100644 { NULL } }; diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h -index 8744a81218..f4a0d20358 100644 +index 8744a81218a8..f4a0d20358c0 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -73,6 +73,7 @@ void checkasm_check_motion(void); @@ -35662,7 +35662,7 @@ index 8744a81218..f4a0d20358 100644 void checkasm_check_sw_gbrp(void); diff --git a/tests/checkasm/rpi_sand.c b/tests/checkasm/rpi_sand.c new file mode 100644 -index 0000000000..0888714c4c +index 000000000000..0888714c4c5c --- /dev/null +++ b/tests/checkasm/rpi_sand.c @@ -0,0 +1,118 @@ @@ -35785,7 +35785,7 @@ index 0000000000..0888714c4c +} + diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak -index a4e95541f5..6fda6d227e 100644 +index a4e95541f56c..6fda6d227e13 100644 --- a/tests/fate/checkasm.mak +++ b/tests/fate/checkasm.mak @@ -27,6 +27,7 @@ FATE_CHECKASM = fate-checkasm-aacpsdsp \ @@ -35797,10 +35797,10 @@ index a4e95541f5..6fda6d227e 100644 fate-checkasm-synth_filter \ fate-checkasm-sw_gbrp \ -From d798c7b90dd63bca6f9878b1fb30ec1d8f0b9a5e Mon Sep 17 00:00:00 2001 +From 3d9471725138933bc137fff7ed85d2fcc277f2af Mon Sep 17 00:00:00 2001 From: James Darnley Date: Mon, 20 Feb 2023 20:55:08 +0100 -Subject: [PATCH 142/161] avfilter/bwdif: move filter_line init to a dedicated +Subject: [PATCH 142/186] avfilter/bwdif: move filter_line init to a dedicated function (cherry picked from commit b503b5a0cf80f38ecf4737c012b621b7e94f242a) @@ -35811,7 +35811,7 @@ Subject: [PATCH 142/161] avfilter/bwdif: move filter_line init to a dedicated 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h -index 889ff772ed..5749345f78 100644 +index 889ff772edd8..5749345f784e 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -37,6 +37,7 @@ typedef struct BWDIFContext { @@ -35824,7 +35824,7 @@ index 889ff772ed..5749345f78 100644 #endif /* AVFILTER_BWDIF_H */ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 09e68523bb..539fabbd46 100644 +index 09e68523bbfa..539fabbd4686 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -341,7 +341,14 @@ static int config_props(AVFilterLink *link) @@ -35856,7 +35856,7 @@ index 09e68523bb..539fabbd46 100644 diff --git a/libavfilter/x86/vf_bwdif_init.c b/libavfilter/x86/vf_bwdif_init.c -index e24e5cd9b1..ba7bc40c3d 100644 +index e24e5cd9b1c5..ba7bc40c3d30 100644 --- a/libavfilter/x86/vf_bwdif_init.c +++ b/libavfilter/x86/vf_bwdif_init.c @@ -42,11 +42,9 @@ void ff_bwdif_filter_line_12bit_ssse3(void *dst, void *prev, void *cur, void *ne @@ -35873,10 +35873,10 @@ index e24e5cd9b1..ba7bc40c3d 100644 if (bit_depth <= 8) { if (EXTERNAL_SSE2(cpu_flags)) -From 0eb9c627c07931cf93c4932e07e0df6c0ce860fd Mon Sep 17 00:00:00 2001 +From be14915902bc8d4a9aff0776dc976a17f0a27215 Mon Sep 17 00:00:00 2001 From: James Darnley Date: Mon, 20 Feb 2023 20:55:08 +0100 -Subject: [PATCH 143/161] checkasm: add test for bwdif +Subject: [PATCH 143/186] checkasm: add test for bwdif (cherry picked from commit 087faf8cac51e5e20a5f41b36b8d4c2705a10039) --- @@ -35889,7 +35889,7 @@ Subject: [PATCH 143/161] checkasm: add test for bwdif create mode 100644 tests/checkasm/vf_bwdif.c diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile -index 66291baf33..2c80d8e661 100644 +index 66291baf3375..2c80d8e66116 100644 --- a/tests/checkasm/Makefile +++ b/tests/checkasm/Makefile @@ -40,6 +40,7 @@ CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes) @@ -35901,7 +35901,7 @@ index 66291baf33..2c80d8e661 100644 AVFILTEROBJS-$(CONFIG_EQ_FILTER) += vf_eq.o AVFILTEROBJS-$(CONFIG_GBLUR_FILTER) += vf_gblur.o diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c -index 57e0091b80..4f983d7fbc 100644 +index 57e0091b806a..4f983d7fbc9a 100644 --- a/tests/checkasm/checkasm.c +++ b/tests/checkasm/checkasm.c @@ -179,6 +179,9 @@ static const struct { @@ -35915,7 +35915,7 @@ index 57e0091b80..4f983d7fbc 100644 { "vf_colorspace", checkasm_check_colorspace }, #endif diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h -index f4a0d20358..d69bc43999 100644 +index f4a0d20358c0..d69bc43999f5 100644 --- a/tests/checkasm/checkasm.h +++ b/tests/checkasm/checkasm.h @@ -83,6 +83,7 @@ void checkasm_check_utvideodsp(void); @@ -35928,7 +35928,7 @@ index f4a0d20358..d69bc43999 100644 void checkasm_check_vf_hflip(void); diff --git a/tests/checkasm/vf_bwdif.c b/tests/checkasm/vf_bwdif.c new file mode 100644 -index 0000000000..46224bb575 +index 000000000000..46224bb57572 --- /dev/null +++ b/tests/checkasm/vf_bwdif.c @@ -0,0 +1,84 @@ @@ -36017,7 +36017,7 @@ index 0000000000..46224bb575 + } +} diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak -index 6fda6d227e..1620ab0be0 100644 +index 6fda6d227e13..1620ab0be0fc 100644 --- a/tests/fate/checkasm.mak +++ b/tests/fate/checkasm.mak @@ -38,6 +38,7 @@ FATE_CHECKASM = fate-checkasm-aacpsdsp \ @@ -36029,10 +36029,10 @@ index 6fda6d227e..1620ab0be0 100644 fate-checkasm-vf_eq \ fate-checkasm-vf_gblur \ -From c19ab5f6e7f8dd9dff5704510db98a81a1304f80 Mon Sep 17 00:00:00 2001 +From 278fc0455e3c68e136022cf836777790d7c88c16 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 6 Jul 2023 13:56:18 +0000 -Subject: [PATCH 144/161] Revert "vf_bwdif: Add attributes to ask for +Subject: [PATCH 144/186] Revert "vf_bwdif: Add attributes to ask for vectorization" This reverts commit 281250290ba5c2dcd8676e9a261050e65c10bcb7. @@ -36042,7 +36042,7 @@ Will be replaced by hand coded asm as on upstream 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 539fabbd46..34e8c5e234 100644 +index 539fabbd4686..34e8c5e234ee 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -74,10 +74,10 @@ typedef struct ThreadData { @@ -36144,10 +36144,10 @@ index 539fabbd46..34e8c5e234 100644 int parity, int clip_max, int spat) { -From 093eddd9ef66a7db9e637f3acfe51d950c87f613 Mon Sep 17 00:00:00 2001 +From 6c3566cf92cba9e2ccd87b53ac7f00f0ea431fb2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:39 +0000 -Subject: [PATCH 145/161] tests/checkasm: Add test for vf_bwdif filter_intra +Subject: [PATCH 145/186] tests/checkasm: Add test for vf_bwdif filter_intra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36160,7 +36160,7 @@ Signed-off-by: Martin Storsjö 1 file changed, 37 insertions(+) diff --git a/tests/checkasm/vf_bwdif.c b/tests/checkasm/vf_bwdif.c -index 46224bb575..034bbabb4c 100644 +index 46224bb57572..034bbabb4c5c 100644 --- a/tests/checkasm/vf_bwdif.c +++ b/tests/checkasm/vf_bwdif.c @@ -20,6 +20,7 @@ @@ -36213,10 +36213,10 @@ index 46224bb575..034bbabb4c 100644 + } } -From 28ef7402381b6fe241f81e21f302a23f8af674bf Mon Sep 17 00:00:00 2001 +From 652e80de533059d24e136242324d4129a545a158 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:40 +0000 -Subject: [PATCH 146/161] avfilter/vf_bwdif: Add neon for filter_intra +Subject: [PATCH 146/186] avfilter/vf_bwdif: Add neon for filter_intra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36240,7 +36240,7 @@ Signed-off-by: Martin Storsjö create mode 100644 libavfilter/aarch64/vf_bwdif_neon.S diff --git a/libavfilter/aarch64/Makefile b/libavfilter/aarch64/Makefile -index b58daa3a3f..b68209bc94 100644 +index b58daa3a3fea..b68209bc94a6 100644 --- a/libavfilter/aarch64/Makefile +++ b/libavfilter/aarch64/Makefile @@ -1,3 +1,5 @@ @@ -36251,7 +36251,7 @@ index b58daa3a3f..b68209bc94 100644 NEON-OBJS-$(CONFIG_NLMEANS_FILTER) += aarch64/vf_nlmeans_neon.o diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c new file mode 100644 -index 0000000000..3ffaa07ab3 +index 000000000000..3ffaa07ab369 --- /dev/null +++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c @@ -0,0 +1,56 @@ @@ -36313,7 +36313,7 @@ index 0000000000..3ffaa07ab3 + diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S new file mode 100644 -index 0000000000..e288efbe6c +index 000000000000..e288efbe6c33 --- /dev/null +++ b/libavfilter/aarch64/vf_bwdif_neon.S @@ -0,0 +1,136 @@ @@ -36454,7 +36454,7 @@ index 0000000000..e288efbe6c + ret +endfunc diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h -index 5749345f78..ae6f6ce223 100644 +index 5749345f784e..ae6f6ce2233a 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -39,5 +39,9 @@ typedef struct BWDIFContext { @@ -36468,7 +36468,7 @@ index 5749345f78..ae6f6ce223 100644 #endif /* AVFILTER_BWDIF_H */ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 34e8c5e234..6ec8bbab5d 100644 +index 34e8c5e234ee..6ec8bbab5d72 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -122,8 +122,8 @@ typedef struct ThreadData { @@ -36500,10 +36500,10 @@ index 34e8c5e234..6ec8bbab5d 100644 } -From 2f8199a41cfd43595352899e722646052b0db2ee Mon Sep 17 00:00:00 2001 +From 981053a48f80de6c0be0c3975f7aa877aacc842e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:41 +0000 -Subject: [PATCH 147/161] tests/checkasm: Add test for vf_bwdif filter_edge +Subject: [PATCH 147/186] tests/checkasm: Add test for vf_bwdif filter_edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36516,7 +36516,7 @@ Signed-off-by: Martin Storsjö 1 file changed, 54 insertions(+) diff --git a/tests/checkasm/vf_bwdif.c b/tests/checkasm/vf_bwdif.c -index 034bbabb4c..5fdba09fdc 100644 +index 034bbabb4c5c..5fdba09fdc73 100644 --- a/tests/checkasm/vf_bwdif.c +++ b/tests/checkasm/vf_bwdif.c @@ -83,6 +83,60 @@ void checkasm_check_vf_bwdif(void) @@ -36581,10 +36581,10 @@ index 034bbabb4c..5fdba09fdc 100644 LOCAL_ALIGNED_16(uint8_t, cur0, [11*WIDTH]); LOCAL_ALIGNED_16(uint8_t, cur1, [11*WIDTH]); -From 171d7f201503812617b8e320c83cc33120425923 Mon Sep 17 00:00:00 2001 +From c48fed1cb66414179201cbac1ef6fb689cb4426a Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:42 +0000 -Subject: [PATCH 148/161] avfilter/vf_bwdif: Add neon for filter_edge +Subject: [PATCH 148/186] avfilter/vf_bwdif: Add neon for filter_edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36604,7 +36604,7 @@ Signed-off-by: Martin Storsjö 4 files changed, 205 insertions(+), 4 deletions(-) diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c -index 3ffaa07ab3..e75cf2f204 100644 +index 3ffaa07ab369..e75cf2f20459 100644 --- a/libavfilter/aarch64/vf_bwdif_init_aarch64.c +++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c @@ -24,10 +24,29 @@ @@ -36645,7 +36645,7 @@ index 3ffaa07ab3..e75cf2f204 100644 } diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S -index e288efbe6c..389302b813 100644 +index e288efbe6c33..389302b813aa 100644 --- a/libavfilter/aarch64/vf_bwdif_neon.S +++ b/libavfilter/aarch64/vf_bwdif_neon.S @@ -66,6 +66,79 @@ @@ -36840,7 +36840,7 @@ index e288efbe6c..389302b813 100644 // // void ff_bwdif_filter_intra_neon( diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h -index ae6f6ce223..ae1616d366 100644 +index ae6f6ce2233a..ae1616d366cb 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -41,6 +41,10 @@ void ff_bwdif_init_filter_line(BWDIFContext *bwdif, int bit_depth); @@ -36855,7 +36855,7 @@ index ae6f6ce223..ae1616d366 100644 int prefs3, int mrefs3, int parity, int clip_max); diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 6ec8bbab5d..688c2d2572 100644 +index 6ec8bbab5d72..688c2d257229 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -150,9 +150,9 @@ static void filter_line_c(void *dst1, void *prev1, void *cur1, void *next1, @@ -36881,10 +36881,10 @@ index 6ec8bbab5d..688c2d2572 100644 #if ARCH_X86 -From abf6588935bce275ba302766bcd8c3bb7a523d3c Mon Sep 17 00:00:00 2001 +From eb72477591f765f10373e64dd57745ebe908d01a Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:43 +0000 -Subject: [PATCH 149/161] avfilter/vf_bwdif: Add neon for filter_line +Subject: [PATCH 149/186] avfilter/vf_bwdif: Add neon for filter_line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36903,7 +36903,7 @@ Signed-off-by: Martin Storsjö 4 files changed, 234 insertions(+), 5 deletions(-) diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c -index e75cf2f204..21e67884ab 100644 +index e75cf2f20459..21e67884ab90 100644 --- a/libavfilter/aarch64/vf_bwdif_init_aarch64.c +++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c @@ -31,6 +31,26 @@ void ff_bwdif_filter_edge_neon(void *dst1, void *prev1, void *cur1, void *next1, @@ -36942,7 +36942,7 @@ index e75cf2f204..21e67884ab 100644 } diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S -index 389302b813..f185e94e3c 100644 +index 389302b813aa..f185e94e3c6f 100644 --- a/libavfilter/aarch64/vf_bwdif_neon.S +++ b/libavfilter/aarch64/vf_bwdif_neon.S @@ -154,6 +154,209 @@ const coeffs, align=4 // align 4 means align on 2^4 boundry @@ -37156,7 +37156,7 @@ index 389302b813..f185e94e3c 100644 // // void ff_bwdif_filter_edge_neon( diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h -index ae1616d366..cce99953f3 100644 +index ae1616d366cb..cce99953f363 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -48,4 +48,9 @@ void ff_bwdif_filter_edge_c(void *dst1, void *prev1, void *cur1, void *next1, @@ -37170,7 +37170,7 @@ index ae1616d366..cce99953f3 100644 + #endif /* AVFILTER_BWDIF_H */ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 688c2d2572..2dc47f9614 100644 +index 688c2d257229..2dc47f9614f8 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -132,10 +132,10 @@ void ff_bwdif_filter_intra_c(void *dst1, void *cur1, int w, int prefs, int mrefs @@ -37198,10 +37198,10 @@ index 688c2d2572..2dc47f9614 100644 } -From 7601de6ab2604d1f530e4b8f20f409d1ec2ae6a4 Mon Sep 17 00:00:00 2001 +From 88f7f8eb8b2fe1e006fdc05564259f6a2448fdbc Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:44 +0000 -Subject: [PATCH 150/161] avfilter/vf_bwdif: Add a filter_line3 method for +Subject: [PATCH 150/186] avfilter/vf_bwdif: Add a filter_line3 method for optimisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -37234,7 +37234,7 @@ Signed-off-by: Martin Storsjö 3 files changed, 129 insertions(+), 3 deletions(-) diff --git a/libavfilter/bwdif.h b/libavfilter/bwdif.h -index cce99953f3..496cec72ef 100644 +index cce99953f363..496cec72ef01 100644 --- a/libavfilter/bwdif.h +++ b/libavfilter/bwdif.h @@ -35,6 +35,9 @@ typedef struct BWDIFContext { @@ -37257,7 +37257,7 @@ index cce99953f3..496cec72ef 100644 + #endif /* AVFILTER_BWDIF_H */ diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c -index 2dc47f9614..9847d38b6a 100644 +index 2dc47f9614f8..9847d38b6a63 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -150,6 +150,31 @@ void ff_bwdif_filter_line_c(void *dst1, void *prev1, void *cur1, void *next1, @@ -37347,7 +37347,7 @@ index 2dc47f9614..9847d38b6a 100644 s->filter_intra = filter_intra_16bit; s->filter_line = filter_line_c_16bit; diff --git a/tests/checkasm/vf_bwdif.c b/tests/checkasm/vf_bwdif.c -index 5fdba09fdc..3399cacdf7 100644 +index 5fdba09fdc73..3399cacdf790 100644 --- a/tests/checkasm/vf_bwdif.c +++ b/tests/checkasm/vf_bwdif.c @@ -28,6 +28,10 @@ @@ -37446,10 +37446,10 @@ index 5fdba09fdc..3399cacdf7 100644 LOCAL_ALIGNED_16(uint8_t, prev0, [11*WIDTH]); LOCAL_ALIGNED_16(uint8_t, prev1, [11*WIDTH]); -From 120058b7abd0db1d222b1e197207de8226fdfd94 Mon Sep 17 00:00:00 2001 +From 27eb1719ee70a8ccaf2acac2161b84e283ac5b1f Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:45 +0000 -Subject: [PATCH 151/161] avfilter/vf_bwdif: Add neon for filter_line3 +Subject: [PATCH 151/186] avfilter/vf_bwdif: Add neon for filter_line3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -37463,7 +37463,7 @@ Signed-off-by: Martin Storsjö 2 files changed, 300 insertions(+) diff --git a/libavfilter/aarch64/vf_bwdif_init_aarch64.c b/libavfilter/aarch64/vf_bwdif_init_aarch64.c -index 21e67884ab..f52bc4b9b4 100644 +index 21e67884ab90..f52bc4b9b431 100644 --- a/libavfilter/aarch64/vf_bwdif_init_aarch64.c +++ b/libavfilter/aarch64/vf_bwdif_init_aarch64.c @@ -36,6 +36,33 @@ void ff_bwdif_filter_line_neon(void *dst1, void *prev1, void *cur1, void *next1, @@ -37508,7 +37508,7 @@ index 21e67884ab..f52bc4b9b4 100644 } diff --git a/libavfilter/aarch64/vf_bwdif_neon.S b/libavfilter/aarch64/vf_bwdif_neon.S -index f185e94e3c..ae9aab20cd 100644 +index f185e94e3c6f..ae9aab20cdd9 100644 --- a/libavfilter/aarch64/vf_bwdif_neon.S +++ b/libavfilter/aarch64/vf_bwdif_neon.S @@ -154,6 +154,278 @@ const coeffs, align=4 // align 4 means align on 2^4 boundry @@ -37791,10 +37791,10 @@ index f185e94e3c..ae9aab20cd 100644 // // void filter_line( -From ef057ba172ece9646e1b4dd84a8f9587af28844f Mon Sep 17 00:00:00 2001 +From 953a9d1e34140084185e747ebf3f3877b2779267 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 24 Jul 2023 16:39:06 +0100 -Subject: [PATCH 152/161] weak_link: Fix ref count init +Subject: [PATCH 152/186] weak_link: Fix ref count init (cherry picked from commit d6de45b15a0c96bfdc96bbc441963a60945e5eba) --- @@ -37802,7 +37802,7 @@ Subject: [PATCH 152/161] weak_link: Fix ref count init 1 file changed, 1 insertion(+) diff --git a/libavcodec/weak_link.c b/libavcodec/weak_link.c -index f234a985b9..5a79e89ed7 100644 +index f234a985b9c1..5a79e89ed7c2 100644 --- a/libavcodec/weak_link.c +++ b/libavcodec/weak_link.c @@ -19,6 +19,7 @@ struct ff_weak_link_master * ff_weak_link_new(void * p) @@ -37814,10 +37814,10 @@ index f234a985b9..5a79e89ed7 100644 if (pthread_rwlock_init(&w->lock, NULL)) { free(w); -From 506426ba08bc90e7efa712b549b29d8e1c231344 Mon Sep 17 00:00:00 2001 +From 8ffc0497c128a4d5f60849fe56e7f985e6a7ef71 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 24 Jul 2023 17:28:06 +0100 -Subject: [PATCH 153/161] v4l2_m2m: Check fd before attempting to close (fix +Subject: [PATCH 153/186] v4l2_m2m: Check fd before attempting to close (fix valgrind warn) (cherry picked from commit befa42878d054d1fba53d5da14406faaae224daf) @@ -37826,7 +37826,7 @@ Subject: [PATCH 153/161] v4l2_m2m: Check fd before attempting to close (fix 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 28d9ed4988..238ceea235 100644 +index 28d9ed49887e..238ceea23546 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -340,8 +340,11 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) @@ -37844,10 +37844,10 @@ index 28d9ed4988..238ceea235 100644 s->self_ref = NULL; // This is only called on avctx close so after this point we don't have that -From 4c58b8d414d6b84efad08c6e9920fe1f5c49a682 Mon Sep 17 00:00:00 2001 +From 567f293b764431685f83b368736b18cfdc42e29e Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Jul 2023 16:29:39 +0000 -Subject: [PATCH 154/161] v4l2_req_devscan: Fix udev leak +Subject: [PATCH 154/186] v4l2_req_devscan: Fix udev leak (cherry picked from commit 53b17ffd8a8890ef483163f3c9b0f96b437303f1) --- @@ -37855,7 +37855,7 @@ Subject: [PATCH 154/161] v4l2_req_devscan: Fix udev leak 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_req_devscan.c b/libavcodec/v4l2_req_devscan.c -index cfa94d55c4..ee8527ba1f 100644 +index cfa94d55c49b..ee8527ba1f35 100644 --- a/libavcodec/v4l2_req_devscan.c +++ b/libavcodec/v4l2_req_devscan.c @@ -437,12 +437,14 @@ int devscan_build(void * const dc, struct devscan **pscan) @@ -37875,10 +37875,10 @@ index cfa94d55c4..ee8527ba1f 100644 return ret; } -From 175ef7dc323be400a0570c53725a8da4ac1fa213 Mon Sep 17 00:00:00 2001 +From 74a85ee6638b4fdedeaadd0d62c6f6c46345ecad Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Jul 2023 16:42:27 +0000 -Subject: [PATCH 155/161] v4l2_m2m: Fix device_ref leak +Subject: [PATCH 155/186] v4l2_m2m: Fix device_ref leak (cherry picked from commit bfea15c07b4301cd1208981c8f221e5e3a598b34) --- @@ -37886,7 +37886,7 @@ Subject: [PATCH 155/161] v4l2_m2m: Fix device_ref leak 1 file changed, 1 insertion(+) diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c -index 238ceea235..add64b8e63 100644 +index 238ceea23546..add64b8e63e6 100644 --- a/libavcodec/v4l2_m2m.c +++ b/libavcodec/v4l2_m2m.c @@ -338,6 +338,7 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) @@ -37898,10 +37898,10 @@ index 238ceea235..add64b8e63 100644 dmabufs_ctl_unref(&s->db_ctl); -From e324b9d956d7dab58a5790efcfb8e46c95868ff4 Mon Sep 17 00:00:00 2001 +From d018ca7bb4428e622e0acb5f3fa6b3ae6a52873e Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 28 Jul 2023 16:10:01 +0000 -Subject: [PATCH 156/161] v4l2_m2m_dec: Avoid structure init warnings when +Subject: [PATCH 156/186] v4l2_m2m_dec: Avoid structure init warnings when struct changes (cherry picked from commit 8a836af420ed8c8dba90e2fd88691bcaa0668f8a) @@ -37910,7 +37910,7 @@ Subject: [PATCH 156/161] v4l2_m2m_dec: Avoid structure init warnings when 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 11c83b2d66..584e0b8825 100644 +index 11c83b2d6643..584e0b8825f9 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -1004,11 +1004,13 @@ parse_extradata(AVCodecContext * const avctx, V4L2m2mContext * const s) @@ -37947,10 +37947,10 @@ index 11c83b2d66..584e0b8825 100644 &ps, &sei, &is_nalff, &nal_length_size, avctx->err_recognition, 0, avctx); -From ae9cd86b532ae2a3800981c23a0aeac15a83f918 Mon Sep 17 00:00:00 2001 +From a466a89ac3c68a4bb41af63760caef0a624c86dd Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 22 Jul 2023 12:33:50 +0000 -Subject: [PATCH 157/161] v4l2_m2m_dec: Avoid calling get_format if no V4L2 +Subject: [PATCH 157/186] v4l2_m2m_dec: Avoid calling get_format if no V4L2 decoder device Move the get_format callback to after the decoder device has been found. @@ -37967,7 +37967,7 @@ the list of formats availible can actually represent reality. 3 files changed, 145 insertions(+), 31 deletions(-) diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c -index 79a31cf930..978a487ca9 100644 +index 79a31cf9300b..978a487ca98d 100644 --- a/libavcodec/v4l2_context.c +++ b/libavcodec/v4l2_context.c @@ -1064,6 +1064,47 @@ int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt, int timeout) @@ -38019,7 +38019,7 @@ index 79a31cf930..978a487ca9 100644 { struct v4l2_format_update fmt = { 0 }; diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h -index 5afed3e6ec..f4240f7ddd 100644 +index 5afed3e6ecb4..f4240f7dddb2 100644 --- a/libavcodec/v4l2_context.h +++ b/libavcodec/v4l2_context.h @@ -151,6 +151,19 @@ int ff_v4l2_context_set_format(V4L2Context* ctx); @@ -38043,7 +38043,7 @@ index 5afed3e6ec..f4240f7ddd 100644 * Releases a V4L2Context. * diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c -index 584e0b8825..c4f38cc24e 100644 +index 584e0b8825f9..c4f38cc24e1f 100644 --- a/libavcodec/v4l2_m2m_dec.c +++ b/libavcodec/v4l2_m2m_dec.c @@ -873,10 +873,9 @@ check_profile(AVCodecContext *const avctx, V4L2m2mContext *const s) @@ -38211,10 +38211,10 @@ index 584e0b8825..c4f38cc24e 100644 } -From 24221a3f821043f1ce11dcd1682b986e44ae4513 Mon Sep 17 00:00:00 2001 +From ff30fb1c60c9753eb42d107f083bdadea7918ebe Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Aug 2023 06:26:35 +0000 -Subject: [PATCH 158/161] v4l2_req_dmabufs: Fix crash on free if dmabuf +Subject: [PATCH 158/186] v4l2_req_dmabufs: Fix crash on free if dmabuf imported Thanks to Ratchanan Srirattanamet for finding this @@ -38223,7 +38223,7 @@ Thanks to Ratchanan Srirattanamet for finding this 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c -index acc0366e76..017c3892a5 100644 +index acc0366e7630..017c3892a593 100644 --- a/libavcodec/v4l2_req_dmabufs.c +++ b/libavcodec/v4l2_req_dmabufs.c @@ -232,7 +232,8 @@ void dmabuf_free(struct dmabuf_h * dh) @@ -38237,10 +38237,10 @@ index acc0366e76..017c3892a5 100644 if (dh->mapptr != MAP_FAILED && dh->mapptr != NULL) munmap(dh->mapptr, dh->size); -From 05ceac3f3a7b5a04cc50c769a489e819895ca345 Mon Sep 17 00:00:00 2001 +From 7342db8c6a46af0ebe38369cb1cce6eacaeed528 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Aug 2023 06:34:47 +0000 -Subject: [PATCH 159/161] aarch64/rgb2rgb_neon: Fix bgr24->yuv matrix read to +Subject: [PATCH 159/186] aarch64/rgb2rgb_neon: Fix bgr24->yuv matrix read to flip correct way --- @@ -38248,7 +38248,7 @@ Subject: [PATCH 159/161] aarch64/rgb2rgb_neon: Fix bgr24->yuv matrix read to 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S -index 476ca723a0..077d1dd593 100644 +index 476ca723a0ef..077d1dd5938a 100644 --- a/libswscale/aarch64/rgb2rgb_neon.S +++ b/libswscale/aarch64/rgb2rgb_neon.S @@ -92,15 +92,12 @@ endfunc @@ -38274,10 +38274,10 @@ index 476ca723a0..077d1dd593 100644 endfunc -From 2860e13304a1b051f06110d2002b3371266d9e7f Mon Sep 17 00:00:00 2001 +From 2de40aab0aa4e2ee9be96b60efda8f5e99a4e445 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Aug 2023 06:36:51 +0000 -Subject: [PATCH 160/161] aarch64/rgb2rgb_neon: Add macros to make common code +Subject: [PATCH 160/186] aarch64/rgb2rgb_neon: Add macros to make common code explicit --- @@ -38285,7 +38285,7 @@ Subject: [PATCH 160/161] aarch64/rgb2rgb_neon: Add macros to make common code 1 file changed, 95 insertions(+), 181 deletions(-) diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S -index 077d1dd593..0956800b41 100644 +index 077d1dd5938a..0956800b4185 100644 --- a/libswscale/aarch64/rgb2rgb_neon.S +++ b/libswscale/aarch64/rgb2rgb_neon.S @@ -78,6 +78,67 @@ function ff_interleave_bytes_neon, export=1 @@ -38668,17 +38668,17 @@ index 077d1dd593..0956800b41 100644 st1 {v26.b}[14], [x11] 1: -From d2aa73557f69d03094919873215a8aa9405f00d5 Mon Sep 17 00:00:00 2001 +From d711e7b9dde2ff557dc28f7456a6986db32ed52b Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Aug 2023 08:11:21 +0000 -Subject: [PATCH 161/161] v4l2_req_media: Fix dmabuf fd leak in MMAP mode +Subject: [PATCH 161/186] v4l2_req_media: Fix dmabuf fd leak in MMAP mode --- libavcodec/v4l2_req_media.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c -index 1a9944774a..0394bb2b23 100644 +index 1a9944774a48..0394bb2b23f3 100644 --- a/libavcodec/v4l2_req_media.c +++ b/libavcodec/v4l2_req_media.c @@ -1205,8 +1205,10 @@ qe_import_from_buf(struct mediabufs_ctl *const mbc, struct qent_base * const be, @@ -38693,3 +38693,1813 @@ index 1a9944774a..0394bb2b23 100644 } else { be->dh[i] = dmabuf_import_mmap( + +From 3b3a95a51be4c5187808b55d41d98c71a67b91f6 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 6 Sep 2023 14:36:41 +0100 +Subject: [PATCH 162/186] v4l2m2m_dec: Having calculated available pixfmt + actually pass them to user + +--- + libavcodec/v4l2_m2m_dec.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c +index c4f38cc24e1f..f67dd23ba1cc 100644 +--- a/libavcodec/v4l2_m2m_dec.c ++++ b/libavcodec/v4l2_m2m_dec.c +@@ -1099,6 +1099,7 @@ choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) + fmts2[n++] = AV_PIX_FMT_DRM_PRIME; + for (i = 0; i != fmts_n; ++i) { + const enum AVPixelFormat f = ff_v4l2_format_v4l2_to_avfmt(fmts[i], AV_CODEC_ID_RAWVIDEO); ++ av_log(avctx, AV_LOG_TRACE, "VLC pix %s -> %s\n", av_fourcc2str(fmts[i]), av_get_pix_fmt_name(f)); + if (f == AV_PIX_FMT_NONE) + continue; + +@@ -1121,7 +1122,7 @@ choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) + fmts2[n - 1] = fmts2[pref_n]; + fmts2[pref_n] = t; + +- gf_pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); ++ gf_pix_fmt = ff_get_format(avctx, fmts2); + av_log(avctx, AV_LOG_DEBUG, "avctx requested=%d (%s) %dx%d; get_format requested=%d (%s)\n", + avctx->pix_fmt, av_get_pix_fmt_name(avctx->pix_fmt), + avctx->coded_width, avctx->coded_height, + +From 1760b9854cda4fd94d19d2529a71134c69809b98 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 6 Sep 2023 14:45:16 +0100 +Subject: [PATCH 163/186] v4l2m2m: Simplify reinit - also fixes fmt selection + +--- + libavcodec/v4l2_context.c | 41 +++++++++++++++------------------------ + 1 file changed, 16 insertions(+), 25 deletions(-) + +diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c +index 978a487ca98d..ed126f8f2b35 100644 +--- a/libavcodec/v4l2_context.c ++++ b/libavcodec/v4l2_context.c +@@ -28,6 +28,7 @@ + #include + #include + #include "libavutil/avassert.h" ++#include "libavutil/pixdesc.h" + #include "libavcodec/avcodec.h" + #include "decode.h" + #include "v4l2_buffers.h" +@@ -357,13 +358,23 @@ static int do_source_change(V4L2m2mContext * const s) + + s->capture.sample_aspect_ratio = v4l2_get_sar(&s->capture); + +- av_log(avctx, AV_LOG_DEBUG, "Source change: SAR: %d/%d, wxh %dx%d crop %dx%d @ %d,%d, reinit=%d\n", ++ av_log(avctx, AV_LOG_DEBUG, "Source change: Fmt: %s, SAR: %d/%d, wxh %dx%d crop %dx%d @ %d,%d, reinit=%d\n", ++ av_fourcc2str(ff_v4l2_get_format_pixelformat(&cap_fmt)), + s->capture.sample_aspect_ratio.num, s->capture.sample_aspect_ratio.den, + s->capture.width, s->capture.height, + s->capture.selection.width, s->capture.selection.height, + s->capture.selection.left, s->capture.selection.top, reinit); + +- if (reinit) { ++ ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF); ++ if (ret) ++ av_log(avctx, AV_LOG_ERROR, "capture VIDIOC_STREAMOFF failed\n"); ++ s->draining = 0; ++ ++ if (!reinit) { ++ /* Buffers are OK so just stream off to ack */ ++ av_log(avctx, AV_LOG_DEBUG, "%s: Parameters only - restart decode\n", __func__); ++ } ++ else { + if (avctx) + ret = ff_set_dimensions(s->avctx, + s->capture.selection.width != 0 ? s->capture.selection.width : s->capture.width, +@@ -371,11 +382,7 @@ static int do_source_change(V4L2m2mContext * const s) + if (ret < 0) + av_log(avctx, AV_LOG_WARNING, "update avcodec height and width failed\n"); + +- ret = ff_v4l2_m2m_codec_reinit(s); +- if (ret) { +- av_log(avctx, AV_LOG_ERROR, "v4l2_m2m_codec_reinit failed\n"); +- return AVERROR(EINVAL); +- } ++ ff_v4l2_context_release(&s->capture); + + if (s->capture.width > ff_v4l2_get_format_width(&s->capture.format) || + s->capture.height > ff_v4l2_get_format_height(&s->capture.format)) { +@@ -388,26 +395,10 @@ static int do_source_change(V4L2m2mContext * const s) + // Update pixel format - should only actually do something on initial change + s->capture.av_pix_fmt = + ff_v4l2_format_v4l2_to_avfmt(ff_v4l2_get_format_pixelformat(&s->capture.format), AV_CODEC_ID_RAWVIDEO); +- if (s->output_drm) { +- avctx->pix_fmt = AV_PIX_FMT_DRM_PRIME; +- avctx->sw_pix_fmt = s->capture.av_pix_fmt; +- } +- else +- avctx->pix_fmt = s->capture.av_pix_fmt; +- +- goto reinit_run; ++ avctx->pix_fmt = s->output_drm ? AV_PIX_FMT_DRM_PRIME : s->capture.av_pix_fmt; ++ avctx->sw_pix_fmt = s->capture.av_pix_fmt; + } + +- /* Buffers are OK so just stream off to ack */ +- av_log(avctx, AV_LOG_DEBUG, "%s: Parameters only - restart decode\n", __func__); +- +- ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMOFF); +- if (ret) +- av_log(avctx, AV_LOG_ERROR, "capture VIDIOC_STREAMOFF failed\n"); +- s->draining = 0; +- +- /* reinit executed */ +-reinit_run: + ret = ff_v4l2_context_set_status(&s->capture, VIDIOC_STREAMON); + return 1; + } + +From caf47c030e05c78d18db72d3ba979b933c0579e5 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Fri, 8 Sep 2023 12:13:38 +0000 +Subject: [PATCH 164/186] v4l2: Add (more) RGB formats to DRM & V4L2 + +--- + libavcodec/v4l2_buffers.c | 33 +++++++++++++++++++++++++++++++++ + libavcodec/v4l2_fmt.c | 8 ++++++++ + 2 files changed, 41 insertions(+) + +diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c +index 8d80d1978830..e7b57322162f 100644 +--- a/libavcodec/v4l2_buffers.c ++++ b/libavcodec/v4l2_buffers.c +@@ -390,6 +390,39 @@ static uint8_t * v4l2_get_drm_frame(V4L2Buffer *avbuf) + } + + switch (avbuf->context->av_pix_fmt) { ++ case AV_PIX_FMT_0BGR: ++ layer->format = DRM_FORMAT_RGBX8888; ++ break; ++ case AV_PIX_FMT_RGB0: ++ layer->format = DRM_FORMAT_XBGR8888; ++ break; ++ case AV_PIX_FMT_0RGB: ++ layer->format = DRM_FORMAT_BGRX8888; ++ break; ++ case AV_PIX_FMT_BGR0: ++ layer->format = DRM_FORMAT_XRGB8888; ++ break; ++ ++ case AV_PIX_FMT_ABGR: ++ layer->format = DRM_FORMAT_RGBA8888; ++ break; ++ case AV_PIX_FMT_RGBA: ++ layer->format = DRM_FORMAT_ABGR8888; ++ break; ++ case AV_PIX_FMT_ARGB: ++ layer->format = DRM_FORMAT_BGRA8888; ++ break; ++ case AV_PIX_FMT_BGRA: ++ layer->format = DRM_FORMAT_ARGB8888; ++ break; ++ ++ case AV_PIX_FMT_BGR24: ++ layer->format = DRM_FORMAT_BGR888; ++ break; ++ case AV_PIX_FMT_RGB24: ++ layer->format = DRM_FORMAT_RGB888; ++ break; ++ + case AV_PIX_FMT_YUYV422: + + layer->format = DRM_FORMAT_YUYV; +diff --git a/libavcodec/v4l2_fmt.c b/libavcodec/v4l2_fmt.c +index 6df47e3f5a3c..c820a1d5227b 100644 +--- a/libavcodec/v4l2_fmt.c ++++ b/libavcodec/v4l2_fmt.c +@@ -42,6 +42,14 @@ static const struct fmt_conversion { + { AV_FMT(RGB24), AV_CODEC(RAWVIDEO), V4L2_FMT(RGB24) }, + { AV_FMT(BGR0), AV_CODEC(RAWVIDEO), V4L2_FMT(BGR32) }, + { AV_FMT(0RGB), AV_CODEC(RAWVIDEO), V4L2_FMT(RGB32) }, ++ { AV_FMT(BGR0), AV_CODEC(RAWVIDEO), V4L2_FMT(BGRX32) }, ++ { AV_FMT(RGB0), AV_CODEC(RAWVIDEO), V4L2_FMT(RGBX32) }, ++ { AV_FMT(0BGR), AV_CODEC(RAWVIDEO), V4L2_FMT(XBGR32) }, ++ { AV_FMT(0RGB), AV_CODEC(RAWVIDEO), V4L2_FMT(XRGB32) }, ++ { AV_FMT(BGRA), AV_CODEC(RAWVIDEO), V4L2_FMT(BGRA32) }, ++ { AV_FMT(RGBA), AV_CODEC(RAWVIDEO), V4L2_FMT(RGBA32) }, ++ { AV_FMT(ABGR), AV_CODEC(RAWVIDEO), V4L2_FMT(ABGR32) }, ++ { AV_FMT(ARGB), AV_CODEC(RAWVIDEO), V4L2_FMT(ARGB32) }, + { AV_FMT(GRAY8), AV_CODEC(RAWVIDEO), V4L2_FMT(GREY) }, + { AV_FMT(YUV420P), AV_CODEC(RAWVIDEO), V4L2_FMT(YUV420) }, + { AV_FMT(YUYV422), AV_CODEC(RAWVIDEO), V4L2_FMT(YUYV) }, + +From 975422cbef7048a32ef0f8768a07a96d2d63a42d Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 24 Oct 2023 12:54:02 +0100 +Subject: [PATCH 165/186] dmabuf: Use vidbuf_cached for dmabuf allocation + +Gates usage to kernel 6.1.57 and later as that is when the rpivid iommu +patch was merged. + +(cherry picked from commit 9a898f4ea127b30f1ca81eb98dfba3dd101db179) +--- + libavcodec/v4l2_req_dmabufs.c | 73 ++++++++++++++++++++++++++-------- + libavcodec/v4l2_req_dmabufs.h | 1 + + libavcodec/v4l2_request_hevc.c | 49 ++++++++++++----------- + 3 files changed, 83 insertions(+), 40 deletions(-) + +diff --git a/libavcodec/v4l2_req_dmabufs.c b/libavcodec/v4l2_req_dmabufs.c +index 017c3892a593..9a4b69d3fa5a 100644 +--- a/libavcodec/v4l2_req_dmabufs.c ++++ b/libavcodec/v4l2_req_dmabufs.c +@@ -15,11 +15,12 @@ + #include "v4l2_req_dmabufs.h" + #include "v4l2_req_utils.h" + +-#define DMABUF_NAME1 "/dev/dma_heap/linux,cma" +-#define DMABUF_NAME2 "/dev/dma_heap/reserved" +- + #define TRACE_ALLOC 0 + ++#ifndef __O_CLOEXEC ++#define __O_CLOEXEC 0 ++#endif ++ + struct dmabufs_ctl; + struct dmabuf_h; + +@@ -297,23 +298,33 @@ struct dmabufs_ctl * dmabufs_ctl_ref(struct dmabufs_ctl * const dbsc) + // + // Alloc dmabuf via CMA + +-static int ctl_cma_new(struct dmabufs_ctl * dbsc) ++static int ctl_cma_new2(struct dmabufs_ctl * dbsc, const char * const * names) + { +- while ((dbsc->fd = open(DMABUF_NAME1, O_RDWR)) == -1 && +- errno == EINTR) +- /* Loop */; +- +- if (dbsc->fd == -1) { +- while ((dbsc->fd = open(DMABUF_NAME2, O_RDWR)) == -1 && ++ for (; *names != NULL; ++names) ++ { ++ while ((dbsc->fd = open(*names, O_RDWR | __O_CLOEXEC)) == -1 && + errno == EINTR) + /* Loop */; +- if (dbsc->fd == -1) { +- request_log("Unable to open either %s or %s\n", +- DMABUF_NAME1, DMABUF_NAME2); +- return -1; ++ if (dbsc->fd != -1) ++ { ++ request_debug(NULL, "%s: Using dma_heap device %s\n", __func__, *names); ++ return 0; + } ++ request_debug(NULL, "%s: Not using dma_heap device %s: %s\n", __func__, *names, strerror(errno)); + } +- return 0; ++ request_log("Unable to open any dma_heap device\n"); ++ return -1; ++} ++ ++static int ctl_cma_new(struct dmabufs_ctl * dbsc) ++{ ++ static const char * const names[] = { ++ "/dev/dma_heap/linux,cma", ++ "/dev/dma_heap/reserved", ++ NULL ++ }; ++ ++ return ctl_cma_new2(dbsc, names); + } + + static void ctl_cma_free(struct dmabufs_ctl * dbsc) +@@ -321,7 +332,6 @@ static void ctl_cma_free(struct dmabufs_ctl * dbsc) + if (dbsc->fd != -1) + while (close(dbsc->fd) == -1 && errno == EINTR) + /* loop */; +- + } + + static int buf_cma_alloc(struct dmabufs_ctl * const dbsc, struct dmabuf_h * dh, size_t size) +@@ -347,6 +357,10 @@ static int buf_cma_alloc(struct dmabufs_ctl * const dbsc, struct dmabuf_h * dh, + + dh->fd = data.fd; + dh->size = (size_t)data.len; ++ ++// fprintf(stderr, "%s: size=%#zx, ftell=%#zx\n", __func__, ++// dh->size, (size_t)lseek(dh->fd, 0, SEEK_END)); ++ + return 0; + } + +@@ -364,7 +378,32 @@ static const struct dmabuf_fns dmabuf_cma_fns = { + + struct dmabufs_ctl * dmabufs_ctl_new(void) + { +- request_debug(NULL, "Dmabufs using CMA\n");; ++ request_debug(NULL, "Dmabufs using CMA\n"); + return dmabufs_ctl_new2(&dmabuf_cma_fns); + } + ++static int ctl_cma_new_vidbuf_cached(struct dmabufs_ctl * dbsc) ++{ ++ static const char * const names[] = { ++ "/dev/dma_heap/vidbuf_cached", ++ "/dev/dma_heap/linux,cma", ++ "/dev/dma_heap/reserved", ++ NULL ++ }; ++ ++ return ctl_cma_new2(dbsc, names); ++} ++ ++static const struct dmabuf_fns dmabuf_vidbuf_cached_fns = { ++ .buf_alloc = buf_cma_alloc, ++ .buf_free = buf_cma_free, ++ .ctl_new = ctl_cma_new_vidbuf_cached, ++ .ctl_free = ctl_cma_free, ++}; ++ ++struct dmabufs_ctl * dmabufs_ctl_new_vidbuf_cached(void) ++{ ++ request_debug(NULL, "Dmabufs using Vidbuf\n"); ++ return dmabufs_ctl_new2(&dmabuf_vidbuf_cached_fns); ++} ++ +diff --git a/libavcodec/v4l2_req_dmabufs.h b/libavcodec/v4l2_req_dmabufs.h +index 381ba2708da6..8c1ab0b5df5e 100644 +--- a/libavcodec/v4l2_req_dmabufs.h ++++ b/libavcodec/v4l2_req_dmabufs.h +@@ -7,6 +7,7 @@ struct dmabufs_ctl; + struct dmabuf_h; + + struct dmabufs_ctl * dmabufs_ctl_new(void); ++struct dmabufs_ctl * dmabufs_ctl_new_vidbuf_cached(void); + void dmabufs_ctl_unref(struct dmabufs_ctl ** const pdbsc); + struct dmabufs_ctl * dmabufs_ctl_ref(struct dmabufs_ctl * const dbsc); + +diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c +index db7ed13b6d76..5b37319d6aa9 100644 +--- a/libavcodec/v4l2_request_hevc.c ++++ b/libavcodec/v4l2_request_hevc.c +@@ -176,17 +176,6 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) + av_log(avctx, AV_LOG_DEBUG, "Trying V4L2 devices: %s,%s\n", + decdev_media_path(decdev), decdev_video_path(decdev)); + +- if ((ctx->dbufs = dmabufs_ctl_new()) == NULL) { +- av_log(avctx, AV_LOG_DEBUG, "Unable to open dmabufs - try mmap buffers\n"); +- src_memtype = MEDIABUFS_MEMORY_MMAP; +- dst_memtype = MEDIABUFS_MEMORY_MMAP; +- } +- else { +- av_log(avctx, AV_LOG_DEBUG, "Dmabufs opened - try dmabuf buffers\n"); +- src_memtype = MEDIABUFS_MEMORY_DMABUF; +- dst_memtype = MEDIABUFS_MEMORY_DMABUF; +- } +- + if ((ctx->pq = pollqueue_new()) == NULL) { + av_log(avctx, AV_LOG_ERROR, "Unable to create pollqueue\n"); + goto fail1; +@@ -202,6 +191,25 @@ static int v4l2_request_hevc_init(AVCodecContext *avctx) + goto fail3; + } + ++ // Version test for functional Pi5 HEVC iommu. ++ // rpivid kernel patch was merged in 6.1.57 ++ // *** Remove when it is unlikely that there are any broken kernels left ++ if (mediabufs_ctl_driver_version(ctx->mbufs) >= MEDIABUFS_DRIVER_VERSION(6,1,57)) ++ ctx->dbufs = dmabufs_ctl_new_vidbuf_cached(); ++ else ++ ctx->dbufs = dmabufs_ctl_new(); ++ ++ if (ctx->dbufs == NULL) { ++ av_log(avctx, AV_LOG_DEBUG, "Unable to open dmabufs - try mmap buffers\n"); ++ src_memtype = MEDIABUFS_MEMORY_MMAP; ++ dst_memtype = MEDIABUFS_MEMORY_MMAP; ++ } ++ else { ++ av_log(avctx, AV_LOG_DEBUG, "Dmabufs opened - try dmabuf buffers\n"); ++ src_memtype = MEDIABUFS_MEMORY_DMABUF; ++ dst_memtype = MEDIABUFS_MEMORY_DMABUF; ++ } ++ + // Ask for an initial bitbuf size of max size / 4 + // We will realloc if we need more + // Must use sps->h/w as avctx contains cropped size +@@ -229,23 +237,15 @@ retry_src_memtype: + goto fail4; + } + +- if (V2(ff_v4l2_req_hevc, 4).probe(avctx, ctx) == 0) { +- av_log(avctx, AV_LOG_DEBUG, "HEVC API version 4 probed successfully\n"); ++ if (V2(ff_v4l2_req_hevc, 4).probe(avctx, ctx) == 0) + ctx->fns = &V2(ff_v4l2_req_hevc, 4); +- } + #if CONFIG_V4L2_REQ_HEVC_VX +- else if (V2(ff_v4l2_req_hevc, 3).probe(avctx, ctx) == 0) { +- av_log(avctx, AV_LOG_DEBUG, "HEVC API version 3 probed successfully\n"); ++ else if (V2(ff_v4l2_req_hevc, 3).probe(avctx, ctx) == 0) + ctx->fns = &V2(ff_v4l2_req_hevc, 3); +- } +- else if (V2(ff_v4l2_req_hevc, 2).probe(avctx, ctx) == 0) { +- av_log(avctx, AV_LOG_DEBUG, "HEVC API version 2 probed successfully\n"); ++ else if (V2(ff_v4l2_req_hevc, 2).probe(avctx, ctx) == 0) + ctx->fns = &V2(ff_v4l2_req_hevc, 2); +- } +- else if (V2(ff_v4l2_req_hevc, 1).probe(avctx, ctx) == 0) { +- av_log(avctx, AV_LOG_DEBUG, "HEVC API version 1 probed successfully\n"); ++ else if (V2(ff_v4l2_req_hevc, 1).probe(avctx, ctx) == 0) + ctx->fns = &V2(ff_v4l2_req_hevc, 1); +- } + #endif + else { + av_log(avctx, AV_LOG_ERROR, "No HEVC version probed successfully\n"); +@@ -253,6 +253,9 @@ retry_src_memtype: + goto fail4; + } + ++ av_log(avctx, AV_LOG_DEBUG, "%s probed successfully: driver v %#x\n", ++ ctx->fns->name, mediabufs_ctl_driver_version(ctx->mbufs)); ++ + if (mediabufs_dst_fmt_set(ctx->mbufs, sps->width, sps->height, dst_fmt_accept_cb, avctx)) { + char tbuf1[5]; + av_log(avctx, AV_LOG_ERROR, "Failed to set destination format: %s %dx%d\n", strfourcc(tbuf1, src_pix_fmt), sps->width, sps->height); + +From dd548f4cf1828f957b6d72021233813c49ac5c7c Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Thu, 11 Jan 2024 18:27:35 +0000 +Subject: [PATCH 166/186] v4l2_m2m_dec: Move drm_prime hwframecontext setup to + after 1st frame + +(cherry picked from commit 2b9675fdbb3c99a08055366a3a9a216d1369ec9c) +--- + libavcodec/v4l2_buffers.c | 4 +++ + libavcodec/v4l2_context.c | 63 ++++++++++++++++++++++++--------------- + libavcodec/v4l2_context.h | 8 +++++ + 3 files changed, 51 insertions(+), 24 deletions(-) + +diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c +index e7b57322162f..e412636a7a13 100644 +--- a/libavcodec/v4l2_buffers.c ++++ b/libavcodec/v4l2_buffers.c +@@ -607,6 +607,10 @@ static int v4l2_buffer_buf_to_swframe(AVFrame *frame, V4L2Buffer *avbuf) + + if (buf_to_m2mctx(avbuf)->output_drm) { + /* 1. get references to the actual data */ ++ const int rv = ff_v4l2_context_frames_set(avbuf->context); ++ if (rv != 0) ++ return rv; ++ + frame->data[0] = (uint8_t *) v4l2_get_drm_frame(avbuf); + frame->format = AV_PIX_FMT_DRM_PRIME; + frame->hw_frames_ctx = av_buffer_ref(avbuf->context->frames_ref); +diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c +index ed126f8f2b35..a01a105892ab 100644 +--- a/libavcodec/v4l2_context.c ++++ b/libavcodec/v4l2_context.c +@@ -1227,6 +1227,42 @@ fail_release: + return ret; + } + ++int ff_v4l2_context_frames_set(V4L2Context *const ctx) ++{ ++ AVHWFramesContext *hwframes; ++ V4L2m2mContext * const s = ctx_to_m2mctx(ctx); ++ const int w = ctx->width != 0 ? ctx->width : s->avctx->width; ++ const int h = ctx->height != 0 ? ctx->height : s->avctx->height; ++ int ret; ++ ++ if (ctx->frames_ref != NULL) { ++ const AVHWFramesContext * const hwf = (AVHWFramesContext*)ctx->frames_ref->data; ++ if (hwf->sw_format == ctx->av_pix_fmt && hwf->width == w && hwf->height == h) ++ return 0; ++ av_buffer_unref(&ctx->frames_ref); ++ } ++ ++ ctx->frames_ref = av_hwframe_ctx_alloc(s->device_ref); ++ if (!ctx->frames_ref) ++ return AVERROR(ENOMEM); ++ ++ hwframes = (AVHWFramesContext*)ctx->frames_ref->data; ++ hwframes->format = AV_PIX_FMT_DRM_PRIME; ++ hwframes->sw_format = ctx->av_pix_fmt; ++ hwframes->width = w; ++ hwframes->height = h; ++ ret = av_hwframe_ctx_init(ctx->frames_ref); ++ if (ret < 0) { ++ av_log(s->avctx, AV_LOG_ERROR, "Failed to create hwframes context: %s\n", av_err2str(ret)); ++ av_buffer_unref(&ctx->frames_ref); ++ return ret; ++ } ++ ++ av_log(s->avctx, AV_LOG_DEBUG, "%s: HWFramesContext set to %s, %dx%d\n", __func__, ++ av_get_pix_fmt_name(ctx->av_pix_fmt), w, h); ++ return 0; ++} ++ + int ff_v4l2_context_init(V4L2Context* ctx) + { + struct v4l2_queryctrl qctrl; +@@ -1245,30 +1281,11 @@ int ff_v4l2_context_init(V4L2Context* ctx) + pthread_cond_init(&ctx->cond, NULL); + atomic_init(&ctx->q_count, 0); + +- if (s->output_drm) { +- AVHWFramesContext *hwframes; +- +- ctx->frames_ref = av_hwframe_ctx_alloc(s->device_ref); +- if (!ctx->frames_ref) { +- ret = AVERROR(ENOMEM); +- goto fail_unlock; +- } +- +- hwframes = (AVHWFramesContext*)ctx->frames_ref->data; +- hwframes->format = AV_PIX_FMT_DRM_PRIME; +- hwframes->sw_format = ctx->av_pix_fmt; +- hwframes->width = ctx->width != 0 ? ctx->width : s->avctx->width; +- hwframes->height = ctx->height != 0 ? ctx->height : s->avctx->height; +- ret = av_hwframe_ctx_init(ctx->frames_ref); +- if (ret < 0) +- goto fail_unref_hwframes; +- } +- + ret = ioctl(s->fd, VIDIOC_G_FMT, &ctx->format); + if (ret) { + ret = AVERROR(errno); + av_log(logger(ctx), AV_LOG_ERROR, "%s VIDIOC_G_FMT failed: %s\n", ctx->name, av_err2str(ret)); +- goto fail_unref_hwframes; ++ goto fail_unlock; + } + + memset(&qctrl, 0, sizeof(qctrl)); +@@ -1277,7 +1294,7 @@ int ff_v4l2_context_init(V4L2Context* ctx) + ret = AVERROR(errno); + if (ret != AVERROR(EINVAL)) { + av_log(logger(ctx), AV_LOG_ERROR, "%s VIDIOC_QUERCTRL failed: %s\n", ctx->name, av_err2str(ret)); +- goto fail_unref_hwframes; ++ goto fail_unlock; + } + // Control unsupported - set default if wanted + if (ctx->num_buffers < 2) +@@ -1291,12 +1308,10 @@ int ff_v4l2_context_init(V4L2Context* ctx) + + ret = create_buffers(ctx, ctx->num_buffers, ctx->buf_mem); + if (ret < 0) +- goto fail_unref_hwframes; ++ goto fail_unlock; + + return 0; + +-fail_unref_hwframes: +- av_buffer_unref(&ctx->frames_ref); + fail_unlock: + ff_mutex_destroy(&ctx->lock); + return ret; +diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h +index f4240f7dddb2..9f1c05a918ff 100644 +--- a/libavcodec/v4l2_context.h ++++ b/libavcodec/v4l2_context.h +@@ -134,6 +134,14 @@ typedef struct V4L2Context { + */ + int ff_v4l2_context_init(V4L2Context* ctx); + ++/** ++ * (re)set the hwframecontext from the current v4l2 context ++ * ++ * @param[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables. ++ * @return 0 in case of success, a negative value representing the error otherwise. ++ */ ++int ff_v4l2_context_frames_set(V4L2Context *const ctx); ++ + /** + * Sets the V4L2Context format in the v4l2 driver. + * + +From 08c71f5f211216b2f9c5b5317682c639cf6c300f Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Fri, 12 Jan 2024 15:17:43 +0000 +Subject: [PATCH 167/186] vf_bwdif: Add capability to deinterlace NV12 + +As bwdif takes no account of horizontally adjacent pixels the same +code can be used on planes that have multiple components as is used +on single component planes. Update the filtering code to cope with +multi-component planes and add NV12 to the list of supported formats. + +Signed-off-by: John Cox +(cherry picked from commit 38338fe9123a01210695e63f05e929f53d6868ff) +--- + libavfilter/vf_bwdif.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c +index 9847d38b6a63..4d69b3039ddf 100644 +--- a/libavfilter/vf_bwdif.c ++++ b/libavfilter/vf_bwdif.c +@@ -302,19 +302,28 @@ static void filter(AVFilterContext *ctx, AVFrame *dstpic, + YADIFContext *yadif = &bwdif->yadif; + ThreadData td = { .frame = dstpic, .parity = parity, .tff = tff }; + int i; ++ int last_plane = -1; + + for (i = 0; i < yadif->csp->nb_components; i++) { + int w = dstpic->width; + int h = dstpic->height; ++ const AVComponentDescriptor * const comp = yadif->csp->comp + i; ++ ++ // If the last plane was the same as this plane assume we've dealt ++ // with all the pels already ++ if (last_plane == comp->plane) ++ continue; ++ last_plane = comp->plane; + + if (i == 1 || i == 2) { + w = AV_CEIL_RSHIFT(w, yadif->csp->log2_chroma_w); + h = AV_CEIL_RSHIFT(h, yadif->csp->log2_chroma_h); + } + +- td.w = w; +- td.h = h; +- td.plane = i; ++ // comp step is in bytes but td.w is in pels ++ td.w = w * comp->step / ((comp->depth + 7) / 8); ++ td.h = h; ++ td.plane = comp->plane; + + ff_filter_execute(ctx, filter_slice, &td, NULL, + FFMIN((h+3)/4, ff_filter_get_nb_threads(ctx))); +@@ -350,6 +359,7 @@ static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUVA420P9, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA444P9, + AV_PIX_FMT_YUVA420P10, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA444P10, + AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16, ++ AV_PIX_FMT_NV12, + AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, + AV_PIX_FMT_GBRAP, AV_PIX_FMT_GBRAP16, + +From 5b910aca795d4a352697fa749fce720a3643178d Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Fri, 12 Jan 2024 16:46:27 +0000 +Subject: [PATCH 168/186] v4l2_m2m_dec: Try to accomodate ffmpegs ideas about + default s/w fmts + +(cherry picked from commit c61de480d628ad60292f3695d7d29b9edd880be3) +--- + libavcodec/v4l2_m2m_dec.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c +index f67dd23ba1cc..38832230794d 100644 +--- a/libavcodec/v4l2_m2m_dec.c ++++ b/libavcodec/v4l2_m2m_dec.c +@@ -1079,7 +1079,6 @@ choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) + unsigned int fmts_n; + uint32_t *fmts = ff_v4l2_context_enum_drm_formats(&s->capture, &fmts_n); + enum AVPixelFormat *fmts2 = NULL; +- enum AVPixelFormat t; + enum AVPixelFormat gf_pix_fmt; + unsigned int i; + unsigned int n = 0; +@@ -1089,7 +1088,7 @@ choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) + if (!fmts) + return AVERROR(ENOENT); + +- if ((fmts2 = av_malloc(sizeof(*fmts2) * (fmts_n + 2))) == NULL) { ++ if ((fmts2 = av_malloc(sizeof(*fmts2) * (fmts_n + 3))) == NULL) { + rv = AVERROR(ENOMEM); + goto error; + } +@@ -1110,17 +1109,25 @@ choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) + pref_n = n; + fmts2[n++] = f; + } +- fmts2[n] = AV_PIX_FMT_NONE; + + if (n < 2) { + av_log(avctx, AV_LOG_DEBUG, "%s: No usable formats found\n", __func__); + goto error; + } + +- // Put preferred s/w format at the end - ff_get_format will put it in sw_pix_fmt +- t = fmts2[n - 1]; +- fmts2[n - 1] = fmts2[pref_n]; +- fmts2[pref_n] = t; ++ if (n != 2) { ++ // ffmpeg.c really only expects one s/w format. It thinks that the ++ // last format in the list is the s/w format of the h/w format but ++ // also chooses the first non-h/w format as the preferred s/w format. ++ // The only way of reconciling this is to dup our preferred format into ++ // both last & first place :-( ++ const enum AVPixelFormat t = fmts2[pref_n]; ++ fmts2[pref_n] = fmts2[1]; ++ fmts2[1] = t; ++ fmts2[n++] = t; ++ } ++ ++ fmts2[n] = AV_PIX_FMT_NONE; + + gf_pix_fmt = ff_get_format(avctx, fmts2); + av_log(avctx, AV_LOG_DEBUG, "avctx requested=%d (%s) %dx%d; get_format requested=%d (%s)\n", + +From d140f93c6d1c54c6bb28ef31051c77e6a3ac8c78 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Thu, 18 Jan 2024 15:57:30 +0000 +Subject: [PATCH 169/186] v4l2_m2m_dec: Fix cma allocated s/w output + +(cherry picked from commit 87cefe4ddad7c36faad052e12268d7e05c5b694a) +--- + libavcodec/v4l2_buffers.c | 33 +++++++++++++++++++++++---------- + 1 file changed, 23 insertions(+), 10 deletions(-) + +diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c +index e412636a7a13..b3ef74bcd48c 100644 +--- a/libavcodec/v4l2_buffers.c ++++ b/libavcodec/v4l2_buffers.c +@@ -486,6 +486,11 @@ static void v4l2_free_bufref(void *opaque, uint8_t *data) + // Buffer still attached to context + V4L2m2mContext *s = buf_to_m2mctx(avbuf); + ++ if (!s->output_drm && avbuf->dmabuf[0] != NULL) { ++ for (unsigned int i = 0; i != avbuf->num_planes; ++i) ++ dmabuf_read_end(avbuf->dmabuf[i]); ++ } ++ + ff_mutex_lock(&ctx->lock); + + ff_v4l2_buffer_set_avail(avbuf); +@@ -533,6 +538,9 @@ static int v4l2_buffer_export_drm(V4L2Buffer* avbuf) + avbuf->buf.m.planes[i].m.fd = dma_fd; + else + avbuf->buf.m.fd = dma_fd; ++ ++ if (!s->output_drm) ++ avbuf->plane_info[i].mm_addr = dmabuf_map(avbuf->dmabuf[i]); + } + else { + struct v4l2_exportbuffer expbuf; +@@ -647,6 +655,11 @@ static int v4l2_buffer_buf_to_swframe(AVFrame *frame, V4L2Buffer *avbuf) + break; + } + ++ if (avbuf->dmabuf[0] != NULL) { ++ for (unsigned int i = 0; i != avbuf->num_planes; ++i) ++ dmabuf_read_start(avbuf->dmabuf[i]); ++ } ++ + return 0; + } + +@@ -947,6 +960,7 @@ int ff_v4l2_buffer_initialize(AVBufferRef ** pbufref, int index, V4L2Context *ct + V4L2Buffer * const avbuf = av_mallocz(sizeof(*avbuf)); + AVBufferRef * bufref; + V4L2m2mContext * const s = ctx_to_m2mctx(ctx); ++ int want_mmap; + + *pbufref = NULL; + if (avbuf == NULL) +@@ -988,10 +1002,10 @@ int ff_v4l2_buffer_initialize(AVBufferRef ** pbufref, int index, V4L2Context *ct + } else + avbuf->num_planes = 1; + +- for (i = 0; i < avbuf->num_planes; i++) { +- const int want_mmap = avbuf->buf.memory == V4L2_MEMORY_MMAP && +- (V4L2_TYPE_IS_OUTPUT(ctx->type) || !buf_to_m2mctx(avbuf)->output_drm); ++ want_mmap = avbuf->buf.memory == V4L2_MEMORY_MMAP && ++ (V4L2_TYPE_IS_OUTPUT(ctx->type) || !buf_to_m2mctx(avbuf)->output_drm); + ++ for (i = 0; i < avbuf->num_planes; i++) { + avbuf->plane_info[i].bytesperline = V4L2_TYPE_IS_MULTIPLANAR(ctx->type) ? + ctx->format.fmt.pix_mp.plane_fmt[i].bytesperline : + ctx->format.fmt.pix.bytesperline; +@@ -1032,13 +1046,12 @@ int ff_v4l2_buffer_initialize(AVBufferRef ** pbufref, int index, V4L2Context *ct + avbuf->buf.length = avbuf->planes[0].length; + } + +- if (!V4L2_TYPE_IS_OUTPUT(ctx->type)) { +- if (s->output_drm) { +- ret = v4l2_buffer_export_drm(avbuf); +- if (ret) { +- av_log(logger(avbuf), AV_LOG_ERROR, "Failed to get exported drm handles\n"); +- goto fail; +- } ++ if (!want_mmap) { ++ // export_drm does dmabuf alloc if we aren't using v4l2 alloc ++ ret = v4l2_buffer_export_drm(avbuf); ++ if (ret) { ++ av_log(logger(avbuf), AV_LOG_ERROR, "Failed to get exported drm handles\n"); ++ goto fail; + } + } + + +From 79d7b3b96768de5d65cdee2b6cd2e91b827f0776 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Mon, 29 Jan 2024 15:12:34 +0000 +Subject: [PATCH 170/186] v4l2_req: Fix media pool delete race + +fds & polltasks associated with media fds that are still in flight are +not freed on delete but the main pool is leading to use after free when +they finally do complete. Stop scanning the free chain on delete and +simply delete everything, in-flight or not. This requires changing alloc +as the buffers weren't previously tracked in-flight. + +(cherry picked from commit 6599b6d1fa1c75d295d5f568a48f8d250250fb7c) +--- + libavcodec/v4l2_req_media.c | 38 ++++++++++++++++++++----------------- + 1 file changed, 21 insertions(+), 17 deletions(-) + +diff --git a/libavcodec/v4l2_req_media.c b/libavcodec/v4l2_req_media.c +index 0394bb2b23f3..c94cc5b0f684 100644 +--- a/libavcodec/v4l2_req_media.c ++++ b/libavcodec/v4l2_req_media.c +@@ -86,6 +86,8 @@ struct media_pool { + int fd; + sem_t sem; + pthread_mutex_t lock; ++ unsigned int pool_n; ++ struct media_request * pool_reqs; + struct media_request * free_reqs; + struct pollqueue * pq; + }; +@@ -251,18 +253,17 @@ int media_request_abort(struct media_request ** const preq) + return 0; + } + +-static void delete_req_chain(struct media_request * const chain) ++static void free_req_pool(struct media_request * const pool, const unsigned int n) + { +- struct media_request * next = chain; +- while (next) { +- struct media_request * const req = next; +- next = req->next; ++ unsigned int i; ++ for (i = 0; i != n; ++i) { ++ struct media_request * const req = pool + i; + if (req->pt) + polltask_delete(&req->pt); + if (req->fd != -1) + close(req->fd); +- free(req); + } ++ free(pool); + } + + struct media_pool * media_pool_new(const char * const media_path, +@@ -283,17 +284,16 @@ struct media_pool * media_pool_new(const char * const media_path, + goto fail1; + } + ++ if ((mp->pool_reqs = calloc(n, sizeof(*mp->pool_reqs))) == NULL) ++ goto fail3; ++ mp->pool_n = n; + for (i = 0; i != n; ++i) { +- struct media_request * req = malloc(sizeof(*req)); +- if (!req) +- goto fail4; ++ mp->pool_reqs[i].mp = mp; ++ mp->pool_reqs[i].fd = -1; ++ } + +- *req = (struct media_request){ +- .next = mp->free_reqs, +- .mp = mp, +- .fd = -1 +- }; +- mp->free_reqs = req; ++ for (i = 0; i != n; ++i) { ++ struct media_request * const req = mp->pool_reqs + i; + + if (ioctl(mp->fd, MEDIA_IOC_REQUEST_ALLOC, &req->fd) == -1) { + request_log("Failed to alloc request %d: %s\n", i, strerror(errno)); +@@ -303,6 +303,9 @@ struct media_pool * media_pool_new(const char * const media_path, + req->pt = polltask_new(pq, req->fd, POLLPRI, media_request_done, req); + if (!req->pt) + goto fail4; ++ ++ req->next = mp->free_reqs, ++ mp->free_reqs = req; + } + + sem_init(&mp->sem, 0, n); +@@ -310,7 +313,8 @@ struct media_pool * media_pool_new(const char * const media_path, + return mp; + + fail4: +- delete_req_chain(mp->free_reqs); ++ free_req_pool(mp->pool_reqs, mp->pool_n); ++fail3: + close(mp->fd); + pthread_mutex_destroy(&mp->lock); + fail1: +@@ -327,7 +331,7 @@ void media_pool_delete(struct media_pool ** pMp) + return; + *pMp = NULL; + +- delete_req_chain(mp->free_reqs); ++ free_req_pool(mp->pool_reqs, mp->pool_n); + close(mp->fd); + sem_destroy(&mp->sem); + pthread_mutex_destroy(&mp->lock); + +From 041844bf65a92134d2d4cb4036b6a31ce1bf2693 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 30 Jan 2024 14:24:59 +0000 +Subject: [PATCH 171/186] drm_vout: Fix connector etc. desc memory leak + +(cherry picked from commit 2f95ad366697901acb114a6d2a45810180f3652d) +--- + libavdevice/drm_vout.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libavdevice/drm_vout.c b/libavdevice/drm_vout.c +index 491e1dc60861..275748abdcee 100644 +--- a/libavdevice/drm_vout.c ++++ b/libavdevice/drm_vout.c +@@ -501,6 +501,13 @@ static int find_crtc(struct AVFormatContext * const avctx, int drmfd, struct drm + crtc ? crtc->height : 0, + (s->conId == (int)con->connector_id ? + " (chosen)" : "")); ++ ++ if (crtc) ++ drmModeFreeCrtc(crtc); ++ if (enc) ++ drmModeFreeEncoder(enc); ++ if (con) ++ drmModeFreeConnector(con); + } + + if (!s->conId) { + +From 3300e10481d711b3a872cf0b9a13bd4009011b0b Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 30 Jan 2024 16:20:53 +0000 +Subject: [PATCH 172/186] conf_native: Add --tsan option + +(cherry picked from commit 3b5aa0d31bd420f8a642f6fc7919674b8a5d5b31) +--- + pi-util/conf_native.sh | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/pi-util/conf_native.sh b/pi-util/conf_native.sh +index f0ed1595948b..0dbaa53e97e0 100755 +--- a/pi-util/conf_native.sh ++++ b/pi-util/conf_native.sh +@@ -10,6 +10,8 @@ RPI_KEEPS="" + NOSHARED= + MMAL= + USR_PREFIX= ++TOOLCHAIN= ++R=rel + + while [ "$1" != "" ] ; do + case $1 in +@@ -22,6 +24,10 @@ while [ "$1" != "" ] ; do + --usr) + USR_PREFIX=/usr + ;; ++ --tsan) ++ TOOLCHAIN="--toolchain=gcc-tsan" ++ R=tsan ++ ;; + *) + echo "Usage $0: [--noshared] [--mmal] [--usr]" + echo " noshared Build static libs and executable - good for testing" +@@ -82,11 +88,11 @@ V=`cat RELEASE` + SHARED_LIBS="--enable-shared" + if [ $NOSHARED ]; then + SHARED_LIBS="--disable-shared" +- OUT=$BUILDBASE/$B-$C-$V-static-rel ++ OUT=$BUILDBASE/$B-$C-$V-static-$R + echo Static libs + else + echo Shared libs +- OUT=$BUILDBASE/$B-$C-$V-shared-rel ++ OUT=$BUILDBASE/$B-$C-$V-shared-$R + fi + + if [ ! $USR_PREFIX ]; then +@@ -106,6 +112,7 @@ $FFSRC/configure \ + --libdir=$LIB_PREFIX\ + --incdir=$INC_PREFIX\ + $MCOPTS\ ++ $TOOLCHAIN\ + --disable-stripping\ + --disable-thumb\ + --enable-sand\ + +From 8f62193afd1823882eee4d7ce81b989dd881640c Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 30 Jan 2024 16:25:53 +0000 +Subject: [PATCH 173/186] v4l2_m2m: Rework use of ctx->lock to avoid use while + uninit + +(cherry picked from commit 024508c338bd707f0a9d34cdf660984171da1a6a) +--- + libavcodec/v4l2_buffers.c | 9 ++-- + libavcodec/v4l2_context.c | 86 +++++++++++++++++++++++++++------------ + 2 files changed, 63 insertions(+), 32 deletions(-) + +diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c +index b3ef74bcd48c..e844a1a0b67d 100644 +--- a/libavcodec/v4l2_buffers.c ++++ b/libavcodec/v4l2_buffers.c +@@ -484,7 +484,7 @@ static void v4l2_free_bufref(void *opaque, uint8_t *data) + + if (ctx != NULL) { + // Buffer still attached to context +- V4L2m2mContext *s = buf_to_m2mctx(avbuf); ++ V4L2m2mContext * const s = ctx_to_m2mctx(ctx); + + if (!s->output_drm && avbuf->dmabuf[0] != NULL) { + for (unsigned int i = 0; i != avbuf->num_planes; ++i) +@@ -494,15 +494,14 @@ static void v4l2_free_bufref(void *opaque, uint8_t *data) + ff_mutex_lock(&ctx->lock); + + ff_v4l2_buffer_set_avail(avbuf); ++ avbuf->buf.timestamp.tv_sec = 0; ++ avbuf->buf.timestamp.tv_usec = 0; + +- if (s->draining && V4L2_TYPE_IS_OUTPUT(ctx->type)) { ++ if (V4L2_TYPE_IS_OUTPUT(ctx->type)) { + av_log(logger(avbuf), AV_LOG_DEBUG, "%s: Buffer avail\n", ctx->name); +- /* no need to queue more buffers to the driver */ + } + else if (ctx->streamon) { + av_log(logger(avbuf), AV_LOG_DEBUG, "%s: Buffer requeue\n", ctx->name); +- avbuf->buf.timestamp.tv_sec = 0; +- avbuf->buf.timestamp.tv_usec = 0; + ff_v4l2_buffer_enqueue(avbuf); // will set to IN_DRIVER + } + else { +diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c +index a01a105892ab..0d61a432c3c8 100644 +--- a/libavcodec/v4l2_context.c ++++ b/libavcodec/v4l2_context.c +@@ -906,56 +906,88 @@ static int stuff_all_buffers(AVCodecContext * avctx, V4L2Context* ctx) + } + } + ++ ff_mutex_lock(&ctx->lock); + for (i = 0; i < ctx->num_buffers; ++i) { + struct V4L2Buffer * const buf = (struct V4L2Buffer *)ctx->bufrefs[i]->data; + if (buf->status == V4L2BUF_AVAILABLE) { + rv = ff_v4l2_buffer_enqueue(buf); + if (rv < 0) +- return rv; ++ break; + } + } +- return 0; ++ ff_mutex_unlock(&ctx->lock); ++ return rv; + } + +-int ff_v4l2_context_set_status(V4L2Context* ctx, uint32_t cmd) ++static int set_streamon(AVCodecContext * const avctx, V4L2Context*const ctx) + { + int type = ctx->type; + int ret = 0; +- AVCodecContext * const avctx = logger(ctx); ++ ++ if (!V4L2_TYPE_IS_OUTPUT(ctx->type)) ++ stuff_all_buffers(avctx, ctx); ++ ++ if (ioctl(ctx_to_m2mctx(ctx)->fd, VIDIOC_STREAMON, &type) < 0) { ++ ret = AVERROR(errno); ++ av_log(avctx, AV_LOG_ERROR, "%s set status ON failed: err=%s\n", ctx->name, ++ av_err2str(ret)); ++ return ret; ++ } ++ ++ ctx->first_buf = 1; ++ ctx->streamon = 1; ++ ctx->flag_last = 0; ++ av_log(avctx, AV_LOG_DEBUG, "%s set status ON OK\n", ctx->name); ++ return ret; ++} ++ ++static int set_streamoff(AVCodecContext * const avctx, V4L2Context*const ctx) ++{ ++ int type = ctx->type; ++ int ret = 0; ++ const int has_bufs = ctx_buffers_alloced(ctx); + + // Avoid doing anything if there is nothing we can do +- if (cmd == VIDIOC_STREAMOFF && !ctx_buffers_alloced(ctx) && !ctx->streamon) ++ if (!has_bufs && !ctx->streamon) + return 0; + +- ff_mutex_lock(&ctx->lock); +- +- if (cmd == VIDIOC_STREAMON && !V4L2_TYPE_IS_OUTPUT(ctx->type)) +- stuff_all_buffers(avctx, ctx); ++ if (has_bufs) ++ ff_mutex_lock(&ctx->lock); + +- if (ioctl(ctx_to_m2mctx(ctx)->fd, cmd, &type) < 0) { +- const int err = errno; +- av_log(avctx, AV_LOG_ERROR, "%s set status %d (%s) failed: err=%d\n", ctx->name, +- cmd, (cmd == VIDIOC_STREAMON) ? "ON" : "OFF", err); +- ret = AVERROR(err); ++ if (ioctl(ctx_to_m2mctx(ctx)->fd, VIDIOC_STREAMOFF, &type) < 0) { ++ ret = AVERROR(errno); ++ av_log(avctx, AV_LOG_ERROR, "%s set status ON failed: err=%s\n", ctx->name, ++ av_err2str(ret)); + } +- else +- { +- if (cmd == VIDIOC_STREAMOFF) +- flush_all_buffers_status(ctx); +- else +- ctx->first_buf = 1; ++ else { ++ flush_all_buffers_status(ctx); + +- ctx->streamon = (cmd == VIDIOC_STREAMON); +- av_log(avctx, AV_LOG_DEBUG, "%s set status %d (%s) OK\n", ctx->name, +- cmd, (cmd == VIDIOC_STREAMON) ? "ON" : "OFF"); ++ ctx->streamon = 0; ++ ctx->flag_last = 0; ++ ++ av_log(avctx, AV_LOG_DEBUG, "%s set status OFF OK\n", ctx->name); + } + +- // Both stream off & on effectively clear flag_last +- ctx->flag_last = 0; ++ if (has_bufs) ++ ff_mutex_unlock(&ctx->lock); ++ return ret; ++} + +- ff_mutex_unlock(&ctx->lock); + +- return ret; ++int ff_v4l2_context_set_status(V4L2Context* ctx, uint32_t cmd) ++{ ++ AVCodecContext * const avctx = logger(ctx); ++ ++ switch (cmd) { ++ case VIDIOC_STREAMOFF: ++ return set_streamoff(avctx, ctx); ++ case VIDIOC_STREAMON: ++ return set_streamon(avctx, ctx); ++ default: ++ av_log(avctx, AV_LOG_ERROR, "%s: Unexpected cmd: %d\n", __func__, cmd); ++ break; ++ } ++ return AVERROR_BUG; + } + + int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* frame) + +From 76b95699abad71a942280db3b60c7f906b705166 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Thu, 1 Feb 2024 18:11:06 +0000 +Subject: [PATCH 174/186] matroskaenc: Fix H264 delayed extradata creation + +(cherry picked from commit bd60b02509168625e12889068e3f0834148334ca) +--- + libavformat/matroskaenc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c +index 61e4c976ef76..a6a00f03e7c9 100644 +--- a/libavformat/matroskaenc.c ++++ b/libavformat/matroskaenc.c +@@ -1125,7 +1125,7 @@ static int mkv_assemble_native_codecprivate(AVFormatContext *s, AVIOContext *dyn + case AV_CODEC_ID_WAVPACK: + return put_wv_codecpriv(dyn_cp, extradata, extradata_size); + case AV_CODEC_ID_H264: +- if (par->extradata_size) ++ if (extradata_size) + return ff_isom_write_avcc(dyn_cp, extradata, + extradata_size); + else + +From 83da9f5444e5c938bf623622d163c9559aa57cef Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Thu, 1 Feb 2024 18:12:38 +0000 +Subject: [PATCH 175/186] matroskaenc: Assume H264 is Annex B if no extradata + +(cherry picked from commit 7d0cf1279dcf8e97d7dec7f2b7dcd0379b335e3d) +--- + libavformat/matroskaenc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c +index a6a00f03e7c9..131ad31d1bda 100644 +--- a/libavformat/matroskaenc.c ++++ b/libavformat/matroskaenc.c +@@ -3194,9 +3194,15 @@ static int mkv_init(struct AVFormatContext *s) + track->reformat = mkv_reformat_wavpack; + break; + case AV_CODEC_ID_H264: ++ // Default to reformat if no extradata as the only current ++ // encoder which does this is v4l2m2m which needs reformat ++ if (par->extradata_size == 0 || ++ (par->extradata_size > 3 && ++ (AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1))) ++ track->reformat = mkv_reformat_h2645; ++ break; + case AV_CODEC_ID_HEVC: +- if ((par->codec_id == AV_CODEC_ID_H264 && par->extradata_size > 0 || +- par->codec_id == AV_CODEC_ID_HEVC && par->extradata_size > 6) && ++ if (par->extradata_size > 6 && + (AV_RB24(par->extradata) == 1 || AV_RB32(par->extradata) == 1)) + track->reformat = mkv_reformat_h2645; + break; + +From 02eec233a033b677709c641fe3f03a2a8714d750 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Fri, 16 Feb 2024 11:50:56 +0000 +Subject: [PATCH 176/186] aarch64/rgb2rgb: Change incorrect SXTX to stxw + +(cherry picked from commit 4c362244e0f1c41d5af6c95a71da7b32029fa982) +--- + libswscale/aarch64/rgb2rgb_neon.S | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/libswscale/aarch64/rgb2rgb_neon.S b/libswscale/aarch64/rgb2rgb_neon.S +index 0956800b4185..38f83a1b7878 100644 +--- a/libswscale/aarch64/rgb2rgb_neon.S ++++ b/libswscale/aarch64/rgb2rgb_neon.S +@@ -338,8 +338,8 @@ function ff_bgr24toyv12_aarch64, export=1 + b.eq 90f + + subs w9, w4, #0 +- add x0, x0, w14, SXTX +- add x1, x1, w6, SXTX ++ add x0, x0, w14, sxtw ++ add x1, x1, w6, sxtw + mov x10, x0 + mov x11, x1 + b.lt 12f +@@ -424,10 +424,10 @@ function ff_bgr24toyv12_aarch64, export=1 + + // ------------------- Loop to start + +- add x0, x0, w14, SXTX +- add x1, x1, w6, SXTX +- add x2, x2, w7, SXTX +- add x3, x3, w7, SXTX ++ add x0, x0, w14, sxtw ++ add x1, x1, w6, sxtw ++ add x2, x2, w7, sxtw ++ add x3, x3, w7, sxtw + subs w5, w5, #1 + b.gt 11b + 90: + +From 1a20c50471f23cd6976c6606ab53be7ef5a9afb7 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sat, 17 Feb 2024 13:29:36 +0000 +Subject: [PATCH 177/186] aarch64/rpi_sand: Fix building under Clang/LLVM + +The "Arm A64 Instruction Set Architecture" manual says that the MOV +(element) instruction takes the form `MOV .[], +.[]`, where `` is one of B, H, S, or D. Only certain +other instructions accept a number in front. GNU as allows you to +include it for any instruction, but this is non-standard. This is +explained at https://stackoverflow.com/questions/71907156. + +(cherry picked from commit ba40fd4ff2de0ced75d713c6aac9cdac2d379625) +--- + libavutil/aarch64/rpi_sand_neon.S | 50 +++++++++++++++---------------- + 1 file changed, 25 insertions(+), 25 deletions(-) + +diff --git a/libavutil/aarch64/rpi_sand_neon.S b/libavutil/aarch64/rpi_sand_neon.S +index 11658de0c8c2..3a6bc3de74e5 100644 +--- a/libavutil/aarch64/rpi_sand_neon.S ++++ b/libavutil/aarch64/rpi_sand_neon.S +@@ -387,13 +387,13 @@ function ff_rpi_sand30_lines_to_planar_c16, export=1 + st3 {v0.4h - v2.4h}, [x0], #24 + st3 {v16.4h - v18.4h}, [x2], #24 + beq 11b +- mov v0.2d[0], v0.2d[1] ++ mov v0.d[0], v0.d[1] + sub w9, w9, #12 +- mov v1.2d[0], v1.2d[1] +- mov v2.2d[0], v2.2d[1] +- mov v16.2d[0], v16.2d[1] +- mov v17.2d[0], v17.2d[1] +- mov v18.2d[0], v18.2d[1] ++ mov v1.d[0], v1.d[1] ++ mov v2.d[0], v2.d[1] ++ mov v16.d[0], v16.d[1] ++ mov v17.d[0], v17.d[1] ++ mov v18.d[0], v18.d[1] + 1: + cmp w9, #6-48 + blt 1f +@@ -526,28 +526,28 @@ function ff_rpi_sand30_lines_to_planar_y16, export=1 + blt 1f + st3 {v16.4h, v17.4h, v18.4h}, [x0], #24 + beq 11b +- mov v16.2d[0], v16.2d[1] ++ mov v16.d[0], v16.d[1] + sub w5, w5, #12 +- mov v17.2d[0], v17.2d[1] +- mov v18.2d[0], v18.2d[1] ++ mov v17.d[0], v17.d[1] ++ mov v18.d[0], v18.d[1] + 1: + cmp w5, #6-96 + blt 1f + st3 {v16.h, v17.h, v18.h}[0], [x0], #6 + st3 {v16.h, v17.h, v18.h}[1], [x0], #6 + beq 11b +- mov v16.2s[0], v16.2s[1] ++ mov v16.s[0], v16.s[1] + sub w5, w5, #6 +- mov v17.2s[0], v17.2s[1] +- mov v18.2s[0], v18.2s[1] ++ mov v17.s[0], v17.s[1] ++ mov v18.s[0], v18.s[1] + 1: + cmp w5, #3-96 + blt 1f + st3 {v16.h, v17.h, v18.h}[0], [x0], #6 + beq 11b +- mov v16.4h[0], v16.4h[1] ++ mov v16.h[0], v16.h[1] + sub w5, w5, #3 +- mov v17.4h[0], v17.4h[1] ++ mov v17.h[0], v17.h[1] + 1: + cmp w5, #2-96 + blt 1f +@@ -625,10 +625,10 @@ function ff_rpi_sand30_lines_to_planar_y8, export=1 + blt 1f + st3 {v16.8b, v17.8b, v18.8b}, [x0], #24 + beq 11b +- mov v16.2d[0], v16.2d[1] ++ mov v16.d[0], v16.d[1] + sub w5, w5, #24 +- mov v17.2d[0], v17.2d[1] +- mov v18.2d[0], v18.2d[1] ++ mov v17.d[0], v17.d[1] ++ mov v18.d[0], v18.d[1] + 1: + cmp w5, #12-96 + blt 1f +@@ -637,28 +637,28 @@ function ff_rpi_sand30_lines_to_planar_y8, export=1 + st3 {v16.b, v17.b, v18.b}[2], [x0], #3 + st3 {v16.b, v17.b, v18.b}[3], [x0], #3 + beq 11b +- mov v16.2s[0], v16.2s[1] ++ mov v16.s[0], v16.s[1] + sub w5, w5, #12 +- mov v17.2s[0], v17.2s[1] +- mov v18.2s[0], v18.2s[1] ++ mov v17.s[0], v17.s[1] ++ mov v18.s[0], v18.s[1] + 1: + cmp w5, #6-96 + blt 1f + st3 {v16.b, v17.b, v18.b}[0], [x0], #3 + st3 {v16.b, v17.b, v18.b}[1], [x0], #3 + beq 11b +- mov v16.4h[0], v16.4h[1] ++ mov v16.h[0], v16.h[1] + sub w5, w5, #6 +- mov v17.4h[0], v17.4h[1] +- mov v18.4h[0], v18.4h[1] ++ mov v17.h[0], v17.h[1] ++ mov v18.h[0], v18.h[1] + 1: + cmp w5, #3-96 + blt 1f + st3 {v16.b, v17.b, v18.b}[0], [x0], #3 + beq 11b +- mov v16.8b[0], v16.8b[1] ++ mov v16.b[0], v16.b[1] + sub w5, w5, #3 +- mov v17.8b[0], v17.8b[1] ++ mov v17.b[0], v17.b[1] + 1: + cmp w5, #2-96 + blt 1f + +From 09fa999ad4ea877311216081bba5989c4b44349e Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sat, 17 Feb 2024 14:37:44 +0000 +Subject: [PATCH 178/186] rtpenc: Fix building with GCC 14 + +This incompatible pointer type issue became a fatal error in GCC 14. The +AVBuffer API started using size_t in 5.0 with ef6a9e5e. + +(cherry picked from commit 5d3c1c0213f2d6fe7b310e65def4c44a6c610b18) +--- + libavformat/rtpenc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c +index f67dc2a15ae1..1f1e4cb25ad9 100644 +--- a/libavformat/rtpenc.c ++++ b/libavformat/rtpenc.c +@@ -588,7 +588,7 @@ static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt) + case AV_CODEC_ID_H264: + { + uint8_t *side_data; +- int side_data_size = 0; ++ size_t side_data_size = 0; + + side_data = av_packet_get_side_data(pkt, AV_PKT_DATA_NEW_EXTRADATA, + &side_data_size); + +From 3bf2bc4d72a255aaec4b55bb5fd71258d8d16f67 Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sun, 18 Feb 2024 09:18:31 +0000 +Subject: [PATCH 179/186] v4l2_req: Fix building against musl by including + pthread.h + +(cherry picked from commit d4b70cc3ddd24036e0fd59ad562c6844767e314a) +--- + libavcodec/v4l2_req_decode_q.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/libavcodec/v4l2_req_decode_q.h b/libavcodec/v4l2_req_decode_q.h +index af7bbe1de462..27eafbc42b27 100644 +--- a/libavcodec/v4l2_req_decode_q.h ++++ b/libavcodec/v4l2_req_decode_q.h +@@ -1,6 +1,8 @@ + #ifndef AVCODEC_V4L2_REQ_DECODE_Q_H + #define AVCODEC_V4L2_REQ_DECODE_Q_H + ++#include ++ + typedef struct req_decode_ent { + struct req_decode_ent * next; + struct req_decode_ent * prev; + +From f4af3f1cbbec0bc6fa355bdaf6dcaa01790640d3 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 27 Feb 2024 12:57:08 +0000 +Subject: [PATCH 180/186] v4l2_buffers: Fix init of drmprime source (OUTPUT) + buffers for encode + +Previous fix for mmaped dmabuf CAPTURE buffers broke this due to failure +to note that dmabuf export wasn't wanted for OUTPUT buffers. + +(cherry picked from commit 21859689f25854eb9b46e1efacacf3eca3bef6e8) +--- + libavcodec/v4l2_buffers.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavcodec/v4l2_buffers.c b/libavcodec/v4l2_buffers.c +index e844a1a0b67d..2d1db41a3017 100644 +--- a/libavcodec/v4l2_buffers.c ++++ b/libavcodec/v4l2_buffers.c +@@ -1045,7 +1045,7 @@ int ff_v4l2_buffer_initialize(AVBufferRef ** pbufref, int index, V4L2Context *ct + avbuf->buf.length = avbuf->planes[0].length; + } + +- if (!want_mmap) { ++ if (V4L2_TYPE_IS_CAPTURE(ctx->type) && !want_mmap) { + // export_drm does dmabuf alloc if we aren't using v4l2 alloc + ret = v4l2_buffer_export_drm(avbuf); + if (ret) { + +From 88b5be9784c6f6088d050c09203804142b7b4316 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 9 Jan 2024 09:00:17 +0000 +Subject: [PATCH 181/186] ffconf: Add ability to output yuv files & run + valgrind as part of conform + +(cherry picked from commit 8104e3701b3766976670a1d4afb13704c66a9c94) +--- + pi-util/ffconf.py | 59 ++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 46 insertions(+), 13 deletions(-) + +diff --git a/pi-util/ffconf.py b/pi-util/ffconf.py +index 657568014e57..204e6257fb36 100755 +--- a/pi-util/ffconf.py ++++ b/pi-util/ffconf.py +@@ -14,7 +14,12 @@ HWACCEL_RPI = 2 + HWACCEL_DRM = 3 + HWACCEL_VAAPI = 4 + +-def testone(fileroot, srcname, es_file, md5_file, pix, dectype, vcodec, ffmpeg_exec): ++def testone(fileroot, srcname, es_file, md5_file, pix, dectype, vcodec, args): ++ ffmpeg_exec = args.ffmpeg ++ gen_yuv = args.gen_yuv ++ valgrind = args.valgrind ++ rv = 0 ++ + hwaccel = "" + if dectype == HWACCEL_RPI: + hwaccel = "rpi" +@@ -48,17 +53,29 @@ def testone(fileroot, srcname, es_file, md5_file, pix, dectype, vcodec, ffmpeg_e + except: + pass + +- flog = open(os.path.join(tmp_root, name + ".log"), "wt") ++ yuv_file = os.path.join(tmp_root, name + ".dec.yuv") ++ try: ++ os.remove(yuv_file) ++ except: ++ pass ++ ++ flog = open(os.path.join(tmp_root, name + ".log"), "w+t") + +- ffargs = [ffmpeg_exec, "-flags", "unaligned", "-hwaccel", hwaccel, "-vcodec", "hevc", "-i", os.path.join(fileroot, es_file)] + pix_fmt + ["-f", "md5", dec_file] ++ ffargs = [ffmpeg_exec, "-flags", "unaligned"] +\ ++ (["-hwaccel", hwaccel] if hwaccel else []) +\ ++ ["-vcodec", "hevc", "-i", os.path.join(fileroot, es_file)] +\ ++ pix_fmt +\ ++ ([yuv_file] if gen_yuv else ["-f", "md5", dec_file]) ++ ++ if valgrind: ++ ffargs = ['valgrind', '--leak-check=full'] + ffargs + + # Unaligned needed for cropping conformance +- if hwaccel: +- rstr = subprocess.call(ffargs, stdout=flog, stderr=subprocess.STDOUT) +- else: +- rstr = subprocess.call( +- [ffmpeg_exec, "-flags", "unaligned", "-vcodec", vcodec, "-i", os.path.join(fileroot, es_file), "-f", "md5", dec_file], +- stdout=flog, stderr=subprocess.STDOUT) ++ rstr = subprocess.call(ffargs, stdout=flog, stderr=subprocess.STDOUT) ++ ++ if gen_yuv: ++ with open(dec_file, 'wt') as f: ++ subprocess.call(["md5sum", yuv_file], stdout=f, stderr=subprocess.STDOUT) + + try: + m1 = None +@@ -74,9 +91,21 @@ def testone(fileroot, srcname, es_file, md5_file, pix, dectype, vcodec, ffmpeg_e + except: + pass + ++ if valgrind: ++ flog.seek(0) ++ leak = True ++ valerr = True ++ ++ for line in flog: ++ if re.search("^==[0-9]+== All heap blocks were freed", line): ++ leak = False ++ if re.search("^==[0-9]+== ERROR SUMMARY: 0 errors", line): ++ valerr = False ++ if leak or valerr: ++ rv = 4 ++ + if m1 and m2 and m1.group() == m2.group(): + print("Match: " + m1.group(), file=flog) +- rv = 0 + elif not m1: + print("****** Cannot find m1", file=flog) + rv = 3 +@@ -121,7 +150,7 @@ def runtest(name, tests): + return True + return False + +-def doconf(csva, tests, test_root, vcodec, dectype, ffmpeg_exec): ++def doconf(csva, tests, test_root, vcodec, dectype, args): + unx_failures = [] + unx_success = [] + failures = 0 +@@ -133,7 +162,7 @@ def doconf(csva, tests, test_root, vcodec, dectype, ffmpeg_exec): + print ("==== ", name, end="") + sys.stdout.flush() + +- rv = testone(os.path.join(test_root, name), name, a[2], a[3], a[4], dectype=dectype, vcodec=vcodec, ffmpeg_exec=ffmpeg_exec) ++ rv = testone(os.path.join(test_root, name), name, a[2], a[3], a[4], dectype=dectype, vcodec=vcodec, args=args) + if (rv == 0): + successes += 1 + else: +@@ -158,6 +187,8 @@ def doconf(csva, tests, test_root, vcodec, dectype, ffmpeg_exec): + print(": * CRASH *") + elif (rv == 3) : + print(": * MD5 MISSING *") ++ elif (rv == 4) : ++ print(": * VALGRIND *") + else : + print(": * BANG *") + +@@ -189,6 +220,8 @@ if __name__ == '__main__': + argp.add_argument("--csv", default="pi-util/conf_h265.2016.csv", help="CSV filename") + argp.add_argument("--vcodec", default="hevc_rpi", help="vcodec name to use") + argp.add_argument("--ffmpeg", default="./ffmpeg", help="ffmpeg exec name") ++ argp.add_argument("--valgrind", action='store_true', help="Run valgrind on tests") ++ argp.add_argument("--gen_yuv", action='store_true', help="Create yuv file (stored with log under /tmp)") + args = argp.parse_args() + + if args.csvgen: +@@ -211,5 +244,5 @@ if __name__ == '__main__': + elif args.vaapi: + dectype = HWACCEL_VAAPI + +- doconf(csva, args.tests, args.test_root, args.vcodec, dectype, args.ffmpeg) ++ doconf(csva, args.tests, args.test_root, args.vcodec, dectype, args) + + +From 2a2e3858f09b446ee866c5e94c4d0cb81a176ad7 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 5 Mar 2024 15:47:34 +0000 +Subject: [PATCH 182/186] ffconf: Validate ffmpeg & test_root options rather + than crashing + +(cherry picked from commit c3948731965a10b3d459931f4134dd3d95b463aa) +--- + pi-util/ffconf.py | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/pi-util/ffconf.py b/pi-util/ffconf.py +index 204e6257fb36..71cd8387203f 100755 +--- a/pi-util/ffconf.py ++++ b/pi-util/ffconf.py +@@ -219,11 +219,15 @@ if __name__ == '__main__': + argp.add_argument("--csvgen", action='store_true', help="Generate CSV file for dir") + argp.add_argument("--csv", default="pi-util/conf_h265.2016.csv", help="CSV filename") + argp.add_argument("--vcodec", default="hevc_rpi", help="vcodec name to use") +- argp.add_argument("--ffmpeg", default="./ffmpeg", help="ffmpeg exec name") ++ argp.add_argument("--ffmpeg", default="./ffmpeg", help="ffmpeg exec name; if directory given use /ffmpeg") + argp.add_argument("--valgrind", action='store_true', help="Run valgrind on tests") + argp.add_argument("--gen_yuv", action='store_true', help="Create yuv file (stored with log under /tmp)") + args = argp.parse_args() + ++ if not os.path.isdir(args.test_root): ++ print("Test root dir '%s' not found" % args.test_root) ++ exit(1) ++ + if args.csvgen: + csv.writer(sys.stdout).writerows(scandir(args.test_root)) + exit(0) +@@ -244,5 +248,11 @@ if __name__ == '__main__': + elif args.vaapi: + dectype = HWACCEL_VAAPI + ++ if os.path.isdir(args.ffmpeg): ++ args.ffmpeg = os.path.join(args.ffmpeg, "ffmpeg") ++ if not os.path.isfile(args.ffmpeg): ++ print("FFmpeg file '%s' not found" % args.ffmpeg) ++ exit(1) ++ + doconf(csva, args.tests, args.test_root, args.vcodec, dectype, args) + + +From 3f92b3ddcf6647bb88b585bfa286a77c18b4ee30 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Wed, 6 Mar 2024 11:55:22 +0000 +Subject: [PATCH 183/186] ffconf: Fix expected conformance s.t. + VPSSPSPPS_A_MainConcept_1 fails + +(cherry picked from commit faa8c6afcda58e1ad91eacc4f4ca6b4d467200b3) +--- + pi-util/conf_h265.2016.csv | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pi-util/conf_h265.2016.csv b/pi-util/conf_h265.2016.csv +index 4efd5d1c676d..177f1c8111fd 100644 +--- a/pi-util/conf_h265.2016.csv ++++ b/pi-util/conf_h265.2016.csv +@@ -128,7 +128,7 @@ + 3,HEVC_v1/TSUNEQBD_A_MAIN10_Technicolor_2,TSUNEQBD_A_MAIN10_Technicolor_2.bit,TSUNEQBD_A_MAIN10_Technicolor_2_yuv.md5, # unequal bit depth,10 + 1,HEVC_v1/TUSIZE_A_Samsung_1,TUSIZE_A_Samsung_1.bin,TUSIZE_A_Samsung_1.md5,8 + 1,HEVC_v1/VPSID_A_VIDYO_2,VPSID_A_VIDYO_2.bit,VPSID_A_VIDYO_2_yuv.md5,8 +-3,HEVC_v1/VPSSPSPPS_A_MainConcept_1,VPSSPSPPS_A_MainConcept_1.bin,VPSSPSPPS_A_MainConcept_1_md5.txt, # ???,8 ++2,HEVC_v1/VPSSPSPPS_A_MainConcept_1,VPSSPSPPS_A_MainConcept_1.bin,VPSSPSPPS_A_MainConcept_1_md5.txt, # ???,8 + 1,HEVC_v1/WP_A_MAIN10_Toshiba_3,WP_A_MAIN10_Toshiba_3.bit,WP_A_MAIN10_Toshiba_3_yuv.md5,10 + 1,HEVC_v1/WP_A_Toshiba_3,WP_A_Toshiba_3.bit,WP_A_Toshiba_3_yuv.md5,8 + 1,HEVC_v1/WP_B_Toshiba_3,WP_B_Toshiba_3.bit,WP_B_Toshiba_3_yuv.md5,8 + +From ad8c5df726d8623d2b8ce00fddb4312c3b871415 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Mon, 11 Mar 2024 18:36:51 +0000 +Subject: [PATCH 184/186] ffconf: Add loop option for race testing + +--- + pi-util/ffconf.py | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/pi-util/ffconf.py b/pi-util/ffconf.py +index 71cd8387203f..702461200671 100755 +--- a/pi-util/ffconf.py ++++ b/pi-util/ffconf.py +@@ -198,6 +198,8 @@ def doconf(csva, tests, test_root, vcodec, dectype, args): + else: + print("All tests normal:", successes, "ok,", failures, "failed") + ++ return unx_failures + unx_success ++ + + class ConfCSVDialect(csv.Dialect): + delimiter = ',' +@@ -222,6 +224,7 @@ if __name__ == '__main__': + argp.add_argument("--ffmpeg", default="./ffmpeg", help="ffmpeg exec name; if directory given use /ffmpeg") + argp.add_argument("--valgrind", action='store_true', help="Run valgrind on tests") + argp.add_argument("--gen_yuv", action='store_true', help="Create yuv file (stored with log under /tmp)") ++ argp.add_argument("--loop", default=0, type=int, help="Create yuv file (stored with log under /tmp)") + args = argp.parse_args() + + if not os.path.isdir(args.test_root): +@@ -254,5 +257,11 @@ if __name__ == '__main__': + print("FFmpeg file '%s' not found" % args.ffmpeg) + exit(1) + +- doconf(csva, args.tests, args.test_root, args.vcodec, dectype, args) ++ i = 0 ++ while True: ++ i = i + 1 ++ if args.loop: ++ print("== Loop ", i) ++ if doconf(csva, args.tests, args.test_root, args.vcodec, dectype, args) or (args.loop >= 0 and i > args.loop): ++ break + + +From f75376acc36b73deed90ae5f60b53355b9cef599 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Tue, 19 Mar 2024 15:29:02 +0000 +Subject: [PATCH 185/186] pi-util/ffperf: Make ffmpeg run options an option + +Also change the default run args to be a simple s/w decode +--- + pi-util/ffperf.py | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +diff --git a/pi-util/ffperf.py b/pi-util/ffperf.py +index 65c5224cd8fb..767efe2de2fa 100755 +--- a/pi-util/ffperf.py ++++ b/pi-util/ffperf.py +@@ -1,5 +1,6 @@ + #!/usr/bin/env python3 + ++import shlex + import time + import string + import os +@@ -36,14 +37,20 @@ class tstats: + def __gt__(self, other): + return self.elapsed > other.elapsed + +- def time_file(name, prefix, ffmpeg="./ffmpeg"): ++ def time_file(name, prefix, args): ++ cmdargs = [args.ffmpeg] ++ for x in args.args : ++ if x == '{INPUT}': ++ cmdargs.append(prefix + name) ++ elif x == '{NULL}': ++ cmdargs.append(os.devnull) ++ else: ++ cmdargs.append(x) ++ + stats = tstats() + stats.name = name + start_time = time.clock_gettime(time.CLOCK_MONOTONIC); +- cproc = subprocess.Popen([ffmpeg, "-no_cvt_hw", +- "-vcodec", "hevc_rpi", +- "-t", "30", "-i", prefix + name, +- "-f", "vout_rpi", os.devnull], bufsize=-1, stdout=flog, stderr=flog); ++ cproc = subprocess.Popen(cmdargs, bufsize=-1, stdout=flog, stderr=flog); + pinfo = os.wait4(cproc.pid, 0) + end_time = time.clock_gettime(time.CLOCK_MONOTONIC); + stats.elapsed = end_time - start_time +@@ -67,6 +74,10 @@ To blank the screen before starting use "xdg-screensaver activate" + """) + + argp.add_argument("streams", nargs='*') ++ argp.add_argument("--args", default='-t 30 -i {INPUT} -f null {NULL}', help=""" ++ffmpeg arguments, default='-t 30 -i {INPUT} -f null {NULL}'; ++ {INPUT} is replaced by current inputfile path; ++ {NULL} is replaced by the system null device""") + argp.add_argument("--csv_out", default="ffperf_out.csv", help="CSV output filename") + argp.add_argument("--csv_in", help="CSV input filename") + argp.add_argument("--prefix", help="Filename prefix (include terminal '/' if a directory).") +@@ -74,6 +85,7 @@ To blank the screen before starting use "xdg-screensaver activate" + argp.add_argument("--ffmpeg", default="./ffmpeg", help="FFmpeg executable") + + args = argp.parse_args() ++ args.args = shlex.split(args.args) + + csv_out = csv.DictWriter(open(args.csv_out, 'w', newline=''), ["name", "elapsed", "user", "sys"]) + csv_out.writeheader() +@@ -107,7 +119,7 @@ To blank the screen before starting use "xdg-screensaver activate" + + t0 = tstats({"name":f, "elapsed":999, "user":999, "sys":999}) + for i in range(args.repeat): +- t = tstats.time_file(f, prefix, args.ffmpeg) ++ t = tstats.time_file(f, prefix, args) + print ("...", t.times_str()) + if t0 > t: + t0 = t + +From b87000d0dc80ec8e0cbd4406e62bd64b5519a544 Mon Sep 17 00:00:00 2001 +From: John Cox +Date: Mon, 25 Mar 2024 18:25:47 +0000 +Subject: [PATCH 186/186] pi-util/ffconf: Fix --loop help text + +--- + pi-util/ffconf.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pi-util/ffconf.py b/pi-util/ffconf.py +index 702461200671..26091f3c07c2 100755 +--- a/pi-util/ffconf.py ++++ b/pi-util/ffconf.py +@@ -224,7 +224,7 @@ if __name__ == '__main__': + argp.add_argument("--ffmpeg", default="./ffmpeg", help="ffmpeg exec name; if directory given use /ffmpeg") + argp.add_argument("--valgrind", action='store_true', help="Run valgrind on tests") + argp.add_argument("--gen_yuv", action='store_true', help="Create yuv file (stored with log under /tmp)") +- argp.add_argument("--loop", default=0, type=int, help="Create yuv file (stored with log under /tmp)") ++ argp.add_argument("--loop", default=0, type=int, help="Loop n times, or until unexpected result") + args = argp.parse_args() + + if not os.path.isdir(args.test_root): diff --git a/tools/ffmpeg/gen-patches.sh b/tools/ffmpeg/gen-patches.sh index 9c372c6825..f253de3a81 100755 --- a/tools/ffmpeg/gen-patches.sh +++ b/tools/ffmpeg/gen-patches.sh @@ -2,7 +2,7 @@ # base ffmpeg version FFMPEG_REPO="git://source.ffmpeg.org/ffmpeg.git" -FFMPEG_VERSION="n6.0" +FFMPEG_VERSION="n6.0.1" ALL_FEATURE_SETS="v4l2-drmprime v4l2-request libreelec rpi vf-deinterlace-v4l2m2m" @@ -38,7 +38,7 @@ create_patch() { ;; rpi) REPO="https://github.com/jc-kynesim/rpi-ffmpeg" - REFSPEC="dev/6.0/rpi_import_1" + REFSPEC="test/6.0.1/main" ;; *) echo "illegal feature set ${FEATURE_SET}"