Skip to content

Commit fccf6b3

Browse files
committed
Add support for ARM (untested)
1 parent cf90285 commit fccf6b3

File tree

6 files changed

+58
-35
lines changed

6 files changed

+58
-35
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "aom"]
55
path = aom
66
url = https://aomedia.googlesource.com/aom
7+
[submodule "gas-preprocessor"]
8+
path = gas
9+
url = https://github.com/FFmpeg/gas-preprocessor.git

BUILDING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Building
44
Prerequisites
55
-------
66
* Requires Xcode 6.1 and macOS 10.10 SDK or later.
7+
* Before building, update submodules with `git submodule update --init --recursive`.
78
* ffmpeg and its dependencies require "CMake" and the "yasm" assembler to build. You can obtain them
89
through [Homebrew](https://brew.sh) via `brew install cmake yasm`.
910

QLVideo.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
AB0527E31D2947BB009A809B /* libiconv.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7C714819F8A6970006104E /* libiconv.dylib */; };
2525
AB0527E41D2947CF009A809B /* libbz2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7C714019F8A5C50006104E /* libbz2.dylib */; };
2626
AB0527E51D2947D1009A809B /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = AB7C714619F8A6730006104E /* libz.dylib */; };
27-
AB0680CF1EDB924C00534129 /* QTKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB0680CD1EDB913400534129 /* QTKit.framework */; };
2827
AB2ACD9E1A696F72002411DF /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AB2ACD9D1A696F72002411DF /* AVFoundation.framework */; };
2928
AB66474F261ABBCB00D23514 /* libaom.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66474E261ABBB600D23514 /* libaom.a */; };
3029
AB66477D261B43B500D23514 /* libaom.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AB66474E261ABBB600D23514 /* libaom.a */; };
@@ -160,7 +159,6 @@
160159
AB00C5D21A682FB700D71399 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = "<group>"; };
161160
AB0527C81D2946F1009A809B /* bench.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = bench.m; sourceTree = "<group>"; };
162161
AB0527CE1D294732009A809B /* benchmark */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = benchmark; sourceTree = BUILT_PRODUCTS_DIR; };
163-
AB0680CD1EDB913400534129 /* QTKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QTKit.framework; path = System/Library/Frameworks/QTKit.framework; sourceTree = SDKROOT; };
164162
AB0B80BF1EED41F1008A22DC /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/schema.strings; sourceTree = "<group>"; };
165163
AB0B80C11EED4204008A22DC /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/schema.strings; sourceTree = "<group>"; };
166164
AB0B80C21EED4215008A22DC /* cs */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = cs; path = cs.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -274,7 +272,6 @@
274272
ABE23BD81D25914C004E9D26 /* AudioToolbox.framework in Frameworks */,
275273
ABE23BD31D258F6C004E9D26 /* VideoToolbox.framework in Frameworks */,
276274
ABE23BDB1D2591F8004E9D26 /* CoreMedia.framework in Frameworks */,
277-
AB0680CF1EDB924C00534129 /* QTKit.framework in Frameworks */,
278275
AB7C715019F9E2A50006104E /* libavfilter.a in Frameworks */,
279276
AB7C715119F9E2A80006104E /* libavformat.a in Frameworks */,
280277
AB7C715219F9E2AB0006104E /* libavcodec.a in Frameworks */,
@@ -415,7 +412,6 @@
415412
AB93B0F7196CA60500708B2E /* QuickLook.framework */,
416413
AB93B0F9196CA60500708B2E /* ApplicationServices.framework */,
417414
AB93B0FB196CA60500708B2E /* CoreServices.framework */,
418-
AB0680CD1EDB913400534129 /* QTKit.framework */,
419415
);
420416
name = Frameworks;
421417
sourceTree = "<group>";

buildaom

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,28 @@ if [ "${ACTION}" == "clean" ]; then
55
echo Remove "${OUTDIR}"
66
if [ -n "${OUTDIR}" ]; then
77
rm -rf "${OUTDIR}"
8+
for ARCH in $ARCHS; do
9+
rm -rf "${OUTDIR}/${ARCH}"
10+
done
811
fi
912
else
1013
# For cmake & yasm
1114
PATH=$PATH:/usr/local/bin
1215

13-
if [ ! -f "${SRCROOT}/${TARGET_NAME}/CMakeLists.txt" ]; then
14-
echo Clone to ${SRCROOT}/${TARGET_NAME}
15-
cd "${SRCROOT}"
16-
git submodule update --init
17-
fi
1816
echo Build in ${OUTDIR}
19-
mkdir -p "${OUTDIR}"
20-
cd "${OUTDIR}"
21-
if [ -f CMakeCache.txt ]; then
22-
echo Skipping cmake
23-
else
24-
cmake "${SRCROOT}/${TARGET_NAME}" -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCONFIG_AV1_ENCODER=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TOOLS=0 -DENABLE_SSE4_2=0 -DENABLE_AVX=0 -DENABLE_AVX2=0
25-
fi
26-
make -j`sysctl -n hw.physicalcpu` ${ACTION}
17+
BUILT=""
18+
for ARCH in $ARCHS; do
19+
mkdir -p "${OUTDIR}/${ARCH}"
20+
cd "${OUTDIR}/${ARCH}"
21+
if [ -f CMakeCache.txt ]; then
22+
echo Skipping cmake
23+
elif [ $ARCH == arm64 ]; then
24+
cmake "${SRCROOT}/${TARGET_NAME}" -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCONFIG_AV1_ENCODER=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TOOLS=0 -DAOM_TARGET_CPU=arm64 -DCONFIG_RUNTIME_CPU_DETECT=0
25+
else
26+
cmake "${SRCROOT}/${TARGET_NAME}" -DCMAKE_BUILD_TYPE=${CONFIGURATION} -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCONFIG_AV1_ENCODER=0 -DENABLE_DOCS=0 -DENABLE_EXAMPLES=0 -DENABLE_TOOLS=0 -DENABLE_SSE4_2=0 -DENABLE_AVX=0 -DENABLE_AVX2=0
27+
fi
28+
make -j`sysctl -n hw.physicalcpu` ${ACTION}
29+
BUILT="${BUILT} ${OUTDIR}/${ARCH}/libaom.a"
30+
done
31+
lipo -create $BUILT -output ${OUTDIR}/libaom.a
2732
fi

