diff --git a/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch b/packages/multimedia/ffmpeg/patches/rpi/ffmpeg-001-rpi.patch index 72cacc605c..6d607f62b2 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: John Cox Date: Mon, 26 Apr 2021 12:34:50 +0100 -Subject: [PATCH 001/151] Add pi configs and scripts +Subject: [PATCH 001/161] Add pi configs and scripts --- pi-util/BUILD.txt | 59 ++++++++ @@ -1682,7 +1682,7 @@ index 0000000000..5935a11ca5 From f3eaadb27a5bc6db07d33ce0814d796e8cee623e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:27:39 +0100 -Subject: [PATCH 002/151] Add sand pix fmts & conversion fns +Subject: [PATCH 002/161] Add sand pix fmts & conversion fns --- configure | 3 + @@ -3503,7 +3503,7 @@ index 0000000000..634b55e800 From 89b8d6ac2a886749d4594656083753e682de05a7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:36:47 +0100 -Subject: [PATCH 003/151] Add aarch64 asm sand conv functions +Subject: [PATCH 003/161] Add aarch64 asm sand conv functions Many thanks to eiler.mike@gmail.com (Michael Eiler) for these optimizations @@ -4310,7 +4310,7 @@ index ed0261b02f..1f543e9357 100644 From 247025a42ae09d6c9c5d4128a5e4b288b7b3047c Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 11:56:02 +0100 -Subject: [PATCH 004/151] Add raw encoding for sand +Subject: [PATCH 004/161] Add raw encoding for sand --- libavcodec/raw.c | 6 +++ @@ -4459,7 +4459,7 @@ index 8c577006d9..594a77c42a 100644 From ac6961f424b56563dc793b6bc002a8c04cb1bc36 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:02:09 +0100 -Subject: [PATCH 005/151] Deal with the lack of trivial sand cropping +Subject: [PATCH 005/161] Deal with the lack of trivial sand cropping --- fftools/ffmpeg.c | 4 ++-- @@ -4559,7 +4559,7 @@ index 2580269549..3a9d323325 100644 From 9a08431f7790507b0374d9585dfc736000c1bd42 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:31:16 +0100 -Subject: [PATCH 006/151] Add an unsand filter +Subject: [PATCH 006/161] Add an unsand filter --- configure | 1 + @@ -4857,7 +4857,7 @@ index 0000000000..7100f2fc9b From 6e61007b19544c573f1c2a4c6060d3d24b8d500e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 12:37:07 +0100 -Subject: [PATCH 007/151] Reduce mmal compile warnings +Subject: [PATCH 007/161] Reduce mmal compile warnings --- libavcodec/mmaldec.c | 4 ++++ @@ -4889,7 +4889,7 @@ index 3092f58510..6f41b41ac4 100644 From 01aff455665e8f889330519096912ad0005add3c Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 17:56:16 +0100 -Subject: [PATCH 008/151] Add chroma location to hevc parse +Subject: [PATCH 008/161] Add chroma location to hevc parse --- libavcodec/hevc_parser.c | 13 +++++++++++++ @@ -4948,7 +4948,7 @@ index 567e8d81d4..b6cfea64d3 100644 From c80aad5d2fb373f7564e4257b1272f2decb06dd0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:20:50 +0100 -Subject: [PATCH 009/151] hwaccel: Add .abort_frame & use in hevcdec +Subject: [PATCH 009/161] hwaccel: Add .abort_frame & use in hevcdec --- libavcodec/avcodec.h | 11 +++++++++++ @@ -5000,7 +5000,7 @@ index b6cfea64d3..8a0246fa21 100644 From 317722fd652d9a1c1700319c80fc71acf68ddde6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:26:17 +0100 -Subject: [PATCH 010/151] hwaccel: Add CAP_MT_SAFE for accels that can use +Subject: [PATCH 010/161] hwaccel: Add CAP_MT_SAFE for accels that can use multi-thread --- @@ -5049,7 +5049,7 @@ index d9d5afaa82..2cc89a41f5 100644 From 9005b263450e154a5ec5258fda17d5998fe7896b Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 17:59:08 +0100 -Subject: [PATCH 011/151] Weak link utils +Subject: [PATCH 011/161] Weak link utils --- libavcodec/weak_link.c | 102 +++++++++++++++++++++++++++++++++++++++++ @@ -5199,7 +5199,7 @@ index 0000000000..415b6a27a0 From 824be1710ca96d97c86836fdac0e7dcd28a4b92e Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 19:23:26 +0100 -Subject: [PATCH 012/151] Add v4l2_req V4L2 request H265 drm_prime decode +Subject: [PATCH 012/161] 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 @@ -10674,7 +10674,7 @@ index 0000000000..f14f594564 From c99a0fe4d59212079de9bed222114abf95f7c989 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 27 Apr 2021 19:30:36 +0100 -Subject: [PATCH 013/151] Add no_cvt_hw option to ffmpeg +Subject: [PATCH 013/161] Add no_cvt_hw option to ffmpeg --- fftools/ffmpeg.c | 6 ++++-- @@ -10744,7 +10744,7 @@ index 055275d813..761db36588 100644 From 27e0c78a2df53fb2337bee4c383cdb58cbbc717e Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 10:16:39 +0100 -Subject: [PATCH 014/151] Add vout_drm +Subject: [PATCH 014/161] Add vout_drm --- configure | 4 + @@ -11457,7 +11457,7 @@ index 0000000000..cfb33ce7c3 From cc536672adf4eefeaec16e9808f583c693ad7819 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 11:34:18 +0100 -Subject: [PATCH 015/151] Add vout_egl +Subject: [PATCH 015/161] Add vout_egl --- configure | 6 + @@ -12357,7 +12357,7 @@ index 0000000000..7b9c610ace From 867bd7c243e66a1c1756878e20df8f35db8025ec Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 28 Apr 2021 12:51:22 +0100 -Subject: [PATCH 016/151] V4L2 stateful rework +Subject: [PATCH 016/161] V4L2 stateful rework --- libavcodec/Makefile | 3 +- @@ -14780,7 +14780,7 @@ index 4944d08511..7f6033ac2c 100644 From 12f8f12326b83dd3c22084f8922705d79a13d195 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:46:21 +0100 -Subject: [PATCH 017/151] Fix crash in hw_device_default_name if type not found +Subject: [PATCH 017/161] Fix crash in hw_device_default_name if type not found (NONE) --- @@ -14804,7 +14804,7 @@ index 88fa782470..740a5e7153 100644 From 7f6bce459e683bff3a0b972922fbcc808e9177a6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:59:18 +0100 -Subject: [PATCH 018/151] Allow v4l2m2m to select non-drm_prime output formats +Subject: [PATCH 018/161] Allow v4l2m2m to select non-drm_prime output formats --- libavcodec/v4l2_buffers.c | 2 +- @@ -14871,7 +14871,7 @@ index 7f6033ac2c..a4b5a4e7e9 100644 From 9b0d964b727d98271f7f2f4dcdbcb1b41a429e2b Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 18:59:38 +0100 -Subject: [PATCH 019/151] Fix YUV420P output from v4l2m2m +Subject: [PATCH 019/161] Fix YUV420P output from v4l2m2m Also put get_width get_height inlines in header as they are generally useful. @@ -14988,7 +14988,7 @@ index 24a9c94864..8f054f2f50 100644 From 14e9b4bf1b34b3d1e1e6a4fc755cc595416e7d7b Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 10 Jun 2021 19:23:44 +0100 -Subject: [PATCH 020/151] Report buffer overflows in v4l2m2m +Subject: [PATCH 020/161] Report buffer overflows in v4l2m2m --- libavcodec/v4l2_buffers.c | 14 ++++++++++---- @@ -15064,7 +15064,7 @@ index 6fe2586627..81aced0c2b 100644 From 072907a7fcf160d12972997d24fdf62641687ea4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 14 Jun 2021 11:55:16 +0100 -Subject: [PATCH 021/151] Increase V4L2 H264 stateful coded buffer size +Subject: [PATCH 021/161] 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 @@ -15188,7 +15188,7 @@ index a4b5a4e7e9..1851acbc93 100644 From 6087c8c054e1ff3d2e6e62d5e32705d079928b64 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 28 Jun 2021 12:13:35 +0100 -Subject: [PATCH 022/151] Fix raw video s.t. it respects any remaining cropping +Subject: [PATCH 022/161] Fix raw video s.t. it respects any remaining cropping This fixes the long standing CONFWIN_A conformance test failure for drm. --- @@ -15458,7 +15458,7 @@ index 7a9fdbd263..baf18920fa 100644 From 597858c11fbfbe0f54c1b68d9683025929258bc1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 13 Aug 2021 15:38:28 +0100 -Subject: [PATCH 023/151] Set frame interlace from V4L2 buffer field +Subject: [PATCH 023/161] Set frame interlace from V4L2 buffer field --- libavcodec/v4l2_buffers.c | 12 ++++++++++++ @@ -15498,7 +15498,7 @@ index de31f7ced9..97b8eb1db3 100644 From 05906e2086b5087d615485ec9a09b1493dbb32e1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 13 Aug 2021 16:11:53 +0100 -Subject: [PATCH 024/151] Fix V4L2 stateful to avoid crash if flush before +Subject: [PATCH 024/161] Fix V4L2 stateful to avoid crash if flush before start --- @@ -15524,7 +15524,7 @@ index a17ae027a6..eb901e8fab 100644 From 7157b6032e759078a7d751e5dd5762970f3d1e8c Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Sep 2021 17:44:13 +0100 -Subject: [PATCH 025/151] Copy properties from frame to v4l2 buffer +Subject: [PATCH 025/161] 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 @@ -15695,7 +15695,7 @@ index 97b8eb1db3..126d2a17f4 100644 From 15415ab226f966fd12e70d79fde3cb80f3d09144 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 16:49:01 +0000 -Subject: [PATCH 026/151] ffmpeg: Do not inc DTS on no decode output +Subject: [PATCH 026/161] 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 @@ -15727,7 +15727,7 @@ index 5dc2cd73c1..ba0c1898cf 100644 From 7bf6c062ed8a1e635aa5722c0072724f236daf00 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:32:59 +0000 -Subject: [PATCH 027/151] v4l2_m2m_dec: Adjust timebase if H264 +Subject: [PATCH 027/161] v4l2_m2m_dec: Adjust timebase if H264 Adjust AVCodecContext time_base if H264 in the same way that the software decoder does. @@ -15760,7 +15760,7 @@ index 1851acbc93..aa1e5c1597 100644 From 3cd23a761397ae75ed032c1687da5d6b76ddaaaa Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:38:27 +0000 -Subject: [PATCH 028/151] v4l2_m2m_dec: Produce best guess PTSs if none +Subject: [PATCH 028/161] v4l2_m2m_dec: Produce best guess PTSs if none supplied Filter scheduling gets confused by missing PTSs and makes poor guesses @@ -15895,7 +15895,7 @@ index aa1e5c1597..a5a2afbd27 100644 From ee8be1e900f98212b6c4940980cc7a80becfc07c Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 17:59:27 +0000 -Subject: [PATCH 029/151] v4l2_m2m_dec: Try harder to get an initial frame +Subject: [PATCH 029/161] 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 @@ -15936,7 +15936,7 @@ index a5a2afbd27..b49f470c0a 100644 From 72da14331c2160a12b69d666d493e0e74c5e8914 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 17 Nov 2021 18:04:56 +0000 -Subject: [PATCH 030/151] Add a V4L2 M2M deinterlace filter +Subject: [PATCH 030/161] Add a V4L2 M2M deinterlace filter Add a V4L2 deinterlace filter that will accept DRMPRIME frames. @@ -17277,7 +17277,7 @@ index 0000000000..1a933b7e0a From 0fb00e51d1ca40eed22bfc66b7f309fdc56229bc Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 2 Dec 2021 17:49:55 +0000 -Subject: [PATCH 031/151] Put no_pts_rescale in context which makes more sense +Subject: [PATCH 031/161] Put no_pts_rescale in context which makes more sense than an arg --- @@ -17558,7 +17558,7 @@ index b49f470c0a..36754b314a 100644 From 5e36908e6f2f06b68e85873cbcd421c0973f6409 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 8 Dec 2021 15:00:37 +0000 -Subject: [PATCH 032/151] Use bitbuf min size for all streams +Subject: [PATCH 032/161] Use bitbuf min size for all streams --- libavcodec/v4l2_m2m_dec.c | 5 +---- @@ -17589,7 +17589,7 @@ index 36754b314a..48a6810d18 100644 From 5fcbcd31761eea31dc0157793f558eaaadfe2ac3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 3 Dec 2021 12:54:18 +0000 -Subject: [PATCH 033/151] Track pending frames in v4l2 stateful +Subject: [PATCH 033/161] 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 @@ -17847,7 +17847,7 @@ index 48a6810d18..d8ebb466cd 100644 From 6fae7b3f42c8e9e431a59323c0faa6c88fe951d9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 17:58:21 +0000 -Subject: [PATCH 034/151] Use pending tracking to reduce v4l2 latency +Subject: [PATCH 034/161] 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 @@ -17970,7 +17970,7 @@ index d8ebb466cd..7e7e4729d0 100644 From 175abd2eb961a3718a660e1f9eda08b37b01b309 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 12:23:54 +0000 -Subject: [PATCH 035/151] Allow logger() to take const ctx +Subject: [PATCH 035/161] Allow logger() to take const ctx --- libavcodec/v4l2_buffers.c | 2 +- @@ -18015,7 +18015,7 @@ index 64540a37b3..d3df48aed4 100644 From 21d4f3f644c45084c621cb5aa577169bf5c15017 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 13:00:27 +0000 -Subject: [PATCH 036/151] Track numbere of bufs qed with an atomic +Subject: [PATCH 036/161] Track numbere of bufs qed with an atomic Safer and faster than counting status --- @@ -18089,7 +18089,7 @@ index 4cc164886c..a4176448d5 100644 From b2fa4ab3d63924597b8c3659123b145a786a2c13 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Dec 2021 12:01:25 +0000 -Subject: [PATCH 037/151] Clear pkt_buf on flush +Subject: [PATCH 037/161] Clear pkt_buf on flush --- libavcodec/v4l2_m2m_dec.c | 3 +++ @@ -18113,7 +18113,7 @@ index 7e7e4729d0..09ec496351 100644 From 16cf94cb5e1d11f4c3a6b8a43557383ce78112e0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 15 Dec 2021 12:52:56 +0000 -Subject: [PATCH 038/151] Rework v4l2 buffer dequeue +Subject: [PATCH 038/161] Rework v4l2 buffer dequeue --- libavcodec/v4l2_context.c | 543 ++++++++++++++++++-------------------- @@ -19150,7 +19150,7 @@ index 09ec496351..e4b6569ba5 100644 From a2519f7a512edde7433aced70de4464e21805693 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 9 Dec 2021 18:51:00 +0000 -Subject: [PATCH 039/151] Honor result of ff_get_format if possible +Subject: [PATCH 039/161] Honor result of ff_get_format if possible --- libavcodec/v4l2_m2m_dec.c | 6 +++++- @@ -19185,7 +19185,7 @@ index e4b6569ba5..c9655bcc3b 100644 From a1cd1cb98e48c631392b385ccac5ab7b09bb5ee9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 14 Dec 2021 16:11:10 +0000 -Subject: [PATCH 040/151] Add an always-reinit quirk +Subject: [PATCH 040/161] Add an always-reinit quirk --- libavcodec/v4l2_context.c | 7 +++++-- @@ -19291,7 +19291,7 @@ index c9655bcc3b..e2b10f5e3a 100644 From 2470968adf0d28bbaf310e782720dd00d57d7bf6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jan 2022 16:58:31 +0000 -Subject: [PATCH 041/151] v4l2_buffers: rework flags for keyframe +Subject: [PATCH 041/161] 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. @@ -19400,7 +19400,7 @@ index c11b5e6863..53b522d43e 100644 From 5dc38f5d088beea4da57e82969643cc831c40cf0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 22 Mar 2022 11:44:30 +0000 -Subject: [PATCH 042/151] v4l2m2m: Rework decode to wait for missing buffer, +Subject: [PATCH 042/161] v4l2m2m: Rework decode to wait for missing buffer, add dynamic pending Previously receive_frame exited with EAGAIN if no capture buffer @@ -19620,7 +19620,7 @@ index e2b10f5e3a..2e30449dfc 100644 From 33765b769b4301e03f31b65e225fcdb0eff4c0e4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 25 Mar 2022 15:37:58 +0000 -Subject: [PATCH 043/151] v4l2_m2m2_dec: Avoid loop if unable to resize buffers +Subject: [PATCH 043/161] 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 @@ -19667,7 +19667,7 @@ index 7ddb759810..007a58c8f1 100644 From bb7ad2392ce83149a1ba40ecacb36e051b6bf785 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 25 Mar 2022 18:14:40 +0000 -Subject: [PATCH 044/151] v4l2dec: Improve size/format validation on init +Subject: [PATCH 044/161] v4l2dec: Improve size/format validation on init --- libavcodec/v4l2_m2m_dec.c | 84 ++++++++++++++++++++++++++++++++-- @@ -19809,7 +19809,7 @@ index b0a5930844..76ab0916cd 100644 From 4646b558c0e45f506578a5a452820f55983abc82 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 13 Apr 2022 16:05:56 +0000 -Subject: [PATCH 045/151] v4l2 stateless hevc: Add another API variation for +Subject: [PATCH 045/161] 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 @@ -20255,7 +20255,7 @@ index f14f594564..ed48d62e2d 100644 From 92160173e701aa7e2f1011e63596e48d15e691a9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 3 May 2022 12:44:42 +0000 -Subject: [PATCH 046/151] Remove V4l2 frame size check for meson-vdec +Subject: [PATCH 046/161] Remove V4l2 frame size check for meson-vdec --- libavcodec/v4l2_m2m.h | 3 ++- @@ -20315,7 +20315,7 @@ index 8dcadf461b..888ba67fea 100644 From 8ba5576e7fcd24c2f450f0295cc3b6d8e82e8649 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 23 May 2022 18:05:20 +0100 -Subject: [PATCH 047/151] v4l2m2m_dec: Make some error rturns a bit more robust +Subject: [PATCH 047/161] v4l2m2m_dec: Make some error rturns a bit more robust --- libavcodec/v4l2_context.c | 5 ++--- @@ -20384,7 +20384,7 @@ index 888ba67fea..88a341aae2 100644 From aafa5968f8713319be35cf26069c98566d5bf59b Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 24 May 2022 17:02:58 +0000 -Subject: [PATCH 048/151] v4l2m2m_dec: Support in-pkt AV_PKT_DATA_NEW_EXTRADATA +Subject: [PATCH 048/161] 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. @@ -20494,7 +20494,7 @@ index 88a341aae2..392a68f0c7 100644 From e9bced67bdb40096d31067d41956276e9e1af11a Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 24 May 2022 20:02:48 +0000 -Subject: [PATCH 049/151] v4l2m2m_dec: Catch repeated Q fulls +Subject: [PATCH 049/161] v4l2m2m_dec: Catch repeated Q fulls --- libavcodec/v4l2_m2m_dec.c | 8 +++++++- @@ -20536,7 +20536,7 @@ index 392a68f0c7..7e17044706 100644 From 0c974e4da2c0311836145f2fd42081d40eb15998 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 25 May 2022 15:22:12 +0000 -Subject: [PATCH 050/151] Remove requirement for epoxy & libudev config options +Subject: [PATCH 050/161] Remove requirement for epoxy & libudev config options --- configure | 26 +++++++++++++++++--------- @@ -20663,7 +20663,7 @@ index 65576846e8..37cea71756 100755 From 9f234d8cbde2829e6a70fd3cb6324998df8a31f3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 27 May 2022 09:36:51 +0000 -Subject: [PATCH 051/151] hevc: If hwaccel avoid creation of s/w only vars +Subject: [PATCH 051/161] hevc: If hwaccel avoid creation of s/w only vars --- libavcodec/hevc_refs.c | 35 +++++++++++++++++++++-------------- @@ -20801,7 +20801,7 @@ index 2867cb2e16..17f53322fb 100644 From bb2ddc480634141bed9afd3f66e7f63f5091bb2f Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 30 May 2022 17:51:44 +0100 -Subject: [PATCH 052/151] rpi_sand: Add SAND30->NV12 conversion +Subject: [PATCH 052/161] 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 @@ -21023,7 +21023,7 @@ index 634b55e800..462ccb8abd 100644 From b55c351e6954c800229d97dc6c982ca8f998c848 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 1 Jun 2022 17:49:26 +0000 -Subject: [PATCH 053/151] rpi_sand: Add SAND30->NV12 asm for Armv7 & Armv8 +Subject: [PATCH 053/161] 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. @@ -21962,7 +21962,7 @@ index 256c3d532f..b6071e2928 100644 From 24c3eef4487a36d5189ecd934b65a7c6a0b53d03 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 7 Jun 2022 14:46:12 +0000 -Subject: [PATCH 054/151] v4l2_m2m_enc: Add the ability to encode DRM_PRIME +Subject: [PATCH 054/161] v4l2_m2m_enc: Add the ability to encode DRM_PRIME frames --- @@ -23337,7 +23337,7 @@ index 9a0837ecf3..05ff6ba726 100644 From 6b437ce70582c67971aa81871a6694a08b709784 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 8 Jun 2022 16:13:31 +0000 -Subject: [PATCH 055/151] v4l2_m2m_dec: Use DTS for best effort PTS if PTS is +Subject: [PATCH 055/161] 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. @@ -23422,7 +23422,7 @@ index fbbfc81342..485a96f4b4 100644 From ec8d1c2c0b6bd3544e5e30500a167fc31abde17a Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 30 Jun 2022 15:59:23 +0000 -Subject: [PATCH 056/151] v4l2: Update H265 request for current API +Subject: [PATCH 056/161] 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 @@ -24211,7 +24211,7 @@ index ed48d62e2d..d4adb3f812 100644 From 21a348ae3282318fa96d3a6e2c70f3d4b90a7d52 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 3 Jul 2022 13:40:41 +0000 -Subject: [PATCH 057/151] v4l2_req: Observe limit on size of slice_array +Subject: [PATCH 057/161] 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. @@ -24342,7 +24342,7 @@ index d4adb3f812..0029e23309 100644 From 4f1d74cc8eea6a1bd6f2317a10c0ecf620315dec Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 14:43:20 +0100 -Subject: [PATCH 058/151] v4l2_req: Add entry point offsets array control +Subject: [PATCH 058/161] v4l2_req: Add entry point offsets array control --- libavcodec/v4l2_req_hevc_vx.c | 88 +++++++++++++++++++++++++++------- @@ -24580,7 +24580,7 @@ index 0029e23309..99c90064ea 100644 From d0e5ed2dff1b8f8909ceb968cb3afe2b20093fda Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 16:22:54 +0100 -Subject: [PATCH 059/151] v4l2_req: Support Annex B +Subject: [PATCH 059/161] v4l2_req: Support Annex B --- libavcodec/v4l2_req_hevc_vx.c | 61 +++++++++++++++++++++++------------ @@ -24694,7 +24694,7 @@ index 43ef6631ed..5e0db9850a 100644 From a75506e18a964c9f50efa224a3fa4179c9ef2127 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 4 Jul 2022 18:24:03 +0100 -Subject: [PATCH 060/151] v4l2_req: Add frame mode decode +Subject: [PATCH 060/161] v4l2_req: Add frame mode decode --- libavcodec/v4l2_req_hevc_vx.c | 69 +++++++++++++++++++++++------------ @@ -24820,7 +24820,7 @@ index 5e0db9850a..ada53d0d44 100644 From 9cf01f1485dcf71bcad7981d45029425d9abf115 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 5 Jul 2022 12:54:22 +0000 -Subject: [PATCH 061/151] v4l2_req: Fix probe for frame based decode +Subject: [PATCH 061/161] v4l2_req: Fix probe for frame based decode --- libavcodec/v4l2_req_hevc_vx.c | 33 +++++++++++++++++++++++---------- @@ -24903,7 +24903,7 @@ index ada53d0d44..5d083016f8 100644 From e7a62226f26073149d35c89268f56e17c8f45d76 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 26 Jul 2022 15:46:14 +0000 -Subject: [PATCH 062/151] vf_deinterlace_v4l2m2m: Support NV12 through +Subject: [PATCH 062/161] vf_deinterlace_v4l2m2m: Support NV12 through deinterlace Supports NV12 (though not yet NV12M) through deinterlace. @@ -25229,7 +25229,7 @@ index 1a933b7e0a..1a3bef5bcb 100644 From 3d07826bcf588ad0384d00b210415664aa4489fb Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 19 Aug 2022 15:29:11 +0000 -Subject: [PATCH 063/151] v4l2_req: Enable use of MMAP for buffer alloc +Subject: [PATCH 063/161] 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. @@ -25961,7 +25961,7 @@ index cd79aad563..5cf17dd5e3 100644 From 79c2fcac56586ce9eea0cc8c6b13d2cd54f3e468 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 22 Aug 2022 12:35:40 +0000 -Subject: [PATCH 064/151] Set buffer lengths on DQ +Subject: [PATCH 064/161] Set buffer lengths on DQ --- libavcodec/v4l2_req_media.c | 8 ++++++++ @@ -25990,7 +25990,7 @@ index 910ac77bb6..1a9944774a 100644 From 8f3245ca1e4b2ec7e13fc2f3bffbc964ee8fc290 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 22 Aug 2022 17:11:24 +0000 -Subject: [PATCH 065/151] Fix compile if videodev2.h defines V4L2 HEVC request +Subject: [PATCH 065/161] Fix compile if videodev2.h defines V4L2 HEVC request API If videodev2.h does define the HEVC request API it is really hard to @@ -26117,7 +26117,7 @@ index 5cf17dd5e3..614a1b4d99 100644 From 35ec6af32c4f05b076f84ab343a8fc0d3263ba44 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Sep 2022 17:59:22 +0100 -Subject: [PATCH 066/151] v4l2_m2m_enc: Send headers in in pkt side_data +Subject: [PATCH 066/161] 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 @@ -26198,7 +26198,7 @@ index 05ff6ba726..099ad23928 100644 From dfc754491cea9192945b92ca9c8d3919321e30ad Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 14 Sep 2022 15:44:10 +0000 -Subject: [PATCH 067/151] matroskaenc: Allow H264 SPS/PPS headers in packet +Subject: [PATCH 067/161] matroskaenc: Allow H264 SPS/PPS headers in packet sidedata --- @@ -26267,7 +26267,7 @@ index 113541bd9a..61e4c976ef 100644 From 30c6ca4e24ae2acbd7f7f122f5275beb62b625c6 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 14 Sep 2022 15:55:15 +0000 -Subject: [PATCH 068/151] movenc: Allow H264 SPS/PPS headers in packet sidedata +Subject: [PATCH 068/161] movenc: Allow H264 SPS/PPS headers in packet sidedata --- libavformat/movenc.c | 1 + @@ -26289,7 +26289,7 @@ index c4fcb5f8b1..891adbf7b2 100644 From 1c7c3e99e9ed90f241aecbe7b2269229587d1e03 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 12:45:05 +0100 -Subject: [PATCH 069/151] Allow ffmpeg to select codec internal hwfmts if +Subject: [PATCH 069/161] Allow ffmpeg to select codec internal hwfmts if no_cvt_hw This allows the selection of DRM_PRIME from v4l2m2m without forcing it @@ -26326,7 +26326,7 @@ index ba0c1898cf..839da7b472 100644 From ecf273fd02e8aafe8775b1f291b9664b1b49572e Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 1 Sep 2022 11:42:41 +0000 -Subject: [PATCH 070/151] vf_deinterlace_v4l2m2m: Add a v4l2m2m scaler +Subject: [PATCH 070/161] 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 @@ -27809,7 +27809,7 @@ index 1a3bef5bcb..2df39ec0f1 100644 From 7e7147d50bc6e3f13834525dba3a47d170422f07 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 14:54:46 +0000 -Subject: [PATCH 071/151] v4l2_m2m: Adjust buffer allocation based on min/max +Subject: [PATCH 071/161] v4l2_m2m: Adjust buffer allocation based on min/max controls Clip requested buffer count to min/max declared by driver. @@ -27861,7 +27861,7 @@ index 6b97eab41e..ba36689ff3 100644 From b69a2707a192ac509174899233a094373a3f5dc9 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 15:00:12 +0000 -Subject: [PATCH 072/151] v4l2_m2m_dec: If src Q is full then wait indefinitely +Subject: [PATCH 072/161] 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 @@ -27894,7 +27894,7 @@ index 485a96f4b4..bb183097f6 100644 From b1d37be81bbf683a0eb16923c9b9f045fd0ea0c0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 15:12:27 +0000 -Subject: [PATCH 073/151] vf_deinterlace_v4l2m2m: Add Q name to structure for +Subject: [PATCH 073/161] vf_deinterlace_v4l2m2m: Add Q name to structure for debug --- @@ -27928,7 +27928,7 @@ index 2df39ec0f1..4edecc02bf 100644 From 794a5bfc3ec74fdc7664508a287a075708d5deef Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 16:08:42 +0000 -Subject: [PATCH 074/151] v4l2_m2m_enc: Set src buffer count to min+2 by +Subject: [PATCH 074/161] 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 @@ -27960,7 +27960,7 @@ index 099ad23928..b8ba815c37 100644 From 85c42743046a05b347f33b1933e6d52ea1d17e00 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 22 Sep 2022 16:13:57 +0000 -Subject: [PATCH 075/151] vf_deinterlace_m2m: For deinterlace set outlink FR to +Subject: [PATCH 075/161] 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 @@ -27997,7 +27997,7 @@ index 4edecc02bf..c52dae1c44 100644 From 34a24bc0b0d427c75659d3907cb75afb6a9dc255 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 23 Sep 2022 11:30:56 +0000 -Subject: [PATCH 076/151] v4l2m2m: Add ff_v4l2_dq_all to drain all buffers from +Subject: [PATCH 076/161] 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 @@ -28055,7 +28055,7 @@ index 21265f1bd7..523c53e97d 100644 From 95dfc168c74f7b0f282c1b2ad9deb8fba10a7ce5 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 23 Sep 2022 11:38:36 +0000 -Subject: [PATCH 077/151] v4l2_m2m_enc: DQ output more frequently +Subject: [PATCH 077/161] v4l2_m2m_enc: DQ output more frequently Ensure that we DQ any released src buffers on every op to avoid deadlock with source. @@ -28114,7 +28114,7 @@ index b8ba815c37..a992a3cccc 100644 From a40b1c38b0615fce0c0d9eb97510ab9e77b3e1ac Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 26 Sep 2022 18:20:00 +0100 -Subject: [PATCH 078/151] conf_native: Remove --enable-rpi from all builds +Subject: [PATCH 078/161] conf_native: Remove --enable-rpi from all builds --- pi-util/conf_native.sh | 5 +++-- @@ -28148,7 +28148,7 @@ index 37cea71756..f22d531ca4 100755 From 8fddfc8f1e3c95caded18705ed29be0ae95517bc Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 29 Sep 2022 19:48:08 +0000 -Subject: [PATCH 079/151] v4l2_m2m_dec: Deal correctly with avcC H264 data in +Subject: [PATCH 079/161] v4l2_m2m_dec: Deal correctly with avcC H264 data in extradata Decoders expect AnnexB style headers, mkv and similar formats have @@ -28391,7 +28391,7 @@ index bb183097f6..6bd9926b3f 100644 From 70227ebbc2999bc49075a3b683392d94618ecd89 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Sep 2022 14:20:23 +0000 -Subject: [PATCH 080/151] v4l2_request_hevc: Fix up +Subject: [PATCH 080/161] v4l2_request_hevc: Fix up V4L2_CID_CODEC_STATELESS_BASE if missing --- @@ -28420,7 +28420,7 @@ index 7829d82084..c02fdbe5a8 100644 From 22d2000382839dbd04588af1bb20cc9d9b3a4362 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Oct 2022 13:40:57 +0000 -Subject: [PATCH 081/151] vf_deinterlace_v4l2m2m: Fix compile on m/c without +Subject: [PATCH 081/161] vf_deinterlace_v4l2m2m: Fix compile on m/c without V4L2 SAND --- @@ -28554,7 +28554,7 @@ index c52dae1c44..716789f988 100644 From f06f9ee41bf0f6f74240503f0cb427328cf6792f Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 2 Oct 2022 12:36:43 +0000 -Subject: [PATCH 082/151] configure: Fix v4l2_req_hevc_vx setup; set after deps +Subject: [PATCH 082/161] configure: Fix v4l2_req_hevc_vx setup; set after deps fixups --- @@ -28592,7 +28592,7 @@ index 5c00a183e3..94c8161b91 100755 From 7d7709fb68561711f893269227147974fd6a46f3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Oct 2022 12:39:45 +0000 -Subject: [PATCH 083/151] vf_deinterlace_v4l2m2m: Ensure we get consistent +Subject: [PATCH 083/161] vf_deinterlace_v4l2m2m: Ensure we get consistent final frames On getting EOS at the input of the filster do not simply drop everything @@ -28944,7 +28944,7 @@ index 716789f988..ce875c2c61 100644 From f893891df8f4e7738b2d9b49df4386fb160eb25f Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 5 Oct 2022 16:12:02 +0000 -Subject: [PATCH 084/151] v4l2_m2m_dec: Rework decode pending heuristic +Subject: [PATCH 084/161] 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 @@ -29115,7 +29115,7 @@ index 6bd9926b3f..bec9b22fcf 100644 From 7048e7e6b8621cf09b96cc7e44b8d82ba8619913 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 21 Oct 2022 13:48:07 +0000 -Subject: [PATCH 085/151] pthread_frame: Fix MT hwaccel. Recent change broke +Subject: [PATCH 085/161] pthread_frame: Fix MT hwaccel. Recent change broke it. Revert the effects of 35aa7e70e7ec350319e7634a30d8d8aa1e6ecdda if the @@ -29222,7 +29222,7 @@ index 2cc89a41f5..b14f8e9360 100644 From 033056bd8ec63b16fe081446f70f41b5d5789b81 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:18:27 +0000 -Subject: [PATCH 086/151] v4l2_req: Add swfmt to init logging +Subject: [PATCH 086/161] v4l2_req: Add swfmt to init logging (cherry picked from commit dfa03b702baaf2952bcd2bbf8badcc2f9c961ddf) --- @@ -29259,7 +29259,7 @@ index 614a1b4d99..767ecb036a 100644 From 70779e742b93015e3e8aaa8f945a12d35917844d Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:39:54 +0000 -Subject: [PATCH 087/151] v4l2_m2m: Avoid polling on a queue that is streamoff +Subject: [PATCH 087/161] v4l2_m2m: Avoid polling on a queue that is streamoff (cherry picked from commit b2658bc56d3034a17db7f39597fc7d71bfe9a43b) --- @@ -29304,7 +29304,7 @@ index 4a359bf45e..b296dc111c 100644 From 438fed3702eb689f836c885ebbd813e48d4d4c4a Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:07:04 +0000 -Subject: [PATCH 088/151] v4l2_m2m: Add function to get number of queued +Subject: [PATCH 088/161] v4l2_m2m: Add function to get number of queued buffers (cherry picked from commit f9ac6485c00b4531dcff354222aef450b29728f4) @@ -29336,7 +29336,7 @@ index 523c53e97d..8e4f681643 100644 From 95ff4a65ed4c88ea7e02ee55e260e37a0ce2ba88 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:48:20 +0000 -Subject: [PATCH 089/151] v4l2_m2m: Add timeouts to dq_all and dequeue_packet +Subject: [PATCH 089/161] v4l2_m2m: Add timeouts to dq_all and dequeue_packet Add timeouts and use them to have better flow control in encode @@ -29505,7 +29505,7 @@ index a992a3cccc..d0d27e5bc2 100644 From e6654c1997a6f4dfd43b0f74b0168f5d644c1c74 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 14:23:32 +0000 -Subject: [PATCH 090/151] v4l2_m2m_enc: Improve debug trace +Subject: [PATCH 090/161] v4l2_m2m_enc: Improve debug trace (cherry picked from commit 113e89daffb329a0cd3d920abd483a4025664bf5) --- @@ -29565,7 +29565,7 @@ index d0d27e5bc2..c8c2de3d47 100644 From 02dca2b845125af7ec6dfb68bdc34726a45fee9c Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 18 Oct 2022 13:22:36 +0000 -Subject: [PATCH 091/151] v4l2_m2m_enc: Copy dest packets to memory if short of +Subject: [PATCH 091/161] v4l2_m2m_enc: Copy dest packets to memory if short of v4l2 buffers (cherry picked from commit aa4ebbda400b42db952fc713b26927fc8636b0e5) @@ -29604,7 +29604,7 @@ index c8c2de3d47..c23187e6e6 100644 From ced9a7d442a04be08fc23e0af310312299a5d5a0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 11:00:16 +0000 -Subject: [PATCH 092/151] v4l2_m2m_dec: Fix pts_best_effort guessing for +Subject: [PATCH 092/161] v4l2_m2m_dec: Fix pts_best_effort guessing for initial pts (cherry picked from commit 1af32e5c87586a0f7e76cdf19a012ddbcf3eac67) @@ -29629,7 +29629,7 @@ index bec9b22fcf..47b2735f82 100644 From 3e3cf6ed7280d8ad4f3eed17a6d18c2df3c0cd31 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:47:04 +0000 -Subject: [PATCH 093/151] v4l2_m2m_enc: Wait for frame or space in src Q in +Subject: [PATCH 093/161] 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 @@ -29691,7 +29691,7 @@ index c23187e6e6..524e9424a5 100644 From de9ec2bf6421b199aad9ea9dc7896a46c8813d94 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:54:29 +0000 -Subject: [PATCH 094/151] vf_deinterlace_v4l2m2m: Print dts rather that NOPTS +Subject: [PATCH 094/161] vf_deinterlace_v4l2m2m: Print dts rather that NOPTS in trace (cherry picked from commit e9b468f35f0c6ad9bfe96f5a05e449afa8ae074a) @@ -29718,7 +29718,7 @@ index ce875c2c61..7c6751b69c 100644 From d71a0a173240e18d518ae0b921ac43849524bd66 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 14:55:21 +0000 -Subject: [PATCH 095/151] vf_deinterlace_v4l2m2m: Ignore "wanted" when +Subject: [PATCH 095/161] vf_deinterlace_v4l2m2m: Ignore "wanted" when processing input If we gate send a frame to the outlink on its frame_wanted flag then we @@ -29751,7 +29751,7 @@ index 7c6751b69c..a173a291f8 100644 From 842e0a00288f9a2a862720990791b8eca9546955 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Oct 2022 15:00:43 +0000 -Subject: [PATCH 096/151] conf_native: Add --enable-gpl +Subject: [PATCH 096/161] conf_native: Add --enable-gpl (cherry picked from commit bab9bf4a2e39391940d88af2ce5d70236ac21f15) --- @@ -29774,7 +29774,7 @@ index f22d531ca4..082d9b5832 100755 From bf9aaf30818308a4651e00a2a64a0f65dc9a36e5 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 15 Nov 2022 13:33:00 +0000 -Subject: [PATCH 097/151] egl_vout: Make formatting consistent - no code +Subject: [PATCH 097/161] egl_vout: Make formatting consistent - no code changes --- @@ -30758,7 +30758,7 @@ index 7b9c610ace..a52cabb082 100644 From 4d3a3973a07994b0a6ec35626e514fc40f439fe3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 16:49:43 +0000 -Subject: [PATCH 098/151] v4l2m2m: reporganise get_raw_format for loop logic +Subject: [PATCH 098/161] v4l2m2m: reporganise get_raw_format for loop logic --- libavcodec/v4l2_context.c | 16 +++++----------- @@ -30806,7 +30806,7 @@ index 7031f3d340..79a31cf930 100644 From 123c5ef429ec6bd7d1875d621df88bb2ad7af0bd Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:49:12 +0000 -Subject: [PATCH 099/151] drm_vout: Set zpos on the plane we pick to ensure it +Subject: [PATCH 099/161] drm_vout: Set zpos on the plane we pick to ensure it is at the front --- @@ -30876,7 +30876,7 @@ index cfb33ce7c3..9bd9e04421 100644 From 0ee1c3b41774d05595376f8d25de2a901dbb12c7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:51:46 +0000 -Subject: [PATCH 100/151] drm_vout: Only set modifier flag and pass modifiers +Subject: [PATCH 100/161] drm_vout: Only set modifier flag and pass modifiers if there are some --- @@ -30936,7 +30936,7 @@ index 9bd9e04421..a56adea866 100644 From 4534e6981c1718eaeec4c5f58cdf5592ee7f0329 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 17:52:58 +0000 -Subject: [PATCH 101/151] drm_vout: Fix typo in error message +Subject: [PATCH 101/161] drm_vout: Fix typo in error message --- libavdevice/drm_vout.c | 2 +- @@ -30959,7 +30959,7 @@ index a56adea866..351abf1d60 100644 From 0469d1fb132a0d55593611c56e83733efe58045b Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 12 Dec 2022 18:00:41 +0000 -Subject: [PATCH 102/151] drm_vout: Add option to name the drm_module to use +Subject: [PATCH 102/161] drm_vout: Add option to name the drm_module to use --- libavdevice/drm_vout.c | 8 +++++--- @@ -31012,7 +31012,7 @@ index 351abf1d60..491e1dc608 100644 From 61cb9fc3ce06e0ecaeeec3add143bc3a82956853 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 13:01:00 +0000 -Subject: [PATCH 103/151] dmabufs: Rework to allow for non-CMA backends +Subject: [PATCH 103/161] dmabufs: Rework to allow for non-CMA backends --- libavcodec/v4l2_req_dmabufs.c | 161 ++++++++++++++++++++++++---------- @@ -31266,7 +31266,7 @@ index c4bbed18c6..1c3a5e861f 100644 From 288807720443bbddf4c83c3589d1877c7fd418c3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 13:07:58 +0000 -Subject: [PATCH 104/151] dmabufs: Use unref rather than deleet on cmabufs_ctl +Subject: [PATCH 104/161] dmabufs: Use unref rather than deleet on cmabufs_ctl --- libavcodec/v4l2_req_dmabufs.c | 12 +++++++++++- @@ -31354,7 +31354,7 @@ index 767ecb036a..db7ed13b6d 100644 From 9115f40c5f55873102312085f2e328d1a2101ae4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 14:21:40 +0000 -Subject: [PATCH 105/151] egl_vout: Remove redundant & completely broken debug +Subject: [PATCH 105/161] egl_vout: Remove redundant & completely broken debug --- libavdevice/egl_vout.c | 25 ------------------------- @@ -31400,7 +31400,7 @@ index a52cabb082..afc7afd13e 100644 From 34711d5a1429213b6f4cf8ad163e8e8d108626e7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 16:12:12 +0000 -Subject: [PATCH 106/151] v4l2m2m: Use offset from querybuf rather than always +Subject: [PATCH 106/161] v4l2m2m: Use offset from querybuf rather than always 0 --- @@ -31455,7 +31455,7 @@ index 1ac32c5989..d91d5d1dd0 100644 From 15458be3fe79c14f4fdcc2ad786508d1b647c914 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 17:57:27 +0000 -Subject: [PATCH 107/151] v4l2m2m: Fix crash if init errors out before setting +Subject: [PATCH 107/161] v4l2m2m: Fix crash if init errors out before setting avctx --- @@ -31479,7 +31479,7 @@ index 1e30d15fd8..ac6bae0dc3 100644 From 9f7f94c680b8aaedede9b3bcad37b645216cfcff Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 18:10:30 +0000 -Subject: [PATCH 108/151] v4l2_buffers: Add and use ctx_to_m2mctx + error debug +Subject: [PATCH 108/161] v4l2_buffers: Add and use ctx_to_m2mctx + error debug --- libavcodec/v4l2_buffers.c | 22 +++++++++++++++------- @@ -31546,7 +31546,7 @@ index 5ca58ea593..e28ef2d1e8 100644 From 6b8bb2c41828351cd3a6f40be353696ae36450b7 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 18:53:22 +0000 -Subject: [PATCH 109/151] v4l2m2m: Add ability to use cma alloced dmabufs as +Subject: [PATCH 109/161] v4l2m2m: Add ability to use cma alloced dmabufs as well as v4l2 mmap --- @@ -31807,7 +31807,7 @@ index 47b2735f82..4d17057298 100644 From 499bcdc4ed82c737ceab166a07b46e8ed8ccbc88 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Dec 2022 19:05:47 +0000 -Subject: [PATCH 110/151] testfilt: Skeleton of hw filter test code +Subject: [PATCH 110/161] testfilt: Skeleton of hw filter test code --- pi-util/testfilt.py | 83 +++++++++++++++++++++++++++++++++++++++++++++ @@ -31907,7 +31907,7 @@ index 0000000000..b322dac0c2 From 50ac318a472fd98e1e58605316ea6a2e8cde0a04 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 5 Jan 2023 14:39:30 +0000 -Subject: [PATCH 111/151] pixfmt: Add a #define to indicate presence of SAND +Subject: [PATCH 111/161] pixfmt: Add a #define to indicate presence of SAND formats --- @@ -31931,7 +31931,7 @@ index 22f70007c3..5cc780e7d5 100644 From 23a3132e094d449ea05657704c0cffc3f0762c28 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 11 Jan 2023 16:30:37 +0000 -Subject: [PATCH 112/151] v4l2_m2m_dec: Fix initial pkt send if no extradata +Subject: [PATCH 112/161] v4l2_m2m_dec: Fix initial pkt send if no extradata --- libavcodec/v4l2_m2m_dec.c | 4 ++-- @@ -31963,7 +31963,7 @@ index 4d17057298..9daf05adfe 100644 From f4f6b9f1af137153e574c704804033e83f2ed1a8 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 16 Jan 2023 16:05:09 +0000 -Subject: [PATCH 113/151] v4l2m2m_dec: Make capture timeout long once pending +Subject: [PATCH 113/161] v4l2m2m_dec: Make capture timeout long once pending count > 31 For some applications (ffmpeg command line) the current heuristic of adding @@ -32060,7 +32060,7 @@ index 9daf05adfe..c8ab883d7e 100644 From 39f49cdaefa4483914f703c3f352c8894b3b81fd Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 6 Feb 2023 19:23:16 +0000 -Subject: [PATCH 114/151] Initial buffersink alloc callback code +Subject: [PATCH 114/161] Initial buffersink alloc callback code (cherry picked from commit dde8d3c8f3cc279b9b92ed4f10a2e3990f4aadeb) --- @@ -32155,7 +32155,7 @@ index 64e08de53e..09737d322f 100644 From a63ae21e74ae48f1aedac53c18142b7596d041ad Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 30 Jan 2023 17:23:12 +0000 -Subject: [PATCH 115/151] v4l2_m2m_dec: Add a profile check +Subject: [PATCH 115/161] 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. @@ -32312,7 +32312,7 @@ index c8ab883d7e..098adf4821 100644 From f734a6ead04a8381fccfae53066866a02a9516d2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 1 Feb 2023 17:24:39 +0000 -Subject: [PATCH 116/151] v4l2_m2m_dec: Add extradata parse for h264 & hevc +Subject: [PATCH 116/161] 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 @@ -32443,7 +32443,7 @@ index 098adf4821..e64bc707d3 100644 From e28421e397743a94f5e37327ad234f59b6ae613d Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 20 Mar 2023 18:12:51 +0000 -Subject: [PATCH 117/151] clean_usr_libs: Now wipes the include files too +Subject: [PATCH 117/161] clean_usr_libs: Now wipes the include files too When swapping ffmpeg versions obsolete makefiles could confuse configure utilities. @@ -32480,7 +32480,7 @@ index b3b2d5509d..01bd6a6a22 100755 From dcabd30310b88b45359609bac27d5d0f9bbc6dc1 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 20 Mar 2023 18:15:08 +0000 -Subject: [PATCH 118/151] vulkan: Add missing decode extension defines +Subject: [PATCH 118/161] 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 @@ -32512,7 +32512,7 @@ index 2a9b5f4aac..11e7945f18 100644 From 0231c208843a5badc799590eb5b9de907d1c26b2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 21 Mar 2023 14:20:05 +0000 -Subject: [PATCH 119/151] v4l2_m2m_dec: Fix config file for finding if decoder +Subject: [PATCH 119/161] v4l2_m2m_dec: Fix config file for finding if decoder enabled Fixes parsing of extradata for profile testing. 5.x changed where that @@ -32538,7 +32538,7 @@ index e64bc707d3..91136f03da 100644 From 822baefed69372b3380144ab44226e2c6ad3e298 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 21 Mar 2023 14:23:20 +0000 -Subject: [PATCH 120/151] v4l2_m2m_dec: Display profile given if skipped in +Subject: [PATCH 120/161] v4l2_m2m_dec: Display profile given if skipped in debug --- @@ -32562,7 +32562,7 @@ index 91136f03da..d124c7b1fc 100644 From 6859fc2a8791c0fcc25851b77fed15a691ceb332 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 22 Mar 2023 16:08:08 +0000 -Subject: [PATCH 121/151] conf_native: Fix for 64-bit kernel with 32-bit +Subject: [PATCH 121/161] conf_native: Fix for 64-bit kernel with 32-bit userspace (cherry picked from commit 5bb1e09cea95b4215c6904b9b1a726e83bc5d327) @@ -32618,7 +32618,7 @@ index 082d9b5832..0a7d230f1b 100755 From c35f074854a922c0c025159ddddd1abfc562a3d2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:48:25 +0000 -Subject: [PATCH 122/151] conf_native: Add install prefix variation +Subject: [PATCH 122/161] conf_native: Add install prefix variation (cherry picked from commit 73c3019b534cb8f4b4e4c21995653f6ce440086d) --- @@ -32732,7 +32732,7 @@ index 0a7d230f1b..f0ed159594 100755 From 91ea652a95370a428f1353932b2a55dae7158acc Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 19 Apr 2023 10:47:58 +0000 -Subject: [PATCH 123/151] swcale: Add explicit bgr24->yv12 conversion +Subject: [PATCH 123/161] swcale: Add explicit bgr24->yv12 conversion (cherry picked from commit 9a22d429f46a038321c66a0cd54737177641b434) --- @@ -32890,7 +32890,7 @@ index 9af2e7ecc3..9047030ae4 100644 From 207ea47b2153b276b53cd5a87528dbc532a9f551 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:26:10 +0000 -Subject: [PATCH 124/151] swscale: Add unscaled XRGB->YUV420P functions +Subject: [PATCH 124/161] swscale: Add unscaled XRGB->YUV420P functions (cherry picked from commit 04cc32ee3f390de513ad8c6156c0c66b2c60abc8) --- @@ -33222,7 +33222,7 @@ index 9047030ae4..053c06adf5 100644 From b5672a2d361ec4f064ae116a3452282996cc87a0 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 11:35:44 +0000 -Subject: [PATCH 125/151] swscale: Add aarch64 unscaled RGB24->YUV420P +Subject: [PATCH 125/161] swscale: Add aarch64 unscaled RGB24->YUV420P (cherry picked from commit 0cf416312095ce5bea3d2f7e9b14736d4b3ed160) --- @@ -33480,7 +33480,7 @@ index d81110ec57..8cf40b65f5 100644 From f62603136ee2eaf781519bd70e445b03f80960da Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 27 Apr 2023 13:03:52 +0000 -Subject: [PATCH 126/151] rgb2rgb: Fix rgb24->yuv420p with arbitrary wxh +Subject: [PATCH 126/161] rgb2rgb: Fix rgb24->yuv420p with arbitrary wxh (cherry picked from commit 58771fdf0218dc670d8a343824f540e2f6e8785d) --- @@ -34010,7 +34010,7 @@ index 8cf40b65f5..978ab443ea 100644 From cf020c89ac47620c4a5390d0333e9ea70fbfa7b8 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Apr 2023 15:36:07 +0000 -Subject: [PATCH 127/151] rgb2rgb: Use asm unconditionally +Subject: [PATCH 127/161] rgb2rgb: Use asm unconditionally (cherry picked from commit 7c216c0804836b31c0ea093bb1dde5ab387724b1) --- @@ -34074,7 +34074,7 @@ index f10c4ef2de..6a0e2dcc09 100644 From 1895fdcaf403f403736ab52d1cb69dce7c964b66 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 27 Apr 2023 13:01:43 +0000 -Subject: [PATCH 128/151] tests/swscale: Add options for width and height on +Subject: [PATCH 128/161] tests/swscale: Add options for width and height on the command line (cherry picked from commit eb8a09779688fc05bf204fdfcd063b04cda07271) @@ -34233,7 +34233,7 @@ index 6c38041ddb..4cf41d9f64 100644 From 94e48653a6bd1b8438887b486927e87b56651455 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 26 Apr 2023 16:31:23 +0000 -Subject: [PATCH 129/151] tests/swscale: Add a timing option +Subject: [PATCH 129/161] 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 @@ -34318,7 +34318,7 @@ index 4cf41d9f64..12776ffec7 100644 From 406806d0b9d9cb113deb0d083a28cbccabab6825 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 20 Apr 2023 13:40:36 +0000 -Subject: [PATCH 130/151] swscale: RGB->YUV420 fix C template to allow odd +Subject: [PATCH 130/161] swscale: RGB->YUV420 fix C template to allow odd widths (cherry picked from commit 08b2023e7b5292df0adc6593e4d20087f9cef5c8) @@ -34455,7 +34455,7 @@ index 053c06adf5..52469b2e4a 100644 From 68c6482d9473ce774e87cac2455a8c7b3e2d99b4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 4 May 2023 14:26:14 +0000 -Subject: [PATCH 131/151] rtpenc: Add code to send H264 new extradata in +Subject: [PATCH 131/161] rtpenc: Add code to send H264 new extradata in sidedata Fixes issue with pi V4L2 H264 encode which cannot create extradata @@ -34508,7 +34508,7 @@ index a8d296a154..f67dc2a15a 100644 From 5240cc7fc3abed8af5f178c5461ca9fe11a7d5e4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Mon, 5 Jun 2023 08:34:38 +0000 -Subject: [PATCH 132/151] rgb2rgb: Fix luma narrow+saturation instruction +Subject: [PATCH 132/161] rgb2rgb: Fix luma narrow+saturation instruction (cherry picked from commit 9cdac1c08ad5c0aea28907d1d3fd0bdda387955a) --- @@ -34579,7 +34579,7 @@ index 978ab443ea..476ca723a0 100644 From 9474d9d227f2af488d5d2bd614c5c707479ca3c3 Mon Sep 17 00:00:00 2001 From: John Cox Date: Sun, 4 Jun 2023 13:37:59 +0000 -Subject: [PATCH 133/151] v4l2_m2m_dec: Tweak pending count to use dts & +Subject: [PATCH 133/161] v4l2_m2m_dec: Tweak pending count to use dts & reorder size (cherry picked from commit ca438b382c90f9a5f58f4708205e6ac25395db2a) @@ -34744,7 +34744,7 @@ index d124c7b1fc..13af62e819 100644 From 2145b9c9177f0fe9569ce39e2d4eb629caf8bd47 Mon Sep 17 00:00:00 2001 From: John Cox Date: Wed, 7 Jun 2023 11:14:52 +0000 -Subject: [PATCH 134/151] v4l2_m2m: Add encode size check +Subject: [PATCH 134/161] 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 @@ -34820,7 +34820,7 @@ index f802687b1b..28d9ed4988 100644 From 805985ea191c98885a74dbf994b1ca11551cd81e Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 9 Jun 2023 10:28:12 +0000 -Subject: [PATCH 135/151] vf_bwdif: Add attributes to ask for vectorization +Subject: [PATCH 135/161] vf_bwdif: Add attributes to ask for vectorization (cherry picked from commit 281250290ba5c2dcd8676e9a261050e65c10bcb7) --- @@ -34933,7 +34933,7 @@ index 65c617ebb3..09e68523bb 100644 From f4012f09da1c57a0aa5db01f9096992d0c385f7b Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 13 Jun 2023 13:07:55 +0000 -Subject: [PATCH 136/151] v4l2m2m_dec: Fix h264 reorder size if no sps +Subject: [PATCH 136/161] v4l2m2m_dec: Fix h264 reorder size if no sps initially (cherry picked from commit 8832f7924bf47cbca0de251d7b406917f958ebf4) @@ -34959,7 +34959,7 @@ index 13af62e819..11c83b2d66 100644 From fd31937e4befa2368d48e234d66fb962246bf777 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 18:03:29 +0000 -Subject: [PATCH 137/151] sand_fns: Add missing uxtw for neon stride +Subject: [PATCH 137/161] sand_fns: Add missing uxtw for neon stride --- libavutil/aarch64/rpi_sand_neon.S | 2 ++ @@ -34989,7 +34989,7 @@ index 2f07d9674c..19411cf3f1 100644 From f6a19a36ffe0dbe0a6e2e450dafec6711db19057 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 18:12:16 +0000 -Subject: [PATCH 138/151] sand_fns: Rework aarch64 neon +Subject: [PATCH 138/161] sand_fns: Rework aarch64 neon sand30_lines_to_planar_c16 Previous version could overflow its write buffer on small buffers @@ -35359,7 +35359,7 @@ index 19411cf3f1..af7e2a88c4 100644 From 68356e594ff32e18e419a476889d958dc24af4b2 Mon Sep 17 00:00:00 2001 From: John Cox Date: Fri, 30 Jun 2023 19:41:06 +0000 -Subject: [PATCH 139/151] sand_fns: Minor optimisations to aarch64 neon +Subject: [PATCH 139/161] sand_fns: Minor optimisations to aarch64 neon --- libavutil/aarch64/rpi_sand_neon.S | 140 ++++++------------------------ @@ -35558,7 +35558,7 @@ index af7e2a88c4..11658de0c8 100644 From 3abb0dcc453aba0a069bc1a8f26ba77913c5ef2b Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Jul 2023 18:43:32 +0000 -Subject: [PATCH 140/151] sand_fns: Add test for neon to sand30 fns so they can +Subject: [PATCH 140/161] sand_fns: Add test for neon to sand30 fns so they can be tested by checkasm --- @@ -35606,7 +35606,7 @@ index b6071e2928..0626bb06cb 100644 From fb72aa34ec2c42fc595bb1a6c32b599da870fa2b Mon Sep 17 00:00:00 2001 From: John Cox Date: Sat, 1 Jul 2023 18:43:57 +0000 -Subject: [PATCH 141/151] checkasm: Add tests for rpi_sand sand30 fns +Subject: [PATCH 141/161] 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. @@ -35800,7 +35800,7 @@ index a4e95541f5..6fda6d227e 100644 From d798c7b90dd63bca6f9878b1fb30ec1d8f0b9a5e Mon Sep 17 00:00:00 2001 From: James Darnley Date: Mon, 20 Feb 2023 20:55:08 +0100 -Subject: [PATCH 142/151] avfilter/bwdif: move filter_line init to a dedicated +Subject: [PATCH 142/161] avfilter/bwdif: move filter_line init to a dedicated function (cherry picked from commit b503b5a0cf80f38ecf4737c012b621b7e94f242a) @@ -35876,7 +35876,7 @@ index e24e5cd9b1..ba7bc40c3d 100644 From 0eb9c627c07931cf93c4932e07e0df6c0ce860fd Mon Sep 17 00:00:00 2001 From: James Darnley Date: Mon, 20 Feb 2023 20:55:08 +0100 -Subject: [PATCH 143/151] checkasm: add test for bwdif +Subject: [PATCH 143/161] checkasm: add test for bwdif (cherry picked from commit 087faf8cac51e5e20a5f41b36b8d4c2705a10039) --- @@ -36032,7 +36032,7 @@ index 6fda6d227e..1620ab0be0 100644 From c19ab5f6e7f8dd9dff5704510db98a81a1304f80 Mon Sep 17 00:00:00 2001 From: John Cox Date: Thu, 6 Jul 2023 13:56:18 +0000 -Subject: [PATCH 144/151] Revert "vf_bwdif: Add attributes to ask for +Subject: [PATCH 144/161] Revert "vf_bwdif: Add attributes to ask for vectorization" This reverts commit 281250290ba5c2dcd8676e9a261050e65c10bcb7. @@ -36147,7 +36147,7 @@ index 539fabbd46..34e8c5e234 100644 From 093eddd9ef66a7db9e637f3acfe51d950c87f613 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:39 +0000 -Subject: [PATCH 145/151] tests/checkasm: Add test for vf_bwdif filter_intra +Subject: [PATCH 145/161] tests/checkasm: Add test for vf_bwdif filter_intra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36216,7 +36216,7 @@ index 46224bb575..034bbabb4c 100644 From 28ef7402381b6fe241f81e21f302a23f8af674bf Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:40 +0000 -Subject: [PATCH 146/151] avfilter/vf_bwdif: Add neon for filter_intra +Subject: [PATCH 146/161] avfilter/vf_bwdif: Add neon for filter_intra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36503,7 +36503,7 @@ index 34e8c5e234..6ec8bbab5d 100644 From 2f8199a41cfd43595352899e722646052b0db2ee Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:41 +0000 -Subject: [PATCH 147/151] tests/checkasm: Add test for vf_bwdif filter_edge +Subject: [PATCH 147/161] tests/checkasm: Add test for vf_bwdif filter_edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36584,7 +36584,7 @@ index 034bbabb4c..5fdba09fdc 100644 From 171d7f201503812617b8e320c83cc33120425923 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:42 +0000 -Subject: [PATCH 148/151] avfilter/vf_bwdif: Add neon for filter_edge +Subject: [PATCH 148/161] avfilter/vf_bwdif: Add neon for filter_edge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -36884,7 +36884,7 @@ index 6ec8bbab5d..688c2d2572 100644 From abf6588935bce275ba302766bcd8c3bb7a523d3c Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:43 +0000 -Subject: [PATCH 149/151] avfilter/vf_bwdif: Add neon for filter_line +Subject: [PATCH 149/161] avfilter/vf_bwdif: Add neon for filter_line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -37201,7 +37201,7 @@ index 688c2d2572..2dc47f9614 100644 From 7601de6ab2604d1f530e4b8f20f409d1ec2ae6a4 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:44 +0000 -Subject: [PATCH 150/151] avfilter/vf_bwdif: Add a filter_line3 method for +Subject: [PATCH 150/161] avfilter/vf_bwdif: Add a filter_line3 method for optimisation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -37449,7 +37449,7 @@ index 5fdba09fdc..3399cacdf7 100644 From 120058b7abd0db1d222b1e197207de8226fdfd94 Mon Sep 17 00:00:00 2001 From: John Cox Date: Tue, 4 Jul 2023 14:04:45 +0000 -Subject: [PATCH 151/151] avfilter/vf_bwdif: Add neon for filter_line3 +Subject: [PATCH 151/161] avfilter/vf_bwdif: Add neon for filter_line3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -37790,3 +37790,906 @@ index f185e94e3c..ae9aab20cd 100644 // =========================================================================== // // void filter_line( + +From ef057ba172ece9646e1b4dd84a8f9587af28844f 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 + +(cherry picked from commit d6de45b15a0c96bfdc96bbc441963a60945e5eba) +--- + libavcodec/weak_link.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libavcodec/weak_link.c b/libavcodec/weak_link.c +index f234a985b9..5a79e89ed7 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) + struct ff_weak_link_master * w = malloc(sizeof(*w)); + if (!w) + return NULL; ++ atomic_init(&w->ref_count, 0); + w->ptr = p; + if (pthread_rwlock_init(&w->lock, NULL)) { + free(w); + +From 506426ba08bc90e7efa712b549b29d8e1c231344 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 + valgrind warn) + +(cherry picked from commit befa42878d054d1fba53d5da14406faaae224daf) +--- + libavcodec/v4l2_m2m.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c +index 28d9ed4988..238ceea235 100644 +--- a/libavcodec/v4l2_m2m.c ++++ b/libavcodec/v4l2_m2m.c +@@ -340,8 +340,11 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) + ff_v4l2_context_release(&s->output); + + dmabufs_ctl_unref(&s->db_ctl); +- close(s->fd); +- s->fd = -1; ++ ++ if (s->fd != -1) { ++ close(s->fd); ++ s->fd = -1; ++ } + + 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: John Cox +Date: Wed, 26 Jul 2023 16:29:39 +0000 +Subject: [PATCH 154/161] v4l2_req_devscan: Fix udev leak + +(cherry picked from commit 53b17ffd8a8890ef483163f3c9b0f96b437303f1) +--- + libavcodec/v4l2_req_devscan.c | 4 +++- + 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 +--- 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) + } + + udev_enumerate_unref(enumerate); ++ udev_unref(udev); + + *pscan = scan; + return 0; + + fail: +- udev_unref(udev); ++ if (udev) ++ udev_unref(udev); + devscan_delete(&scan); + return ret; + } + +From 175ef7dc323be400a0570c53725a8da4ac1fa213 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 + +(cherry picked from commit bfea15c07b4301cd1208981c8f221e5e3a598b34) +--- + libavcodec/v4l2_m2m.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libavcodec/v4l2_m2m.c b/libavcodec/v4l2_m2m.c +index 238ceea235..add64b8e63 100644 +--- a/libavcodec/v4l2_m2m.c ++++ b/libavcodec/v4l2_m2m.c +@@ -338,6 +338,7 @@ int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv) + } + + ff_v4l2_context_release(&s->output); ++ av_buffer_unref(&s->device_ref); + + dmabufs_ctl_unref(&s->db_ctl); + + +From e324b9d956d7dab58a5790efcfb8e46c95868ff4 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 + struct changes + +(cherry picked from commit 8a836af420ed8c8dba90e2fd88691bcaa0668f8a) +--- + libavcodec/v4l2_m2m_dec.c | 11 ++++++++--- + 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 +--- a/libavcodec/v4l2_m2m_dec.c ++++ b/libavcodec/v4l2_m2m_dec.c +@@ -1004,11 +1004,13 @@ parse_extradata(AVCodecContext * const avctx, V4L2m2mContext * const s) + #if CONFIG_H264_DECODER + case AV_CODEC_ID_H264: + { +- H264ParamSets ps = {{NULL}}; ++ H264ParamSets ps; + int is_avc = 0; + int nal_length_size = 0; + int ret; + ++ memset(&ps, 0, sizeof(ps)); ++ + ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size, + &ps, &is_avc, &nal_length_size, + avctx->err_recognition, avctx); +@@ -1034,12 +1036,15 @@ parse_extradata(AVCodecContext * const avctx, V4L2m2mContext * const s) + #if CONFIG_HEVC_DECODER + case AV_CODEC_ID_HEVC: + { +- HEVCParamSets ps = {{NULL}}; +- HEVCSEI sei = {{{{0}}}}; ++ HEVCParamSets ps; ++ HEVCSEI sei; + int is_nalff = 0; + int nal_length_size = 0; + int ret; + ++ memset(&ps, 0, sizeof(ps)); ++ memset(&sei, 0, sizeof(sei)); ++ + ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size, + &ps, &sei, &is_nalff, &nal_length_size, + avctx->err_recognition, 0, avctx); + +From ae9cd86b532ae2a3800981c23a0aeac15a83f918 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 + decoder device + +Move the get_format callback to after the decoder device has been found. +This means that get_format will never be called if there is no chance +that init will succeed which helps programs (such as VLC) that do +significant processing in that callback to avoid it. It also means that +the list of formats availible can actually represent reality. + +(cherry picked from commit 3b27cb41d7df73c054452fa49269988d4df32409) +--- + libavcodec/v4l2_context.c | 41 +++++++++++++ + libavcodec/v4l2_context.h | 13 ++++ + libavcodec/v4l2_m2m_dec.c | 122 ++++++++++++++++++++++++++++---------- + 3 files changed, 145 insertions(+), 31 deletions(-) + +diff --git a/libavcodec/v4l2_context.c b/libavcodec/v4l2_context.c +index 79a31cf930..978a487ca9 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) + return 0; + } + ++// Return 0 terminated list of drm fourcc video formats for this context ++// NULL if none found or error ++// Returned list is malloced so must be freed ++uint32_t * ff_v4l2_context_enum_drm_formats(V4L2Context *ctx, unsigned int *pN) ++{ ++ unsigned int i; ++ unsigned int n = 0; ++ unsigned int size = 0; ++ uint32_t * e = NULL; ++ *pN = 0; ++ ++ for (i = 0; i < 1024; ++i) { ++ struct v4l2_fmtdesc fdesc = { ++ .index = i, ++ .type = ctx->type ++ }; ++ ++ if (ioctl(ctx_to_m2mctx(ctx)->fd, VIDIOC_ENUM_FMT, &fdesc)) ++ return e; ++ ++ if (n + 1 >= size) { ++ unsigned int newsize = (size == 0) ? 16 : size * 2; ++ uint32_t * t = av_realloc(e, newsize * sizeof(*t)); ++ if (!t) ++ return e; ++ e = t; ++ size = newsize; ++ } ++ ++ e[n] = fdesc.pixelformat; ++ e[++n] = 0; ++ if (pN) ++ *pN = n; ++ } ++ ++ // If we've looped 1024 times we are clearly confused ++ *pN = 0; ++ av_free(e); ++ return NULL; ++} ++ + int ff_v4l2_context_get_format(V4L2Context* ctx, int probe) + { + struct v4l2_format_update fmt = { 0 }; +diff --git a/libavcodec/v4l2_context.h b/libavcodec/v4l2_context.h +index 5afed3e6ec..f4240f7ddd 100644 +--- a/libavcodec/v4l2_context.h ++++ b/libavcodec/v4l2_context.h +@@ -151,6 +151,19 @@ int ff_v4l2_context_set_format(V4L2Context* ctx); + */ + int ff_v4l2_context_get_format(V4L2Context* ctx, int probe); + ++/** ++ * Get the list of drm fourcc pixel formats for this context ++ * ++ * @param[in] ctx A pointer to a V4L2Context. See V4L2Context ++ * description for required variables. ++ * @param[in] pN A pointer to receive the number of formats ++ * found. May be NULL if not wanted. ++ * @return Pointer to malloced list of zero terminated formats, ++ * NULL if none or error. As list is malloced it must be ++ * freed. ++ */ ++uint32_t * ff_v4l2_context_enum_drm_formats(V4L2Context *ctx, unsigned int *pN); ++ + /** + * Releases a V4L2Context. + * +diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c +index 584e0b8825..c4f38cc24e 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) + }; + + static int +-check_size(AVCodecContext * const avctx, V4L2m2mContext * const s) ++check_size(AVCodecContext * const avctx, V4L2m2mContext * const s, const uint32_t fcc) + { + unsigned int i; +- const uint32_t fcc = ff_v4l2_get_format_pixelformat(&s->capture.format); + const uint32_t w = avctx->coded_width; + const uint32_t h = avctx->coded_height; + +@@ -1073,12 +1072,91 @@ parse_extradata(AVCodecContext * const avctx, V4L2m2mContext * const s) + } + } + ++static int ++choose_capture_format(AVCodecContext * const avctx, V4L2m2mContext * const s) ++{ ++ const V4L2m2mPriv * const priv = avctx->priv_data; ++ 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; ++ unsigned int pref_n = 1; ++ int rv = AVERROR(ENOENT); ++ ++ if (!fmts) ++ return AVERROR(ENOENT); ++ ++ if ((fmts2 = av_malloc(sizeof(*fmts2) * (fmts_n + 2))) == NULL) { ++ rv = AVERROR(ENOMEM); ++ goto error; ++ } ++ ++ // Filter for formats that are supported by ffmpeg and ++ // can accomodate the stream size ++ 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); ++ if (f == AV_PIX_FMT_NONE) ++ continue; ++ ++ if (check_size(avctx, s, fmts[i]) != 0) ++ continue; ++ ++ if (f == priv->pix_fmt) ++ 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; ++ ++ gf_pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); ++ 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, ++ gf_pix_fmt, av_get_pix_fmt_name(gf_pix_fmt)); ++ ++ if (gf_pix_fmt == AV_PIX_FMT_NONE) ++ goto error; ++ ++ if (gf_pix_fmt == AV_PIX_FMT_DRM_PRIME || avctx->pix_fmt == AV_PIX_FMT_DRM_PRIME) { ++ avctx->pix_fmt = AV_PIX_FMT_DRM_PRIME; ++ s->capture.av_pix_fmt = avctx->sw_pix_fmt; ++ s->output_drm = 1; ++ } ++ else { ++ avctx->pix_fmt = gf_pix_fmt; ++ s->capture.av_pix_fmt = gf_pix_fmt; ++ s->output_drm = 0; ++ } ++ ++ // Get format converts capture.av_pix_fmt back into a V4L2 format in the context ++ if ((rv = ff_v4l2_context_get_format(&s->capture, 0)) != 0) ++ goto error; ++ rv = ff_v4l2_context_set_format(&s->capture); ++ ++error: ++ av_free(fmts2); ++ av_free(fmts); ++ return rv; ++} ++ + static av_cold int v4l2_decode_init(AVCodecContext *avctx) + { + V4L2Context *capture, *output; + V4L2m2mContext *s; + V4L2m2mPriv *priv = avctx->priv_data; +- int gf_pix_fmt; + int ret; + + av_log(avctx, AV_LOG_TRACE, "<<< %s\n", __func__); +@@ -1122,28 +1200,8 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx) + capture->av_pix_fmt = avctx->pix_fmt; + capture->min_buf_size = 0; + +- /* the client requests the codec to generate DRM frames: +- * - data[0] will therefore point to the returned AVDRMFrameDescriptor +- * check the ff_v4l2_buffer_to_avframe conversion function. +- * - the DRM frame format is passed in the DRM frame descriptor layer. +- * check the v4l2_get_drm_frame function. +- */ +- +- avctx->sw_pix_fmt = avctx->pix_fmt; +- gf_pix_fmt = ff_get_format(avctx, avctx->codec->pix_fmts); +- 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, +- gf_pix_fmt, av_get_pix_fmt_name(gf_pix_fmt)); +- +- if (gf_pix_fmt == AV_PIX_FMT_DRM_PRIME || avctx->pix_fmt == AV_PIX_FMT_DRM_PRIME) { +- avctx->pix_fmt = AV_PIX_FMT_DRM_PRIME; +- s->output_drm = 1; +- } +- else { +- capture->av_pix_fmt = gf_pix_fmt; +- s->output_drm = 0; +- } ++ capture->av_pix_fmt = AV_PIX_FMT_NONE; ++ s->output_drm = 0; + + s->db_ctl = NULL; + if (priv->dmabuf_alloc != NULL && strcmp(priv->dmabuf_alloc, "v4l2") != 0) { +@@ -1185,19 +1243,21 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx) + return ret; + } + +- if ((ret = v4l2_prepare_decoder(s)) < 0) +- return ret; +- + if ((ret = get_quirks(avctx, s)) != 0) + return ret; + +- if ((ret = check_size(avctx, s)) != 0) +- return ret; +- + if ((ret = check_profile(avctx, s)) != 0) { + av_log(avctx, AV_LOG_WARNING, "Profile %d not supported by decode\n", avctx->profile); + return ret; + } ++ ++ // Size check done as part of format filtering ++ if ((ret = choose_capture_format(avctx, s)) != 0) ++ return ret; ++ ++ if ((ret = v4l2_prepare_decoder(s)) < 0) ++ return ret; ++ + return 0; + } + + +From 24221a3f821043f1ce11dcd1682b986e44ae4513 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 + imported + +Thanks to Ratchanan Srirattanamet for finding this +--- + libavcodec/v4l2_req_dmabufs.c | 3 ++- + 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 +--- a/libavcodec/v4l2_req_dmabufs.c ++++ b/libavcodec/v4l2_req_dmabufs.c +@@ -232,7 +232,8 @@ void dmabuf_free(struct dmabuf_h * dh) + request_log("%s: Free: %zd, total=%zd, bufs=%d\n", __func__, dh->size, total_size, total_bufs); + #endif + +- dh->fns->buf_free(dh); ++ if (dh->fns != NULL && dh->fns->buf_free) ++ dh->fns->buf_free(dh); + + if (dh->mapptr != MAP_FAILED && dh->mapptr != NULL) + munmap(dh->mapptr, dh->size); + +From 05ceac3f3a7b5a04cc50c769a489e819895ca345 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 + flip correct way + +--- + libswscale/aarch64/rgb2rgb_neon.S | 15 ++++++--------- + 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 +--- a/libswscale/aarch64/rgb2rgb_neon.S ++++ b/libswscale/aarch64/rgb2rgb_neon.S +@@ -92,15 +92,12 @@ endfunc + + function ff_rgb24toyv12_aarch64, export=1 + ldr x15, [sp, #8] +- ld1 {v3.s}[2], [x15], #4 +- ld1 {v3.s}[1], [x15], #4 +- ld1 {v3.s}[0], [x15], #4 +- ld1 {v4.s}[2], [x15], #4 +- ld1 {v4.s}[1], [x15], #4 +- ld1 {v4.s}[0], [x15], #4 +- ld1 {v5.s}[2], [x15], #4 +- ld1 {v5.s}[1], [x15], #4 +- ld1 {v5.s}[0], [x15] ++ ld3 {v3.s, v4.s, v5.s}[0], [x15], #12 ++ ld3 {v3.s, v4.s, v5.s}[1], [x15], #12 ++ ld3 {v3.s, v4.s, v5.s}[2], [x15] ++ mov v6.16b, v3.16b ++ mov v3.16b, v5.16b ++ mov v5.16b, v6.16b + b 99f + endfunc + + +From 2860e13304a1b051f06110d2002b3371266d9e7f 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 + explicit + +--- + libswscale/aarch64/rgb2rgb_neon.S | 276 ++++++++++-------------------- + 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 +--- a/libswscale/aarch64/rgb2rgb_neon.S ++++ b/libswscale/aarch64/rgb2rgb_neon.S +@@ -78,6 +78,67 @@ function ff_interleave_bytes_neon, export=1 + ret + endfunc + ++// Expand rgb2 into r0+r1/g0+g1/b0+b1 ++.macro XRGB3Y r0, g0, b0, r1, g1, b1, r2, g2, b2 ++ uxtl \r0\().8h, \r2\().8b ++ uxtl \g0\().8h, \g2\().8b ++ uxtl \b0\().8h, \b2\().8b ++ ++ uxtl2 \r1\().8h, \r2\().16b ++ uxtl2 \g1\().8h, \g2\().16b ++ uxtl2 \b1\().8h, \b2\().16b ++.endm ++ ++// Expand rgb2 into r0+r1/g0+g1/b0+b1 ++// and pick every other el to put back into rgb2 for chroma ++.macro XRGB3YC r0, g0, b0, r1, g1, b1, r2, g2, b2 ++ XRGB3Y \r0, \g0, \b0, \r1, \g1, \b1, \r2, \g2, \b2 ++ ++ bic \r2\().8h, #0xff, LSL #8 ++ bic \g2\().8h, #0xff, LSL #8 ++ bic \b2\().8h, #0xff, LSL #8 ++.endm ++ ++.macro SMLAL3 d0, d1, s0, s1, s2, c0, c1, c2 ++ smull \d0\().4s, \s0\().4h, \c0 ++ smlal \d0\().4s, \s1\().4h, \c1 ++ smlal \d0\().4s, \s2\().4h, \c2 ++ smull2 \d1\().4s, \s0\().8h, \c0 ++ smlal2 \d1\().4s, \s1\().8h, \c1 ++ smlal2 \d1\().4s, \s2\().8h, \c2 ++.endm ++ ++// d0 may be s0 ++// s0, s2 corrupted ++.macro SHRN_Y d0, s0, s1, s2, s3, k128h ++ shrn \s0\().4h, \s0\().4s, #12 ++ shrn2 \s0\().8h, \s1\().4s, #12 ++ add \s0\().8h, \s0\().8h, \k128h\().8h // +128 (>> 3 = 16) ++ sqrshrun \d0\().8b, \s0\().8h, #3 ++ shrn \s2\().4h, \s2\().4s, #12 ++ shrn2 \s2\().8h, \s3\().4s, #12 ++ add \s2\().8h, \s2\().8h, \k128h\().8h ++ sqrshrun2 \d0\().16b, v28.8h, #3 ++.endm ++ ++.macro SHRN_C d0, s0, s1, k128b ++ shrn \s0\().4h, \s0\().4s, #14 ++ shrn2 \s0\().8h, \s1\().4s, #14 ++ sqrshrn \s0\().8b, \s0\().8h, #1 ++ add \d0\().8b, \s0\().8b, \k128b\().8b // +128 ++.endm ++ ++.macro STB2V s0, n, a ++ st1 {\s0\().b}[(\n+0)], [\a], #1 ++ st1 {\s0\().b}[(\n+1)], [\a], #1 ++.endm ++ ++.macro STB4V s0, n, a ++ STB2V \s0, (\n+0), \a ++ STB2V \s0, (\n+2), \a ++.endm ++ ++ + // void ff_rgb24toyv12_aarch64( + // const uint8_t *src, // x0 + // uint8_t *ydst, // x1 +@@ -111,7 +172,7 @@ endfunc + // int lumStride, // w6 + // int chromStride, // w7 + // int srcStr, // [sp, #0] +-// int32_t *rgb2yuv); // [sp, #8] ++// int32_t *rgb2yuv); // [sp, #8] (including Mac) + + // regs + // v0-2 Src bytes - reused as chroma src +@@ -130,13 +191,12 @@ endfunc + // v30 V out + // v31 V tmp + +-// Assumes Little Endian in tail stores & conversion matrix +- + function ff_bgr24toyv12_aarch64, export=1 + ldr x15, [sp, #8] + ld3 {v3.s, v4.s, v5.s}[0], [x15], #12 + ld3 {v3.s, v4.s, v5.s}[1], [x15], #12 + ld3 {v3.s, v4.s, v5.s}[2], [x15] ++ + 99: + ldr w14, [sp, #0] + movi v7.8b, #128 +@@ -167,73 +227,29 @@ function ff_bgr24toyv12_aarch64, export=1 + b.le 13f + + 10: +- uxtl v16.8h, v0.8b +- uxtl v17.8h, v1.8b +- uxtl v18.8h, v2.8b +- +- uxtl2 v20.8h, v0.16b +- uxtl2 v21.8h, v1.16b +- uxtl2 v22.8h, v2.16b +- +- bic v0.8h, #0xff, LSL #8 +- bic v1.8h, #0xff, LSL #8 +- bic v2.8h, #0xff, LSL #8 ++ XRGB3YC v16, v17, v18, v20, v21, v22, v0, v1, v2 + + // Testing shows it is faster to stack the smull/smlal ops together + // rather than interleave them between channels and indeed even the + // shift/add sections seem happier not interleaved + + // Y0 +- smull v26.4s, v16.4h, v3.h[0] +- smlal v26.4s, v17.4h, v4.h[0] +- smlal v26.4s, v18.4h, v5.h[0] +- smull2 v27.4s, v16.8h, v3.h[0] +- smlal2 v27.4s, v17.8h, v4.h[0] +- smlal2 v27.4s, v18.8h, v5.h[0] ++ SMLAL3 v26, v27, v16, v17, v18, v3.h[0], v4.h[0], v5.h[0] + // Y1 +- smull v28.4s, v20.4h, v3.h[0] +- smlal v28.4s, v21.4h, v4.h[0] +- smlal v28.4s, v22.4h, v5.h[0] +- smull2 v29.4s, v20.8h, v3.h[0] +- smlal2 v29.4s, v21.8h, v4.h[0] +- smlal2 v29.4s, v22.8h, v5.h[0] +- shrn v26.4h, v26.4s, #12 +- shrn2 v26.8h, v27.4s, #12 +- add v26.8h, v26.8h, v6.8h // +128 (>> 3 = 16) +- sqrshrun v26.8b, v26.8h, #3 +- shrn v28.4h, v28.4s, #12 +- shrn2 v28.8h, v29.4s, #12 +- add v28.8h, v28.8h, v6.8h +- sqrshrun2 v26.16b, v28.8h, #3 +- // Y0/Y1 ++ SMLAL3 v28, v29, v20, v21, v22, v3.h[0], v4.h[0], v5.h[0] ++ SHRN_Y v26, v26, v27, v28, v29, v6 + + // U + // Vector subscript *2 as we loaded into S but are only using H +- smull v24.4s, v0.4h, v3.h[2] +- smlal v24.4s, v1.4h, v4.h[2] +- smlal v24.4s, v2.4h, v5.h[2] +- smull2 v25.4s, v0.8h, v3.h[2] +- smlal2 v25.4s, v1.8h, v4.h[2] +- smlal2 v25.4s, v2.8h, v5.h[2] ++ SMLAL3 v24, v25, v0, v1, v2, v3.h[2], v4.h[2], v5.h[2] + + // V +- smull v30.4s, v0.4h, v3.h[4] +- smlal v30.4s, v1.4h, v4.h[4] +- smlal v30.4s, v2.4h, v5.h[4] +- smull2 v31.4s, v0.8h, v3.h[4] +- smlal2 v31.4s, v1.8h, v4.h[4] +- smlal2 v31.4s, v2.8h, v5.h[4] ++ SMLAL3 v30, v31, v0, v1, v2, v3.h[4], v4.h[4], v5.h[4] + + ld3 {v0.16b, v1.16b, v2.16b}, [x10], #48 + +- shrn v24.4h, v24.4s, #14 +- shrn2 v24.8h, v25.4s, #14 +- sqrshrn v24.8b, v24.8h, #1 +- add v24.8b, v24.8b, v7.8b // +128 +- shrn v30.4h, v30.4s, #14 +- shrn2 v30.8h, v31.4s, #14 +- sqrshrn v30.8b, v30.8h, #1 +- add v30.8b, v30.8b, v7.8b // +128 ++ SHRN_C v24, v24, v25, v7 ++ SHRN_C v30, v30, v31, v7 + + subs w9, w9, #16 + +@@ -250,69 +266,21 @@ function ff_bgr24toyv12_aarch64, export=1 + 13: + // Body is simple copy of main loop body minus preload + +- uxtl v16.8h, v0.8b +- uxtl v17.8h, v1.8b +- uxtl v18.8h, v2.8b +- +- uxtl2 v20.8h, v0.16b +- uxtl2 v21.8h, v1.16b +- uxtl2 v22.8h, v2.16b +- +- bic v0.8h, #0xff, LSL #8 +- bic v1.8h, #0xff, LSL #8 +- bic v2.8h, #0xff, LSL #8 +- ++ XRGB3YC v16, v17, v18, v20, v21, v22, v0, v1, v2 + // Y0 +- smull v26.4s, v16.4h, v3.h[0] +- smlal v26.4s, v17.4h, v4.h[0] +- smlal v26.4s, v18.4h, v5.h[0] +- smull2 v27.4s, v16.8h, v3.h[0] +- smlal2 v27.4s, v17.8h, v4.h[0] +- smlal2 v27.4s, v18.8h, v5.h[0] ++ SMLAL3 v26, v27, v16, v17, v18, v3.h[0], v4.h[0], v5.h[0] + // Y1 +- smull v28.4s, v20.4h, v3.h[0] +- smlal v28.4s, v21.4h, v4.h[0] +- smlal v28.4s, v22.4h, v5.h[0] +- smull2 v29.4s, v20.8h, v3.h[0] +- smlal2 v29.4s, v21.8h, v4.h[0] +- smlal2 v29.4s, v22.8h, v5.h[0] +- shrn v26.4h, v26.4s, #12 +- shrn2 v26.8h, v27.4s, #12 +- add v26.8h, v26.8h, v6.8h // +128 (>> 3 = 16) +- sqrshrun v26.8b, v26.8h, #3 +- shrn v28.4h, v28.4s, #12 +- shrn2 v28.8h, v29.4s, #12 +- add v28.8h, v28.8h, v6.8h +- sqrshrun2 v26.16b, v28.8h, #3 +- // Y0/Y1 +- ++ SMLAL3 v28, v29, v20, v21, v22, v3.h[0], v4.h[0], v5.h[0] ++ SHRN_Y v26, v26, v27, v28, v29, v6 + // U +- // Vector subscript *2 as we loaded into S but are only using H +- smull v24.4s, v0.4h, v3.h[2] +- smlal v24.4s, v1.4h, v4.h[2] +- smlal v24.4s, v2.4h, v5.h[2] +- smull2 v25.4s, v0.8h, v3.h[2] +- smlal2 v25.4s, v1.8h, v4.h[2] +- smlal2 v25.4s, v2.8h, v5.h[2] +- ++ SMLAL3 v24, v25, v0, v1, v2, v3.h[2], v4.h[2], v5.h[2] + // V +- smull v30.4s, v0.4h, v3.h[4] +- smlal v30.4s, v1.4h, v4.h[4] +- smlal v30.4s, v2.4h, v5.h[4] +- smull2 v31.4s, v0.8h, v3.h[4] +- smlal2 v31.4s, v1.8h, v4.h[4] +- smlal2 v31.4s, v2.8h, v5.h[4] ++ SMLAL3 v30, v31, v0, v1, v2, v3.h[4], v4.h[4], v5.h[4] + + cmp w9, #-16 + +- shrn v24.4h, v24.4s, #14 +- shrn2 v24.8h, v25.4s, #14 +- sqrshrn v24.8b, v24.8h, #1 +- add v24.8b, v24.8b, v7.8b // +128 +- shrn v30.4h, v30.4s, #14 +- shrn2 v30.8h, v31.4s, #14 +- sqrshrn v30.8b, v30.8h, #1 +- add v30.8b, v30.8b, v7.8b // +128 ++ SHRN_C v24, v24, v25, v7 ++ SHRN_C v30, v30, v31, v7 + + // Here: + // w9 == 0 width % 16 == 0, tail done +@@ -347,14 +315,14 @@ function ff_bgr24toyv12_aarch64, export=1 + 2: + tbz w9, #3, 1f + st1 {v26.8b}, [x11], #8 +- st1 {v24.s}[0], [x12], #4 +- st1 {v30.s}[0], [x13], #4 ++ STB4V v24, 0, x12 ++ STB4V v30, 0, x13 + 1: tbz w9, #2, 1f +- st1 {v26.s}[2], [x11], #4 +- st1 {v24.h}[2], [x12], #2 +- st1 {v30.h}[2], [x13], #2 ++ STB4V v26 8, x11 ++ STB2V v24, 4, x12 ++ STB2V v30, 4, x13 + 1: tbz w9, #1, 1f +- st1 {v26.h}[6], [x11], #2 ++ STB2V v26, 12, x11 + st1 {v24.b}[6], [x12], #1 + st1 {v30.b}[6], [x13], #1 + 1: tbz w9, #0, 1f +@@ -381,44 +349,15 @@ function ff_bgr24toyv12_aarch64, export=1 + b.le 13f + + 10: +- uxtl v16.8h, v0.8b +- uxtl v17.8h, v1.8b +- uxtl v18.8h, v2.8b +- +- uxtl2 v20.8h, v0.16b +- uxtl2 v21.8h, v1.16b +- uxtl2 v22.8h, v2.16b +- +- // Testing shows it is faster to stack the smull/smlal ops together +- // rather than interleave them between channels and indeed even the +- // shift/add sections seem happier not interleaved +- ++ XRGB3Y v16, v17, v18, v20, v21, v22, v0, v1, v2 + // Y0 +- smull v26.4s, v16.4h, v3.h[0] +- smlal v26.4s, v17.4h, v4.h[0] +- smlal v26.4s, v18.4h, v5.h[0] +- smull2 v27.4s, v16.8h, v3.h[0] +- smlal2 v27.4s, v17.8h, v4.h[0] +- smlal2 v27.4s, v18.8h, v5.h[0] ++ SMLAL3 v26, v27, v16, v17, v18, v3.h[0], v4.h[0], v5.h[0] + // Y1 +- smull v28.4s, v20.4h, v3.h[0] +- smlal v28.4s, v21.4h, v4.h[0] +- smlal v28.4s, v22.4h, v5.h[0] +- smull2 v29.4s, v20.8h, v3.h[0] +- smlal2 v29.4s, v21.8h, v4.h[0] +- smlal2 v29.4s, v22.8h, v5.h[0] ++ SMLAL3 v28, v29, v20, v21, v22, v3.h[0], v4.h[0], v5.h[0] + + ld3 {v0.16b, v1.16b, v2.16b}, [x10], #48 + +- shrn v26.4h, v26.4s, #12 +- shrn2 v26.8h, v27.4s, #12 +- add v26.8h, v26.8h, v6.8h // +128 (>> 3 = 16) +- sqrshrun v26.8b, v26.8h, #3 +- shrn v28.4h, v28.4s, #12 +- shrn2 v28.8h, v29.4s, #12 +- add v28.8h, v28.8h, v6.8h +- sqrshrun2 v26.16b, v28.8h, #3 +- // Y0/Y1 ++ SHRN_Y v26, v26, v27, v28, v29, v6 + + subs w9, w9, #16 + +@@ -433,40 +372,15 @@ function ff_bgr24toyv12_aarch64, export=1 + 13: + // Body is simple copy of main loop body minus preload + +- uxtl v16.8h, v0.8b +- uxtl v17.8h, v1.8b +- uxtl v18.8h, v2.8b +- +- uxtl2 v20.8h, v0.16b +- uxtl2 v21.8h, v1.16b +- uxtl2 v22.8h, v2.16b +- ++ XRGB3Y v16, v17, v18, v20, v21, v22, v0, v1, v2 + // Y0 +- smull v26.4s, v16.4h, v3.h[0] +- smlal v26.4s, v17.4h, v4.h[0] +- smlal v26.4s, v18.4h, v5.h[0] +- smull2 v27.4s, v16.8h, v3.h[0] +- smlal2 v27.4s, v17.8h, v4.h[0] +- smlal2 v27.4s, v18.8h, v5.h[0] ++ SMLAL3 v26, v27, v16, v17, v18, v3.h[0], v4.h[0], v5.h[0] + // Y1 +- smull v28.4s, v20.4h, v3.h[0] +- smlal v28.4s, v21.4h, v4.h[0] +- smlal v28.4s, v22.4h, v5.h[0] +- smull2 v29.4s, v20.8h, v3.h[0] +- smlal2 v29.4s, v21.8h, v4.h[0] +- smlal2 v29.4s, v22.8h, v5.h[0] ++ SMLAL3 v28, v29, v20, v21, v22, v3.h[0], v4.h[0], v5.h[0] + + cmp w9, #-16 + +- shrn v26.4h, v26.4s, #12 +- shrn2 v26.8h, v27.4s, #12 +- add v26.8h, v26.8h, v6.8h // +128 (>> 3 = 16) +- sqrshrun v26.8b, v26.8h, #3 +- shrn v28.4h, v28.4s, #12 +- shrn2 v28.8h, v29.4s, #12 +- add v28.8h, v28.8h, v6.8h +- sqrshrun2 v26.16b, v28.8h, #3 +- // Y0/Y1 ++ SHRN_Y v26, v26, v27, v28, v29, v6 + + // Here: + // w9 == 0 width % 16 == 0, tail done +@@ -500,9 +414,9 @@ function ff_bgr24toyv12_aarch64, export=1 + tbz w9, #3, 1f + st1 {v26.8b}, [x11], #8 + 1: tbz w9, #2, 1f +- st1 {v26.s}[2], [x11], #4 ++ STB4V v26, 8, x11 + 1: tbz w9, #1, 1f +- st1 {v26.h}[6], [x11], #2 ++ STB2V v26, 12, x11 + 1: tbz w9, #0, 1f + st1 {v26.b}[14], [x11] + 1: + +From d2aa73557f69d03094919873215a8aa9405f00d5 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 + +--- + 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 +--- 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, + .plane = i, + .flags = O_RDWR, // *** Arguably O_RDONLY would be fine + }; +- if (ioctl(mbc->vfd, VIDIOC_EXPBUF, &xbuf) == 0) ++ if (ioctl(mbc->vfd, VIDIOC_EXPBUF, &xbuf) == 0) { + be->dh[i] = dmabuf_import(xbuf.fd, planes[i].length); ++ close(xbuf.fd); // dmabuf_import dups the fd so close this one ++ } + } + else { + be->dh[i] = dmabuf_import_mmap(