iOS直播原理及实现(转)@IT·互联网

GPUImage框架_文档翻译_02

2017-06-21  本文已影响307人  CC老师_HelloCoder

“咳咳.......”  CC 又上线了哦!今天花30分钟把剩下的文档介绍翻译一下!不喜勿喷!不过可以指出CC的错误之处哦!留言或者私信给我都可以哦~~~~ CC看到会及时更正的哦!

Adding the static library to your iOS project(添加静态库到iOS项目中)

Note: if you want to use this in a Swift project, you need to use the steps in the "Adding this as a framework" section instead of the following. Swift needs modules for third-party code.

(注意:如果你现在将CPUImage使用在Swift 项目,你需要使用“Adding this as a framework”这章的步骤。Swift需要使用第三方代码)

Once you have the latest source code for the framework, it's fairly straightforward to add it to your application. Start by dragging the GPUImage.xcodeproj file into your application's Xcode project to embed the framework in your project. Next, go to your application's target and add GPUImage as a Target Dependency. Finally, you'll want to drag the libGPUImage.a library from the GPUImage framework's Products folder to the Link Binary With Libraries build phase in your application's target.

一旦你有了框架的最新源代码,将其添加到应用程序中就相当简单了。首先拖动GPUImage.xcodeproj到你的应用程序的Xcode项目嵌入框架在你的项目中。接下来,去你的应用程序的目标和添加GPUImage作为Target的依赖。最后,你要把libGPUImage.a静态库。添加到从GPUImage框架的产品Link Binary With Libraries build phase在你的项目中。

GPUImage needs a few other frameworks to be linked into your application, so you'll need to add the following as linked libraries in your application target:

GPUImage需要一些其他的框架被连接到你的应用程序,所以您需要添加以下链接库应用程序中的目标

1.CoreMedia

2.CoreVideo

3.OpenGLES

4.AVFoundation

5.QuartzCore

You'll also need to find the framework headers, so within your project's build settings set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the GPUImage source directory. Make this header search path recursive.

你还需要找到框架的头文件,所以在项目GPUImage源目录应用程序的生成设置头文件搜索路径的framework/ subdirectory。使这个头文件搜索路径递归。

To use the GPUImage classes within your application, simply include the core framework header using the following:

在你的应用中使用GPUImage类,仅包括使用以下核心框架头文件:

#import "GPUImage.h"

As a note: if you run into the error "Unknown class GPUImageView in Interface Builder" or the like when trying to build an interface with Interface Builder, you may need to add -ObjC to your Other Linker Flags in your project's build settings.

作为一个提示:如果你遇到错误“Unknown class GPUImageView in Interface Builde(未知类GPUImageView在界面生成”或类似于试图用界面生成器生成界面,您可能需要add -ObjC to your Other Linker Flags在项目的生成设置中。

Also, if you need to deploy this to iOS 4.x, it appears that the current version of Xcode (4.3) requires that you weak-link the Core Video framework in your final application or you see crashes with the message "Symbol not found: _CVOpenGLESTextureCacheCreate" when you create an archive for upload to the App Store or for ad hoc distribution. To do this, go to your project's Build Phases tab, expand the Link Binary With Libraries group, and find CoreVideo.framework in the list. Change the setting for it in the far right of the list from Required to Optional.

另外,如果你需要部署到iOS 4.X系统,看来,Xcode的当前版本(4.3)要求你weak-link的Core Video框架,最终的应用程序或您看到崩溃日志“Symbol not found: _CVOpenGLESTextureCacheCreate:“当你创建上传到App Store或广告组织分布的档案。要做到这一点,去你的项目Build Phases tab,扩大the Link Binary With Libraries group,并在列表中找到CoreVideo.framework。在列表右侧的设置将必选修改为可选

Additionally, this is an ARC-enabled framework, so if you want to use this within a manual reference counted application targeting iOS 4.x, you'll need to add -fobjc-arc to your Other Linker Flags as well.

此外,这是一个ARC-enabled框架,所以如果你想用这个在手动引用计数的应用针对iOS 4。X,你需要add -fobjc-arc在你其他的链接标志中。

Building a static library at the command line(在命令行中构建静态库)

If you don't want to include the project as a dependency in your application's Xcode project, you can build a universal static library for the iOS Simulator or device. To do this, runbuild.shat the command line. The resulting library and header files will be located atbuild/Release-iphone. You may also change the version of the iOS SDK by changing theIOSSDK_VERvariable inbuild.sh(all available versions can be found usingxcodebuild -showsdks).

如果你不想引入的项目作为依赖在你的应用的Xcode项目中,您可以为iOS模拟器或设备建立一个通用的静态库。要做到这一点,在命令行runbuild.shat。生成的库和头文件将位于atbuild/Release-iphone中。你也可以通过改变build.sh的IOSSDK_VER变量改变iOS SDK版本(所有可用的版本可以找到并使用xcodebuild - showsdks)

今天的翻译时间结束哦!30分钟到了~~~So!我又要准备新课题去咯~~~😘😘

小伙伴们阅读后,请喜欢一下。文章更新可以提醒到你哦~~~~


我是CC                                                                                        QQ号:1776094879

喜欢手动点个喜欢吧

可以持续关注CC老师哦!留言你想学习的课题,我就会给你写一个专题哦!

当然,你也可以给日以继夜,明明可以靠脸却非得靠实力的CC老师打赏一个!!!给CC老师打赏个面膜钱吧!

关注CC,特立独行的女开发-> 讲师。把自己的热血、洒脱、文艺青年的心洒满课堂;不甘心当讲师,致力成为网红;写的了代码,耍的了“流氓”的 CC老师

上一篇下一篇

猜你喜欢

热点阅读