修复:校验 V4L2 编码协商尺寸,避免送帧越界崩溃

This commit is contained in:
mofeng-git
2026-09-27 13:32:34 +08:00
parent f8fb64ad8c
commit 7e6dc91095
3 changed files with 46 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ RUN dpkg --add-architecture armhf
# Install cross-compiler and native build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
patch \
pkg-config \
cmake \
nasm \
@@ -239,6 +240,9 @@ RUN github_prefix="" \
&& make install \
&& rm -rf /tmp/opus /tmp/opus.tar.gz
# Reject raw formats smaller than the requested frame before any V4L2 upload.
COPY build/cross/patches/0001-v4l2-m2m-reject-undersized-encoder-format.patch /tmp/ffmpeg-v4l2-size.patch
# Download and build FFmpeg with RKMPP support
RUN mkdir -p /tmp/ffmpeg-build && cd /tmp/ffmpeg-build \
&& github_prefix="" \
@@ -250,6 +254,7 @@ RUN mkdir -p /tmp/ffmpeg-build && cd /tmp/ffmpeg-build \
&& git remote add origin "${github_prefix}https://github.com/nyanmisaka/ffmpeg-rockchip.git" \
&& git fetch --depth 1 origin ${FFMPEG_ROCKCHIP_REV} \
&& git checkout --detach FETCH_HEAD \
&& patch -p1 < /tmp/ffmpeg-v4l2-size.patch \
&& cd .. \
# Build RKMPP
&& mkdir -p rkmpp/build && cd rkmpp/build \