libyuv编译(各平台)【转】

简介:

转自:http://blog.csdn.net/wszawsz33/article/details/51669719

最近用到视频格式转码,发现谷歌的开源库 libyuv 很好用,所以记录下编译过程

直接贴 官网的编译流程

https://chromium.googlesource.com/libyuv/libyuv/+/master/docs/getting_started.md

不过我得吐槽一下,我特么就想编译个libyuv 你特么非要让我把chrome项目check 下来是几个意思。。。。如果没猜错 应该是好几个g

Getting Started

How to get and build the libyuv code.

Pre-requisites

You'll need to have depot tools installed: https://www.chromium.org/developers/how-tos/install-depot-tools Refer to chromium instructions for each platform for other prerequisites.

说明:依赖工具,谷歌的这套东西还是比较好用的,首先要安装depottools 这点不多说,命令行就行,最重要的是在下载完成之后要有

export PATH=`pwd`/depot_tools:"$PATH" 命令使能这个工具

Getting the Code

Create a working directory, enter it, and run:

说明:设置与同步代码,里面自带脚本,关于代码如何同步的就无需关心了。

 


Then you'll get a .gclient file like:

solutions = [
  { "name"        : "libyuv",
    "url"         : "https://chromium.googlesource.com/libyuv/libyuv",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_deps" : {
    },
    "safesync_url": "",
  },
];

For iOS add ios']; to your OSX .gclient and run  Browse the Gitreprository: https://chromium.googlesource.com/libyuv/libyuv/+/master

Android

For Android add android']; to your Linux .gclient

solutions = [
  { "name"        : "libyuv",
    "url"         : "https://chromium.googlesource.com/libyuv/libyuv",
    "deps_file"   : "DEPS",
    "managed"     : True,
    "custom_deps" : {
    },
    "safesync_url": "",
  },
];
target_os = ["android", "unix"];

Then run:

Caveat: Theres an error with Google Play services updates. If you get 
the error “Your version of the Google Play services library is not up to
 date”, run the following: cd chromium/src 
./build/android/play_services/update.py download cd ../..

 

For Windows the gclient sync must be done from an Administrator command prompt.

The sync will generate native build files for your environment using gyp (Windows: Visual Studio, OSX: XCode, linux: make). This generation can also be forced manually:  To get just the source (not buildable): git clone https://chromium.googlesource.com/libyuv/libyuv

Building the Library and Unittests

Windows


Building
 with clangcl

OSX

Clang 64 bit shown. Remove clang=1 for GCC and change x64 to ia32 for 32 bit.


iOS

http://www.chromium.org/developers/how-tos/build-instructions-ios

Add to .gclient last line: target_os=['ios'];

armv7

arm64

 

both armv7 and arm64 (fat)

 

simulator

 


Android

https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

Add to .gclient last line: target_os=['android'];

armv7

arm64

 

ia32

 

mipsel

 

arm32 disassembly:

 

arm64 disassembly:

 

Running tests:

 

Running test as benchmark:

 

Running test with C code:

 


Building
 with GN

Building
 Offical with GN

Linux

CentOS

On CentOS 32 bit the following work around allows a sync:


Windows
 Shared Library

Modify libyuv.gyp from ‘static_library’ to ‘shared_library’, and add ‘LIBYUV_BUILDING_SHARED_LIBRARY’ to ‘defines’.

After this command follow the building the library instructions above.

 

If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows

Build targets


Building
 the Library with make

Linux


Building
 the Library with cmake

Install cmake: http://www.cmake.org/

Default debug build:

Release build/install

 


Windows
 8 Phone

Pre-requisite:

  • Install Visual Studio 2012 and Arm to your environment.

Then:

or with Visual Studio 2013:

 


Windows
 Shared Library

Modify libyuv.gyp from ‘static_library’ to ‘shared_library’, and add ‘LIBYUV_BUILDING_SHARED_LIBRARY’ to ‘defines’. Then run this.

After this command follow the building the library instructions above.

 

If you get a compile error for atlthunk.lib on Windows, read http://www.chromium.org/developers/how-tos/build-instructions-windows

64 bit Windows


ARM
 Linux
