Skip to content

Commit 1d8fc63

Browse files
committed
bluray and dvd use dummy protocol
1 parent dd0ca8b commit 1d8fc63

23 files changed

+249
-814
lines changed

apple/do-compile/any.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ function main() {
147147
'build')
148148
resolve_dep
149149
for arch in $archs; do
150-
init_env $arch
150+
init_arch_env $arch
151151
do_compile $arch
152152
echo
153153
done
154154

155-
do_lipo_all "$XC_ALL_ARCHS"
155+
do_lipo_all "$archs"
156156
;;
157157
'rebuild')
158158
echo '---clean for rebuild-----------------'

apple/do-compile/bluray.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,22 @@ env_assert "XC_DEPLOYMENT_TARGET"
3030
env_assert "XCRUN_SDK_PATH"
3131
env_assert "XCRUN_CC"
3232
env_assert "THREAD_COUNT"
33+
env_assert "XC_OTHER_CFLAGS"
3334
echo "XC_OPTS:$XC_OPTS"
3435
echo "===check env end==="
3536

37+
if [[ "$XC_OPTS" == "debug" ]];then
38+
export XC_OTHER_CFLAGS="${XC_OTHER_CFLAGS} -g"
39+
else
40+
export XC_OTHER_CFLAGS="${XC_OTHER_CFLAGS} -Os"
41+
fi
42+
3643
# prepare build config
3744
CFG_FLAGS="--prefix=$XC_BUILD_PREFIX --disable-shared --disable-dependency-tracking --disable-silent-rules --disable-bdjava-jar --without-freetype --without-fontconfig --disable-doxygen-doc"
3845
CFLAGS="-arch $XC_ARCH $XC_DEPLOYMENT_TARGET $XC_OTHER_CFLAGS"
3946

4047
if [[ "$XC_OPTS" == "debug" ]];then
41-
CFG_FLAGS="${CFG_FLAGS} use_examples=yes"
48+
CFG_FLAGS="${CFG_FLAGS} use_examples=yes --disable-optimizations"
4249
fi
4350

4451
# for cross compile

apple/do-compile/ffmpeg.sh

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if [[ "$XC_OPTS" == "debug" ]]; then
6666
CFG_FLAGS="$CFG_FLAGS --disable-optimizations"
6767
CFG_FLAGS="$CFG_FLAGS --enable-debug"
6868
CFG_FLAGS="$CFG_FLAGS --disable-small"
69-
C_FLAGS="$C_FLAGS -D DEBUG_BLURAY=1"
69+
#C_FLAGS="$C_FLAGS -D DEBUG_BLURAY=1"
7070
else
7171
CFG_FLAGS="$CFG_FLAGS --enable-optimizations"
7272
CFG_FLAGS="$CFG_FLAGS --disable-debug"
@@ -198,35 +198,6 @@ else
198198
echo "[*] --disable-libopus"
199199
fi
200200

201-
echo "----------------------"
202-
echo "[*] check bluray"
203-
204-
# with bluray
205-
if [[ -f "${XC_PRODUCT_ROOT}/bluray-$XC_ARCH/lib/pkgconfig/libbluray.pc" ]]; then
206-
207-
# --enable-libxml2
208-
CFG_FLAGS="$CFG_FLAGS --enable-libbluray --enable-protocol=bluray"
209-
210-
if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
211-
MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
212-
fi
213-
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/bluray-$XC_ARCH/lib/pkgconfig"
214-
215-
echo "[*] --enable-libbluray --enable-protocol=bluray"
216-
elif [[ -f "${XC_PRODUCT_ROOT}/universal/bluray/lib/pkgconfig/libbluray.pc" ]]; then
217-
# --enable-libxml2
218-
CFG_FLAGS="$CFG_FLAGS --enable-libbluray --enable-protocol=bluray"
219-
220-
if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
221-
MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
222-
fi
223-
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/universal/bluray/lib/pkgconfig"
224-
225-
echo "[*] --enable-libbluray --enable-protocol=bluray"
226-
else
227-
echo "[*] --disable-libbluray --disable-protocol=bluray"
228-
fi
229-
230201
echo "----------------------"
231202
echo "[*] check dav1d"
232203

