libyuv编译(各平台)【转】

简介: 转自:http://blog.csdn.net/wszawsz33/article/details/51669719 版权声明:本文为博主原创文章,未经博主允许不得转载。 目录(?)[-] Getting Started Pre-requisites Getting ...

转自: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 Git reprository: 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

gclient sync
git checkout -b mycl -t origin/master
git pull
<edit files>
git add -u
git commit -m "my change"
git cl lint
git cl try
git cl upload -r a-reviewer@chomium.org -s
<once approved..>
git cl land
【作者】 张昺华
【新浪微博】 张昺华--sky
【twitter】 @sky2030_
【facebook】 张昺华 zhangbinghua
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.
目录
相关文章
|
定位技术 Python
python获取高德地图天气webAPI接口的解决方案
python获取高德地图天气webAPI接口的解决方案
755 0
|
安全 测试技术 Windows
RAMOS(全内存操作系统)初识----仅供测试
RAMOS(全内存操作系统)初识----仅供测试
4193 0
RAMOS(全内存操作系统)初识----仅供测试
|
Linux Shell 网络安全
|
存储 监控 安全
【深入探究C++日志库写入策略】glog、log4cplus与spdlog的写入策略比较
【深入探究C++日志库写入策略】glog、log4cplus与spdlog的写入策略比较
1446 0
|
2月前
|
人工智能 缓存 自然语言处理
全新 Qoder 正式上线:阿里发布面向所有人,以 Coding 为核心的智能体工作台
阿里云全新Qoder上线!面向所有人的智能体工作台,支持自然语言驱动开发、原型制作与数据处理;内置Qwen3.8-Max等多模型,Auto智能调度;兼容编程/通用双模式,集成40+连接器、70+插件、2万+技能。阿里云Qoder官网:https://t.aliyun.com/U/CpdGPQ
821 0
|
3月前
|
人工智能 IDE 搜索推荐
阿里云Qoder CN(原灵码)AI智能编码助手,个人社区版免费、credits计费额度、AI模型支持及功能指南
阿里云Qoder CN(原通义灵码)是面向开发者的AI智能编码助手,支持VS Code、JetBrains等IDE插件及独立IDE,提供代码生成、智能问答、单元测试等能力。覆盖编程与办公场景,含QoderWork CN等子产品,个人版免费,企业版起售价99元/人/月。阿里云Qoder CN官网:https://t.aliyun.com/U/fEiOLV
2603 0
|
程序员 Linux Android开发
libYuv编译
安卓使用NDK编译libYuv库
1315 0
|
存储 网络协议 安全
HTTP 协议及会话跟踪机制详解
本文详解了 HTTP 协议的核心知识,包括其定义(超文本传输协议,基于 TCP,规定客户端与服务器通信规则)及与 HTTPS 的区别(安全性、端口、资源消耗)。 介绍了 GET 与 POST 请求的差异(参数限制、安全性、应用场景),以及 Restful 风格(通过 URL 定位资源,请求方式决定操作)。列举了常见 HTTP 状态码(如 200 成功、404 资源未找到),对比了转发与重定向的区别(服务器端一次请求 vs 客户端两次请求)。 还阐述了会话跟踪机制:Cookie 基于客户端存储,通过Set-Cookie和Cookie头实现,安全性较低;Session 基于服务端存储,依赖 C
890 1
|
Linux API 开发工具
[开源]基于ffmpeg和libvlc的视频剪辑、播放器
[开源]基于ffmpeg和libvlc的视频剪辑、播放器
586 0

热门文章

最新文章