2022-06-02 02:18:48 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2022 The ChromiumOS Authors
|
2022-06-02 02:18:48 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
2022-09-13 19:37:28 +00:00
|
|
|
|
2022-06-02 02:18:48 +00:00
|
|
|
# Regenerate ffmpeg bindgen bindings.
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|
|
|
|
|
|
|
VERSIONS="media/ffmpeg/VERSIONS"
|
|
|
|
|
2022-09-13 21:21:37 +00:00
|
|
|
source tools/impl/bindgen-common.sh
|
2022-06-02 02:18:48 +00:00
|
|
|
|
2022-09-13 21:21:37 +00:00
|
|
|
bindgen_generate \
|
2022-06-02 02:18:48 +00:00
|
|
|
--allowlist-function "av_.*" \
|
|
|
|
--allowlist-function "avcodec_.*" \
|
|
|
|
--allowlist-function "sws_.*" \
|
|
|
|
--allowlist-function "av_image_.*" \
|
|
|
|
--allowlist-var "FF_PROFILE.*" \
|
|
|
|
--allowlist-var "AV_.*" \
|
2022-09-13 21:21:37 +00:00
|
|
|
--allowlist-var "AVERROR_.*" \
|
|
|
|
media/ffmpeg/src/bindings.h \
|
|
|
|
> media/ffmpeg/src/ffmpeg.rs
|
2022-06-02 02:18:48 +00:00
|
|
|
|
2022-08-18 02:26:48 +00:00
|
|
|
echo "# These version numbers are updated by the bindgen.sh script" >$VERSIONS
|
2022-06-02 02:18:48 +00:00
|
|
|
echo "avcodec: `pkg-config --modversion libavcodec`" >>$VERSIONS
|
|
|
|
echo "avutil: `pkg-config --modversion libavutil`" >>$VERSIONS
|
|
|
|
echo "swscale: `pkg-config --modversion libswscale`" >>$VERSIONS
|
|
|
|
|
2022-09-13 21:59:19 +00:00
|
|
|
if ! git --no-pager diff --exit-code $VERSIONS; then
|
|
|
|
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"
|
|
|
|
fi
|