fix ffmpeg compilation issue and reduce ffmpeg size by compiling just h264/aac like android

This commit is contained in:
Mathieu Virbel 2015-08-14 02:31:44 +02:00
parent 1554b958a0
commit 7bab19f837
2 changed files with 52 additions and 2 deletions

View file

@ -1,5 +1,5 @@
from toolchain import Recipe, shprint
from os.path import join
from os.path import join, exists
import sh
@ -26,6 +26,42 @@ class FFMpegRecipe(Recipe):
"--disable-doc",
"--enable-pic",
"--enable-avresample")
options = (
"--disable-everything",
"--enable-parser=h264,aac",
"--enable-decoder=h263,h264,aac",
"--enable-filter=aresample,resample,crop",
"--enable-protocol=file,http,https,tls_openssl",
"--enable-demuxer=sdp",
"--enable-pic",
"--enable-small",
"--enable-hwaccels",
"--enable-static",
"--disable-shared",
# libpostproc is GPL: https://ffmpeg.org/pipermail/ffmpeg-user/2012-February/005162.html
"--enable-gpl",
# enable openssl if needed
# if [ "X$BUILD_openssl" != "X" ]; then
# FLAGS="--enable-openssl --enable-nonfree"
# FLAGS="--enable-protocol=https,tls_openssl"
# fi
# disable some unused algo
# note: "golomb" are the one used in our video test, so don't use --disable-golomb
# note: and for aac decoding: "rdft", "mdct", and "fft" are needed
"--disable-dxva2",
"--disable-vdpau",
"--disable-vaapi",
"--disable-dct",
# disable binaries / doc
"--enable-cross-compile",
"--disable-debug",
"--disable-programs",
"--disable-doc",
"--enable-pic",
"--enable-avresample")
build_env = arch.get_env()
build_env["VERBOSE"] = "1"
configure = sh.Command(join(self.build_dir, "configure"))
@ -39,6 +75,21 @@ class FFMpegRecipe(Recipe):
"--extra-ldflags={}".format(build_env["LDFLAGS"]),
*options,
_env=build_env)
"""
shprint(sh.sed,
"-i.bak",
"s/HAVE_CLOSESOCKET=yes//g",
"config.mak")
shprint(sh.sed,
"-i.bak",
"s/#define HAVE_CLOSESOCKET 1//g",
"config.h")
if exists("config.asm"):
shprint(sh.sed,
"-i.bak",
"s/%define HAVE_CLOSESOCKET 1//g",
"config.asm")
"""
shprint(sh.make, "clean", _env=build_env)
shprint(sh.make, "-j4", _env=build_env)
shprint(sh.make, "install")

View file

@ -1134,7 +1134,6 @@ Xcode:
parser.add_argument("filename", help="Path to your project or xcodeproj")
args = parser.parse_args(sys.argv[2:])
filename = args.filename
if not filename.endswith(".xcodeproj"):
# try to find the xcodeproj