export GYP_DEFINES="target_arch=arm"
export CROSSTOOL=`<path>`/arm-none-linux-gnueabi
export CXX=$CROSSTOOL-g++
export CC=$CROSSTOOL-gcc
export AR=$CROSSTOOL-ar
export AS=$CROSSTOOL-as
export RANLIB=$CROSSTOOL-ranlib
gclient runhooks

Running Unittests

Windows


OSX

Linux
Replace --gtest_filter=“*” with specific unittest to run. May include wildcards. e.g.

 


CPU
 Emulator tools

Intel SDE (Software Development Emulator)

Pre-requisite: Install IntelSDE for Windows: http://software.intel.com/en-us/articles/intel-software-development-emulator

Then run:


Memory
 tools

Running Dr Memory memcheck for Windows

Pre-requisite: Install Dr Memory for Windows and add it to your path: http://www.drmemory.org/docs/page_install_windows.html


Running
 UBSan

See Chromium instructions for sanitizers: https://www.chromium.org/developers/testing/undefinedbehaviorsanitizer

Sanitizers available: TSan, MSan, ASan, UBSan, LSan


Running
 Valgrind memcheck

Memory errors and race conditions can be found by running tests under special memory tools. [Valgrind] 1 is an instrumentation framework for building dynamic analysis tools. Various tests and profilers are built upon it to find memory handling errors and memory leaks, for instance.

Then run:

 

For more information, see http://www.chromium.org/developers/how-tos/using-valgrind

 

Running Thread Sanitizer (TSan)

For more info, see http://www.chromium.org/developers/how-tos/using-valgrind/threadsanitizer

 

Running Address Sanitizer (ASan)

For more info, see http://dev.chromium.org/developers/testing/addresssanitizer

 

Benchmarking

The unittests can be used to benchmark.

Windows


Linux
 and Mac
Indicates 0.547 ms/frame for 1280 x 720.

 

Making a change

 

git cl land









本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sky-heaven/p/7090793.html,如需转载请自行联系原作者





相关文章
|
1月前
|
缓存 监控 Java
即时编译(JIT):从源代码到高效执行的神奇之旅(上)
即时编译(JIT):从源代码到高效执行的神奇之旅(上)
|
1月前
|
缓存 监控 编译器
即时编译(JIT):从源代码到高效执行的神奇之旅(下)
即时编译(JIT):从源代码到高效执行的神奇之旅(下)
|
5月前
|
JavaScript 前端开发 Cloud Native
云his源码 多院区集团化的全院HIS系统源代码
系统利用云计算平台的技术优势,建立统一的云HIS、云病历、云LIS,有效实现实现协同门诊、住院、药房药库管理、双向转诊转检、远程会诊诊断及医疗数据共享与交换,解决数据重复采集及信息孤岛等问题,为实现区域协同医疗卫生信息化平台奠定了基础。 系统技术特点:采用前后端分离架构,前端由Angular语言、JavaScript开发;后端使用Java语言开发,适用于二级医院、基层医疗机构,可作为区域HIS使用,经扩展后能够应用于医联体/医共体。 云病历:完全满足和符合国家电子病历评级标准。三级质控,病历留痕,续打,批注
|
Java Linux 开发工具
RK3399平台开发系列讲解(系统编译篇)8.6、安卓开发环境的搭建及编译
RK3399平台开发系列讲解(系统编译篇)8.6、安卓开发环境的搭建及编译
140 0
|
XML Android开发 数据格式
|
存储 安全 编译器
基础C程序的开发和编译
基础C程序的开发和编译
基础C程序的开发和编译
|
JavaScript C++
WASM发展状况更新,以及LLVM-wasm编译环境搭建过程
之前介绍了[WASM在生产环境中的部署方案](https://www.atatech.org/articles/109271),编译的过程留了个坑,由于后来LLVM和Emscripten都有了很多更新,这里讲一下最新的发展状况,以及手把手环境搭建指南。 ## 标准发展 多数proposal仍然在开发中...... 这篇文章有详细介绍 [《WebAssembly’s post-MVP f
2451 0
|
Linux 开发工具 Android开发
libyuv编译(各平台)【转】
转自:http://blog.csdn.net/wszawsz33/article/details/51669719 版权声明:本文为博主原创文章,未经博主允许不得转载。 目录(?)[-] Getting Started Pre-requisites Getting ...
2677 0