@martijnbraam @bart If you are doing big redesign... here's how to do video recording.
# Design
ARM has some limitations with DMA, which results in data in DMABUF
being uncached. That is problem on in both V4L->CPU and GPU->CPU
directions, still we can get good video recording on existing
hardware. Here is how to do it.
Put sensor in 4MPix or so mode, and capture to DMABUF.
Reading whole DMABUF from CPU pretty slow, but you can sample data to
do AF/AE. You can also set buffer aside for future reading, and thus
take high-resolution raw photos during video recording.
GPU can work with uncached memory without penalty, and debayer with
downscale is pretty simple operation. It will also provide better
results than downscale in sensor followed by debayer.
GPU can multiply with color conversion matrix easily, and conversion
to YUV format is simple to do. Using subsampled color mode such as
YUY2 enables faster movie encoding and reduces ammount of data
transfered GPU->CPU. As that's uncached and slow, YUV is a big win.
Getting data from GPU->CPU is slow and tricky. You probably want GPU
to compute on frame n while CPU thread is copying from frame n-1 to
CPU memory.
Rest is simple. You can use gstreamer to both encode movie and provide
preview, you can do another GPU pass for preview data. Above can get
0.8MPix, 30fps recording on Librem 5.