1#!/usr/bin/env bash 2# Copyright 2022 The ChromiumOS Authors 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6# Regenerate ffmpeg bindgen bindings. 7 8set -euo pipefail 9cd "$(dirname "${BASH_SOURCE[0]}")/../.." 10 11VERSIONS="media/ffmpeg/VERSIONS" 12 13source tools/impl/bindgen-common.sh 14 15bindgen_generate \ 16 --allowlist-function "av_.*" \ 17 --allowlist-function "avcodec_.*" \ 18 --allowlist-function "sws_.*" \ 19 --allowlist-function "av_image_.*" \ 20 --allowlist-var "FF_PROFILE.*" \ 21 --allowlist-var "AV_.*" \ 22 --allowlist-var "AVERROR_.*" \ 23 media/ffmpeg/src/bindings.h \ 24 > media/ffmpeg/src/ffmpeg.rs 25 26echo "# These version numbers are updated by the bindgen.sh script" >$VERSIONS 27echo "avcodec: `pkg-config --modversion libavcodec`" >>$VERSIONS 28echo "avutil: `pkg-config --modversion libavutil`" >>$VERSIONS 29echo "swscale: `pkg-config --modversion libswscale`" >>$VERSIONS 30 31if ! git --no-pager diff --exit-code $VERSIONS; then 32 echo "Libraries versions updated in the $VERSIONS file." 33 echo "Please check the minimum required versions in build.rs and make sure that" 34 echo "the major number is the same" 35fi 36