Skip to content

Commit 5f107af

Browse files
committed
add dvdread lib
1 parent c8ac050 commit 5f107af

22 files changed

+696
-17
lines changed

apple/compile-any.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cd "$THIS_DIR"
3030

3131
function usage() {
3232
echo " useage:"
33-
echo " $0 [ios|macos] [build|rebuild|lipo|clean] [all|fdk-aac|ffmpeg|lame|libyuv|openssl|opus|x264|bluray|ass|freetype|fribidi|harfbuzz|unibreak] [arm64|x86_64|all] [opts...]"
33+
echo " $0 [ios|macos] [build|rebuild|lipo|clean] [all|fdk-aac|ffmpeg|lame|libyuv|openssl|opus|x264|bluray|ass|freetype|fribidi|harfbuzz|unibreak|dvdread] [arm64|x86_64|all] [opts...]"
3434
}
3535

3636
if [[ "$PLAT" != 'ios' && "$PLAT" != 'macos' ]]; then

apple/compile-cfgs/dvdread

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
#
18+
#
19+
# brew install nasm
20+
# If you really want to compile without asm, configure with --disable-asm.
21+
22+
# LIB_DEPENDS_BIN using string because bash can't export array chttps://stackoverflow.com/questions/5564418/exporting-an-array-in-bash-script
23+
# configure: error: Package requirements (openssl) were not met
24+
25+
export LIB_NAME='dvdread'
26+
export LIPO_LIBS="libdvdread"
27+
export LIB_DEPENDS_BIN="automake autoconf libtool"

apple/compile-cfgs/list.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
libyuv openssl opus bluray dav1d freetype harfbuzz fribidi unibreak ass ffmpeg
1+
libyuv openssl opus bluray dav1d freetype harfbuzz fribidi unibreak ass dvdread ffmpeg

apple/do-compile/dvdread.sh

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
set -e
19+
20+
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
21+
source $THIS_DIR/../../tools/env_assert.sh
22+
23+
echo "=== [$0] check env begin==="
24+
env_assert "XC_ARCH"
25+
env_assert "XC_BUILD_SOURCE"
26+
env_assert "XC_PRODUCT_ROOT"
27+
env_assert "XC_BUILD_PREFIX"
28+
env_assert "XC_BUILD_NAME"
29+
env_assert "XC_DEPLOYMENT_TARGET"
30+
env_assert "XCRUN_SDK_PATH"
31+
env_assert "XCRUN_CC"
32+
echo "XC_OPTS:$XC_OPTS"
33+
echo "===check env end==="
34+
35+
# prepare build config
36+
CFG_FLAGS="--prefix=$XC_BUILD_PREFIX --disable-dependency-tracking --disable-silent-rules --disable-apidoc --enable-static --disable-shared"
37+
CFLAGS="-arch $XC_ARCH $XC_DEPLOYMENT_TARGET $XC_OTHER_CFLAGS"
38+
39+
if [[ "$XC_OPTS" == "debug" ]];then
40+
CFG_FLAGS="${CFG_FLAGS} use_examples=yes"
41+
fi
42+
43+
# for cross compile
44+
if [[ $(uname -m) != "$XC_ARCH" || "$XC_FORCE_CROSS" ]];then
45+
echo "[*] cross compile, on $(uname -m) compile $XC_PLAT $XC_ARCH."
46+
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
47+
CFLAGS="$CFLAGS -isysroot $XCRUN_SDK_PATH"
48+
CFG_FLAGS="$CFG_FLAGS --host=$XC_ARCH-apple-darwin --with-sysroot=$XCRUN_SDK_PATH"
49+
fi
50+
51+
echo "----------------------"
52+
echo "[*] configurate $LIB_NAME"
53+
echo "----------------------"
54+
55+
cd $XC_BUILD_SOURCE
56+
57+
if [[ -f 'configure' ]]; then
58+
echo "reuse configure"
59+
else
60+
echo "auto generate configure"
61+
autoreconf -if 1>/dev/null
62+
fi
63+
64+
65+
echo
66+
echo "CC: $XCRUN_CC"
67+
echo "CFG_FLAGS: $CFG_FLAGS"
68+
echo "CFLAGS: $CFLAGS"
69+
echo
70+
71+
./configure $CFG_FLAGS \
72+
CC="$XCRUN_CC" \
73+
CFLAGS="$CFLAGS" \
74+
LDFLAGS="$CFLAGS" \
75+
1>/dev/null
76+
77+
#----------------------
78+
echo "----------------------"
79+
echo "[*] compile $LIB_NAME"
80+
echo "----------------------"
81+
82+
make install -j8 1>/dev/null

