Skip to content

Commit

Permalink
Optimised build for armv8 and new 4.9.4 linaro.
Browse files Browse the repository at this point in the history
  • Loading branch information
carlonluca committed Mar 19, 2017
1 parent 953398f commit b72010a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
6 changes: 3 additions & 3 deletions piomxtextures_src/piomxtextures_src.pri
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

QT += core core-private gui gui-private opengl quick quick-private multimedia

DEFINES += POT_VERSION=\\\"5.5.0\\\"
DEFINES += POT_VERSION=\\\"5.6.0\\\"

SRC=$$PWD
SRC_WRAPPER=$$SRC/omx_wrapper
Expand All @@ -37,7 +37,7 @@ INCLUDEPATH += \
$$PWD/../3rdparty/LightLogger
INCLUDEPATH += \
$$PWD/../3rdparty/LightLogger \
$$PWD/../3rdparty/LightSmartPtr
$$PWD/../3rdparty/LightSmartPtr

linux-rasp-pi-g++ {
message("Building for RPi1...");
Expand All @@ -51,7 +51,7 @@ linux-rasp-pi2-g++ {

linux-rpi3-g++|linux-rasp-pi3-g++ {
message("Building for RPi3...");
FFMPEG_BUILD_DIR = ffmpeg_pi2
FFMPEG_BUILD_DIR = ffmpeg_pi3
}

LIBS += -lopenmaxil -lGLESv2 -lEGL -lbcm_host -lvchostif -lvcos -lrt -lv4l2
Expand Down
28 changes: 21 additions & 7 deletions piomxtextures_tools/compile_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,27 @@ if [ $# -ne 1 ]; then
exit
fi

export PATH="$COMPILER_PATH":$PATH
export PKG_CONFIG_PATH="$RPI_SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig"

pkg-config smbclient --cflags --libs
pkg-config libssh --cflags --libs

# Set CFLAGS.
if [ "$1" == "pi1" ]; then
FFMPEG_ARCH=arm
ECFLAGS="-mfpu=vfp -mfloat-abi=hard -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog"
elif [ "$1" == "pi2" ]; then
FFMPEG_ARCH=armv7-a
ECFLAGS="-march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard \
-funsafe-math-optimizations -lm -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog"
elif [ "$1" == "pi3" ]; then
FFMPEG_ARCH=armv8-a
#SMBCLIENT=`pkg-config smbclient --cflags --libs`
SSH="-Wl,-rpath,$RPI_SYSROOT/usr/lib/arm-linux-gnueabihf -Wl,-rpath,$RPI_SYSROOT/lib/arm-linux-gnueabihf"
ECFLAGS="-march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard \
-funsafe-math-optimizations -lm -mno-apcs-stack-check -mstructure-size-boundary=32 -mno-sched-prolog $SSH"
ELDFLAGS="$SSH"
else
echo "Please choose either pi1 or pi2."
exit 1
Expand Down Expand Up @@ -61,12 +76,9 @@ fi

cd 3rdparty/ffmpeg
rm -rf ffmpeg_src
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg_src -b n3.2.1 --depth=1
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg_src -b n3.2.4 --depth=1
cd ffmpeg_src;

export PATH="$COMPILER_PATH":$PATH
export PKG_CONFIG_PATH="$RPI_SYSROOT/usr/lib/arm-linux-gnueabihf/pkgconfig"

echo "Configuring..."
echo "Prefix to $PWD..."
if [ "$1" == "pi1" ]; then
Expand All @@ -76,7 +88,7 @@ if [ "$1" == "pi1" ]; then
--enable-cross-compile \
--enable-shared \
--enable-static \
--arch=arm \
--arch=$FFMPEG_ARCH \
--cpu=arm1176jzf-s \
--target-os=linux \
--disable-hwaccels \
Expand Down Expand Up @@ -297,11 +309,13 @@ if [ "$1" == "pi1" ]; then
else
./configure \
--sysroot=$RPI_SYSROOT \
--enable-rpath \
--extra-ldflags="$ELDFLAGS" \
--extra-cflags="$ECFLAGS" \
--enable-cross-compile \
--enable-shared \
--enable-static \
--arch=armv7-a \
--arch=$FFMPEG_ARCH \
--target-os=linux \
--disable-hwaccels \
--enable-parsers \
Expand All @@ -316,7 +330,7 @@ else
--enable-gpl \
--enable-version3 \
--enable-protocols \
--enable-libsmbclient \
--disable-libsmbclient \
--enable-libssh \
--enable-nonfree \
--enable-openssl \
Expand Down

0 comments on commit b72010a

Please sign in to comment.