@@ -259,27 +230,56 @@ fi
259230
#just wait videotoolbox support decode av1
260231
# CFG_FLAGS="$CFG_FLAGS --enable-decoder=av1"
261232

262-
echo "----------------------"
263-
echo "[*] check dvdread"
233+
# echo "----------------------"
234+
# echo "[*] check bluray"
264235

265-
if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" || -f "${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig/dvdread.pc" ]]; then
236+
# # with bluray
237+
# if [[ -f "${XC_PRODUCT_ROOT}/bluray-$XC_ARCH/lib/pkgconfig/libbluray.pc" ]]; then
266238

267-
CFG_FLAGS="$CFG_FLAGS --enable-libdvdread"
239+
# # --enable-libxml2
240+
# CFG_FLAGS="$CFG_FLAGS --enable-libbluray --enable-protocol=bluray"
268241

269-
if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
270-
MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
271-
fi
242+
# if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
243+
# MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
244+
# fi
245+
# MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/bluray-$XC_ARCH/lib/pkgconfig"
272246

273-
if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" ]]; then
274-
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig"
275-
else
276-
MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig"
277-
fi
247+
# echo "[*] --enable-libbluray --enable-protocol=bluray"
248+
# elif [[ -f "${XC_PRODUCT_ROOT}/universal/bluray/lib/pkgconfig/libbluray.pc" ]]; then
249+
# # --enable-libxml2
250+
# CFG_FLAGS="$CFG_FLAGS --enable-libbluray --enable-protocol=bluray"
278251

279-
echo "[*] --enable-libdvdread"
280-
else
281-
echo "[*] --disable-libdvdread"
282-
fi
252+
# if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
253+
# MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
254+
# fi
255+
# MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/universal/bluray/lib/pkgconfig"
256+
257+
# echo "[*] --enable-libbluray --enable-protocol=bluray"
258+
# else
259+
# echo "[*] --disable-libbluray --disable-protocol=bluray"
260+
# fi
261+
262+
# echo "----------------------"
263+
# echo "[*] check dvdread"
264+
265+
# if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" || -f "${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig/dvdread.pc" ]]; then
266+
267+
# CFG_FLAGS="$CFG_FLAGS --enable-libdvdread"
268+
269+
# if [[ -n "$MY_PKG_CONFIG_LIBDIR" ]]; then
270+
# MY_PKG_CONFIG_LIBDIR="$MY_PKG_CONFIG_LIBDIR:"
271+
# fi
272+
273+
# if [[ -f "${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig/dvdread.pc" ]]; then
274+
# MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/dvdread-$XC_ARCH/lib/pkgconfig"
275+
# else
276+
# MY_PKG_CONFIG_LIBDIR="${MY_PKG_CONFIG_LIBDIR}${XC_PRODUCT_ROOT}/universal/dvdread/lib/pkgconfig"
277+
# fi
278+
279+
# echo "[*] --enable-libdvdread"
280+
# else
281+
# echo "[*] --disable-libdvdread"
282+
# fi
283283

284284

285285
echo "----------------------"

apple/init-env.sh

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ echo "support thread count:$THREAD_COUNT"
2323

2424
XCRUN_DEVELOPER=`xcode-select -print-path`
2525
if [ ! -d "$XCRUN_DEVELOPER" ]; then
26-
echo "xcode path is not set correctly $XCRUN_DEVELOPER does not exist (most likely because of xcode > 4.3)"
27-
echo "run"
28-
echo "sudo xcode-select -switch <xcode path>"
29-
echo "for default installation:"
30-
echo "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer"
31-
exit 1
26+
echo "xcode path is not set correctly $XCRUN_DEVELOPER does not exist (most likely because of xcode > 4.3)"
27+
echo "run"
28+
echo "sudo xcode-select -switch <xcode path>"
29+
echo "for default installation:"
30+
echo "sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer"
31+
exit 1
3232
fi
3333

34-
case $XCRUN_DEVELOPER in
35-
*\ * )
36-
echo "Your Xcode path contains whitespaces, which is not supported."
37-
exit 1
38-
;;
34+
case $XCRUN_DEVELOPER in
35+
*\ * )
36+
echo "Your Xcode path contains whitespaces, which is not supported."
37+
exit 1
38+
;;
3939
esac
4040