buildffmpeg

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,45 @@ if [ "${ACTION}" == "clean" ]; then
55
echo Remove "${OUTDIR}"
66
if [ -n "${OUTDIR}" ]; then
77
rm -rf "${OUTDIR}"
8+
for ARCH in $ARCHS; do
9+
rm -rf "${OUTDIR}/${ARCH}"
10+
done
811
fi
912
else
10-
# For yasm
11-
PATH=$PATH:/usr/local/bin
13+
# For yasm and gas
14+
PATH=$PATH:${SRCROOT}/gas:/usr/local/bin
1215

13-
if [ ! -x "${SRCROOT}/${TARGET_NAME}/configure" ]; then
14-
echo Clone to ${SRCROOT}/${TARGET_NAME}
15-
cd "${SRCROOT}"
16-
git submodule update --init
17-
fi
1816
echo Build in ${OUTDIR}
19-
mkdir -p "${OUTDIR}"
20-
cd "${OUTDIR}"
21-
if [ -f config.h ]; then
22-
echo Skipping configure
23-
else
24-
if [ "${CONFIGURATION}" == "Debug" ]; then
25-
FLAGS="--disable-optimizations"
17+
BUILT=""
18+
for ARCH in $ARCHS; do
19+
mkdir -p "${OUTDIR}/${ARCH}"
20+
cd "${OUTDIR}/${ARCH}"
21+
if [ -f config.h ]; then
22+
echo Skipping configure
2623
else
27-
FLAGS=
24+
if [ "${CONFIGURATION}" == "Debug" ]; then
25+
FLAGS="--disable-optimizations"
26+
else
27+
FLAGS=
28+
fi
29+
if [ $ARCH == arm64 ]; then
30+
FLAGS="$FLAGS --enable-cross-compile --enable-vfp --enable-neon"
31+
elif [ $ARCH == x86_64 ]; then
32+
FLAGS="$FLAGS --cpu=core2"
33+
fi
34+
"${SRCROOT}/${TARGET_NAME}/configure" --arch=${ARCH} --cc="clang -arch ${ARCH} -L${TARGET_BUILD_DIR}/aom" ${FLAGS} --extra-cflags=-I${SRCROOT}/aom --extra-ldexeflags=-liconv --disable-stripping --enable-gpl --enable-hardcoded-tables --disable-doc --disable-pthreads --disable-indevs --disable-outdevs --disable-network --disable-avdevice --disable-muxers --disable-encoders --disable-bsfs --disable-filters --disable-protocols --disable-autodetect --enable-appkit --enable-avfoundation --enable-bzlib --enable-coreimage --enable-iconv --enable-libaom --enable-zlib --enable-audiotoolbox --enable-videotoolbox --enable-muxer=image2 --enable-encoder=png --enable-protocol=file
2835
fi
29-
"${SRCROOT}/${TARGET_NAME}/configure" --cc=clang --arch=x86_64 --cpu=core2 --extra-cflags=-I${SRCROOT}/aom --extra-ldexeflags="-liconv -L${TARGET_BUILD_DIR}/aom" --disable-stripping --enable-gpl --enable-hardcoded-tables --disable-doc --disable-pthreads --disable-indevs --disable-outdevs --disable-network --disable-avdevice --disable-muxers --disable-encoders --disable-bsfs --disable-filters --disable-protocols --disable-autodetect --enable-appkit --enable-avfoundation --enable-bzlib --enable-coreimage --enable-iconv --enable-libaom --enable-zlib --enable-audiotoolbox --enable-videotoolbox --enable-muxer=image2 --enable-encoder=png --enable-protocol=file ${FLAGS}
30-
fi
31-
make -j`sysctl -n hw.physicalcpu` ${ACTION}
36+
make -j`sysctl -n hw.physicalcpu` ${ACTION}
37+
# Assumes there aren't any material client impacting differences in config between archs
38+
cp -p ${OUTDIR}/${ARCH}/config.h ${OUTDIR}/
39+
cp -p ${OUTDIR}/${ARCH}/libavutil/*.h ${OUTDIR}/libavutil/
40+
done
41+
for LIB in libavcodec libavfilter libavformat libavutil libpostproc libswresample libswscale; do
42+
BUILT=""
43+
for ARCH in $ARCHS; do
44+
BUILT="${BUILT} ${OUTDIR}/${ARCH}/${LIB}/${LIB}.a"
45+
done
46+
mkdir -p ${OUTDIR}/${LIB}
47+
lipo -create $BUILT -output "${OUTDIR}/${LIB}/${LIB}.a"
48+
done
3249
fi

gas

Submodule gas added at 4daa611

0 commit comments

Comments
 (0)