crosvm/media/ffmpeg/bindgen.sh
Alexandre Courbot aa4c70e3da media: ffmpeg: upgrade to ffmpeg 5.0 libraries
Update the ffmpeg bindings and build script to use 5.0 and update our
code to match the API changes since 4.4.

BUG=None
TEST=cargo test -p ffmpeg
TEST=cargo test --features "video-decoder,ffmpeg" -p devices video
TEST=v4l2r example from the crosvm book passses.

Change-Id: If7820a4dd270d715e89c60d55f89b9730f40e864
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3835501
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@google.com>
Tested-by: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
Reviewed-by: Takaya Saeki <takayas@chromium.org>
Reviewed-by: Keiichi Watanabe <keiichiw@chromium.org>
2022-08-23 01:47:48 +00:00

31 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Copyright 2022 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Regenerate ffmpeg bindgen bindings.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
VERSIONS="media/ffmpeg/VERSIONS"
#source tools/impl/bindgen-common.sh
bindgen media/ffmpeg/src/bindings.h -o media/ffmpeg/src/ffmpeg.rs \
--allowlist-function "av_.*" \
--allowlist-function "avcodec_.*" \
--allowlist-function "sws_.*" \
--allowlist-function "av_image_.*" \
--allowlist-var "FF_PROFILE.*" \
--allowlist-var "AV_.*" \
--allowlist-var "AVERROR_.*"
echo "# These version numbers are updated by the bindgen.sh script" >$VERSIONS
echo "avcodec: `pkg-config --modversion libavcodec`" >>$VERSIONS
echo "avutil: `pkg-config --modversion libavutil`" >>$VERSIONS
echo "swscale: `pkg-config --modversion libswscale`" >>$VERSIONS
echo "Libraries versions updated in the VERSIONS file."
echo "Please check the minimum required versions in build.rs and make sure that"
echo "the major number is the same"