-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test: ./mpeg2dec Change-Id: If03196cf979d7f6638b99d5b13afba6df3367089
- Loading branch information
1 parent
c8de54c
commit 93504b7
Showing
10 changed files
with
269 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# LIBMPEG2 | ||
## Getting Started Document | ||
|
||
# LibMPEG2 build steps | ||
|
||
Supports: | ||
- aarch32/aarch64 on Linux. | ||
- aarch32/aarch64 on Android. | ||
- x86_32/x86_64 on Linux. | ||
- aarch64 on Mac. | ||
- x86_64 on Mac. | ||
|
||
## Native Builds | ||
Use the following commands for building on the target machine | ||
|
||
``` | ||
$ cd external/libmpeg2 | ||
$ mkdir build | ||
$ cd build | ||
$ cmake .. | ||
$ make | ||
``` | ||
|
||
## Cross-compiler based builds | ||
|
||
### Building for x86_32 on a x86_64 Linux machine | ||
``` | ||
$ cd external/libmpeg2 | ||
$ mkdir build | ||
$ cd build | ||
$ CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32" cmake .. | ||
$ make | ||
``` | ||
|
||
### Building for aarch32/aarch64 | ||
Update 'CMAKE_C_COMPILER', 'CMAKE_CXX_COMPILER', 'CMAKE_C_COMPILER_AR', and | ||
'CMAKE_CXX_COMPILER_AR' in CMAKE_TOOLCHAIN_FILE passed below | ||
|
||
``` | ||
$ cd external/libmpeg2 | ||
$ mkdir build | ||
$ cd build | ||
``` | ||
|
||
#### For aarch64 | ||
``` | ||
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake | ||
$ make | ||
``` | ||
|
||
#### For aarch32 | ||
``` | ||
$ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake | ||
$ make | ||
``` | ||
|
||
### Building for android | ||
NOTE: This assumes that you are building on a machine that has | ||
[Android NDK](https://developer.android.com/ndk/downloads). | ||
|
||
``` | ||
$ cd external/libmpeg2 | ||
$ mkdir build | ||
$ cd build | ||
``` | ||
|
||
#### Armv7 (32-bit) | ||
|
||
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android_toolchain.cmake\ | ||
-DMPEG2_ANDROID_NDK_PATH=/opt/android-ndk-r26d/\ | ||
-DANDROID_ABI=armeabi-v7a\ | ||
-DANDROID_PLATFORM=android-23 ../ | ||
make | ||
|
||
#### Armv8 (64-bit) | ||
|
||
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android_toolchain.cmake\ | ||
-DMPEG2_ANDROID_NDK_PATH=/opt/android-ndk-r26d/\ | ||
-DANDROID_ABI=arm64-v8a\ | ||
-DANDROID_PLATFORM=android-23 ../ | ||
make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(SYSTEM_NAME Linux) | ||
set(SYSTEM_PROCESSOR aarch32) | ||
|
||
# Modify these variables with paths to appropriate compilers that can produce | ||
# armv7 targets | ||
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) | ||
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
set(SYSTEM_NAME Linux) | ||
set(SYSTEM_PROCESSOR aarch64) | ||
|
||
# Modify these variables with paths to appropriate compilers that can produce | ||
# armv8 targets | ||
set(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) | ||
set(CMAKE_C_COMPILER_AR | ||
aarch64-linux-gnu-gcc-ar | ||
CACHE FILEPATH "Archiver") | ||
set(CMAKE_CXX_COMPILER_AR | ||
aarch64-linux-gnu-gcc-ar | ||
CACHE FILEPATH "Archiver") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
set(SYSTEM_NAME Android) | ||
set(CMAKE_SYSTEM_NAME Android) | ||
|
||
if(NOT ANDROID_PLATFORM) | ||
set(ANDROID_PLATFORM android-23) | ||
endif() | ||
|
||
# Choose target architecture with: | ||
# -DANDROID_ABI={armeabi-v7a, arm64-v8a, x86, x86_64} | ||
if(NOT ANDROID_ABI) | ||
set(ANDROID_ABI arm64-v8a) | ||
endif() | ||
|
||
if(ANDROID_ABI MATCHES "^armeabi") | ||
set(SYSTEM_PROCESSOR aarch32) | ||
else() | ||
set(SYSTEM_PROCESSOR aarch64) | ||
endif() | ||
|
||
# Toolchain files don't have access to cached variables: | ||
# https://gitlab.kitware.com/cmake/cmake/issues/16170. Set an intermediate | ||
# environment variable when loaded the first time. | ||
if(MPEG2_ANDROID_NDK_PATH) | ||
set(ENV{MPEG2_ANDROID_NDK_PATH} "${MPEG2_ANDROID_NDK_PATH}") | ||
else() | ||
set(MPEG2_ANDROID_NDK_PATH "$ENV{MPEG2_ANDROID_NDK_PATH}") | ||
endif() | ||
|
||
if(NOT MPEG2_ANDROID_NDK_PATH) | ||
message(FATAL_ERROR "MPEG2_ANDROID_NDK_PATH not set.") | ||
return() | ||
endif() | ||
|
||
include("${MPEG2_ANDROID_NDK_PATH}/build/cmake/android.toolchain.cmake") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.