4141
echo $(xcodebuild -version)
@@ -51,13 +51,13 @@ function install_depends() {
5151
fi
5252
}
5353

54-
function init_env () {
54+
function init_arch_env () {
5555

5656
if [[ -z "$XC_PLAT" ]]; then
5757
echo "XC_PLAT can't be nil."
5858
exit 1
5959
fi
60-
60+
6161
if [[ "$XC_PLAT" == 'ios' ]]; then
6262
case $1 in
6363
'x86_64')
@@ -69,31 +69,33 @@ function init_env () {
6969
export XC_DEPLOYMENT_TARGET='-miphoneos-version-min=11.0'
7070
;;
7171
esac
72-
export XC_OTHER_CFLAGS='-fembed-bitcode -Os'
72+
73+
export XC_OTHER_CFLAGS="-fembed-bitcode"
74+
7375
else
7476
export XCRUN_PLATFORM='MacOSX'
7577
export MACOSX_DEPLOYMENT_TARGET=10.11
7678
export XC_DEPLOYMENT_TARGET="-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET"
77-
export XC_OTHER_CFLAGS='-Os'
79+
export XC_OTHER_CFLAGS=""
7880
fi
79-
81+
8082
#common xcode configuration
8183
export XC_TAGET_OS="darwin"
8284
export DEBUG_INFORMATION_FORMAT=dwarf-with-dsym
8385

8486
# macosx
8587
export XCRUN_SDK=`echo $XCRUN_PLATFORM | tr '[:upper:]' '[:lower:]'`
86-
# xcrun -sdk macosx clang
88+
# xcrun -sdk macosx clang
8789
export XCRUN_CC="xcrun -sdk $XCRUN_SDK clang"
8890
export XCRUN_CXX="xcrun -sdk $XCRUN_SDK clang++"
89-
# xcrun -sdk macosx --show-sdk-platform-path
91+
# xcrun -sdk macosx --show-sdk-platform-path
9092
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
9193
export XCRUN_SDK_PLATFORM_PATH=`xcrun -sdk $XCRUN_SDK --show-sdk-platform-path`
92-
# xcrun -sdk macosx --show-sdk-path
94+
# xcrun -sdk macosx --show-sdk-path
9395
# /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk
9496
export XCRUN_SDK_PATH=`xcrun -sdk $XCRUN_SDK --show-sdk-path`
9597
}
9698

9799
export -f install_depends
98-
export -f init_env
100+
export -f init_arch_env
99101
export XC_ALL_ARCHS="x86_64 arm64"
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
From 89be19cefe0ad81337e72189af7db3dfe63107fc Mon Sep 17 00:00:00 2001
2+
From: qianlongxu <qianlongxu@gmail.com>
3+
Date: Tue, 28 May 2024 16:55:19 +0800
4+
Subject: [PATCH] skip check bdj and provide reading current stream file
5+
functions
6+
7+
---
8+
src/libbluray/bluray.c | 21 +++++++++++++++++++++
9+
src/libbluray/bluray.h | 3 +++
10+
2 files changed, 24 insertions(+)
11+
12+
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
13+
index b3b55f7..e9ff566 100644
14+
--- a/src/libbluray/bluray.c
15+
+++ b/src/libbluray/bluray.c
16+
@@ -612,6 +612,24 @@ static void _close_m2ts(BD_STREAM *st)
17+
m2ts_filter_close(&st->m2ts_filter);
18+
}
19+
20+
+int64_t bd_file_read(BLURAY *bd, unsigned char *buf, int size)
21+
+{
22+
+ BD_STREAM *st = &bd->st0;
23+
+ return file_read(st->fp, buf, size);
24+
+}
25+
+
26+
+int64_t bd_file_seek(BLURAY *bd, int64_t pos, int whence)
27+
+{
28+
+ BD_STREAM *st = &bd->st0;
29+
+ return file_seek(st->fp, pos, whence);
30+
+}
31+
+
32+
+int64_t bd_file_size(BLURAY *bd)
33+
+{
34+
+ BD_STREAM *st = &bd->st0;
35+
+ return file_size(st->fp);
36+
+}
37+
+
38+
static int _open_m2ts(BLURAY *bd, BD_STREAM *st)
39+
{
40+
_close_m2ts(st);
41+
@@ -955,6 +973,9 @@ static int _run_gc(BLURAY *bd, gc_ctrl_e msg, uint32_t param)
42+
43+
static void _check_bdj(BLURAY *bd)
44+
{
45+
+ BD_DEBUG(DBG_BLURAY, "skip check bdj!\n");
46+
+ return;
47+
+
48+
if (!bd->disc_info.bdj_handled) {
49+
if (!bd->disc || bd->disc_info.bdj_detected) {
50+
51+
diff --git a/src/libbluray/bluray.h b/src/libbluray/bluray.h
52+
index 41cd4f6..756520e 100644
53+
--- a/src/libbluray/bluray.h
54+
+++ b/src/libbluray/bluray.h
55+
@@ -1210,6 +1210,9 @@ struct bd_dir_s *bd_open_dir(BLURAY *bd, const char *dir);
56+
*/
57+
struct bd_file_s *bd_open_file_dec(BLURAY *bd, const char *path);
58+
59+
+int64_t bd_file_read(BLURAY *bd, unsigned char *buf, int size);
60+
+int64_t bd_file_seek(BLURAY *bd, int64_t pos, int whence);
61+
+int64_t bd_file_size(BLURAY *bd);
62+
63+
#ifdef __cplusplus
64+
}
65+
--
66+
2.39.3 (Apple Git-146)
67+

patches/ffmpeg-release-5.1/0001-15-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 8d2dac9be4b04467c7d6bf4b4d3785adb8482a3f 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/17] h264_ps null pointer fault tolerant
4+
Subject: [PATCH 01/16] 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 7b857db7e5c334b873ca7a113b47a35e5b1106e0 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/17] flv support hevc
4+
Subject: [PATCH 02/16] flv support hevc
55

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

patches/ffmpeg-release-5.1/0003-correct-file-seekable-value-range-0-means-streamed-c.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 2b7025ea0b9f72c365f7ce79ba462496e07e9a3d Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Wed, 22 May 2024 14:24:29 +0800
4-
Subject: [PATCH 03/17] correct file seekable value range, 0 means streamed can't
4+
Subject: [PATCH 03/16] correct file seekable value range, 0 means streamed can't
55
seek, 1 means not streamed can seek.
66

77
---

patches/ffmpeg-release-5.1/0004-restore-ijk-custom-protocols-except-long.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 3c3b8cd1efb6e28fccd4b964531c21bf0fc94c26 Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Tue, 23 Jan 2024 15:32:33 +0800
4-
Subject: [PATCH 04/17] restore ijk custom protocols except long url
4+
Subject: [PATCH 04/16] restore ijk custom protocols except long url
55

66
---
77
libavcodec/Makefile | 1 +

patches/ffmpeg-release-5.1/0005-hls-support-discontinuity-tag.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From dc595d866ab9a0a67331b10dc969b434ab5e4e6b Mon Sep 17 00:00:00 2001
22
From: qianlongxu <qianlongxu@gmail.com>
33
Date: Wed, 22 May 2024 14:55:43 +0800
4-
Subject: [PATCH 05/17] hls support discontinuity tag
4+
Subject: [PATCH 05/16] hls support discontinuity tag
55

66
---
77
libavformat/hls.c | 59 +++++++++++++++++++++++++++++++++++++++++------

0 commit comments

Comments
 (0)