apple/do-compile/ffmpeg.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,27 @@ fi
256256
#just wait videotoolbox support decode av1
257257
# CFG_FLAGS="$CFG_FLAGS --enable-decoder=av1"
258258

259+
echo "----------------------"
260+
echo "[*] check dvdread"
261+
262+
if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" || -f "${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig/dvdread.pc" ]]; then
263+
264+
CFG_FLAGS="$CFG_FLAGS --enable-libdvdread"
265+
266+
if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
267+
MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
268+
fi
269+
270+
if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" ]]; then
271+
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig"
272+
else
273+
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig"
274+
fi
275+
276+
echo "[*] --enable-libdvdread"
277+
else
278+
echo "[*] --disable-libdvdread"
279+
fi
259280
if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
260281
export PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR"
261282
fi

init-any.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ cd "$THIS_DIR"
3535
function usage()
3636
{
3737
echo " useage:"
38-
echo " $0 [ios,macos,all] [all|fdk-aac|ffmpeg|lame|libyuv|openssl|opus|x264|bluray|ass|freetype|fribidi|harfbuzz|unibreak] [all,arm64,x86_64]"
38+
echo " $0 [ios,macos,all] [all|fdk-aac|ffmpeg|lame|libyuv|openssl|opus|x264|bluray|ass|freetype|fribidi|harfbuzz|unibreak|dvdread] [all,arm64,x86_64]"
3939
}
4040

4141
if [[ "$SKIP_PULL_BASE" ]];then
@@ -51,6 +51,9 @@ if [[ "x$LIBS" == "x" || "$LIBS" == "all" ]]; then
5151
fi
5252

5353
if [[ "$PLAT" == 'ios' || "$PLAT" == 'macos' || "$PLAT" == 'all' ]]; then
54+
echo "=== will init ==="
55+
echo "$LIBS"
56+
echo "==="
5457
for lib in $LIBS
5558
do
5659
echo "===[init $lib]===================="

init-cfgs/dvdread

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<qianlongxu@gmail.com>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
# you can export GIT_DVDREAD_UPSTREAM=git@xx:yy/opusfile.git use your mirror
19+
if [[ "$GIT_DVDREAD_UPSTREAM" != "" ]] ;then
20+
export GIT_UPSTREAM="$GIT_DVDREAD_UPSTREAM"
21+
else
22+
export GIT_UPSTREAM=https://code.videolan.org/videolan/libdvdread.git
23+
fi
24+
25+
export REPO_DIR=dvdread
26+
export GIT_LOCAL_REPO=build/extra/$REPO_DIR
27+
export GIT_COMMIT=6.1.3
28+
export GIT_REPO_VERSION=6.1.3

patches/ffmpeg-release-5.1/0001-h264_ps-null-pointer-fault-tolerant.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From b0ae2afaabf62c0ce3e37753621f6f0669b054a0 Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Mon, 22 May 2023 17:21:37 +0800
4-
Subject: [PATCH 01/14] h264_ps null pointer fault tolerant
4+
Subject: [PATCH 01/15] h264_ps null pointer fault tolerant
55

66
---
77
libavcodec/h264_ps.c | 8 ++++----

patches/ffmpeg-release-5.1/0002-flv-support-hevc.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From c9eee98fb63278c87a3e81fde5cce5de688ef95c Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Mon, 22 May 2023 17:27:59 +0800
4-
Subject: [PATCH 02/14] flv support hevc
4+
Subject: [PATCH 02/15] flv support hevc
55

66
---
77
libavformat/flv.h | 1 +

patches/ffmpeg-release-5.1/0003-dict-add-more-util-method.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 3a90f5a893e5042c0a319c8f50eee6a1ad29de8e Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Fri, 29 Jul 2022 12:50:10 +0800
4-
Subject: [PATCH 03/14] dict add more util method
4+
Subject: [PATCH 03/15] dict add more util method
55

66
---
77
libavutil/dict.c | 39 ++++++++++++++++++++++++++++++++++++++-

0 commit comments

Comments
 (0)