翻译:AVPlayerItemOutput
来源:互联网 发布:linux make 退出 编辑:程序博客网 时间:2024/06/10 15:46
@class AVPlayerItemOutput
@abstract
AVPlayerItemOutput是一个封装了它的子类的通用API的抽象类。
@discussion
1.AVPlayerItemOutput实例允许你获得一个在AVPlayer播放过程中的AVAsset的一个独立的采样值。为了在当多个AVPlayerItemOutput应用在单一source时能优雅降档(graceful degradation),所有AVPlayerItemOutput子类只提供当前sample或者容易取得的future samples。所有在current sample之前的samples将被AVPlayerItemOutput自动丢弃。
2.你可以通过AVPlayerItem的下面两个方法来管理让一个AVPlayerItem作为source input与AVPlayerItemOutput之间的联系:(太长了好难捋顺语句…)
• addOutput:
• removeOutput:
3.当一个AVPlayerItemOutput与一个AVPlayerItem产生关联,在多个使能了的tracks中,samples会根据AVPlayer遵守的混合,合并或丢弃的规则来提供当做他们自己的渲染目的。(不会译直接上原文吧,samples are provided for a media type in accordance with the rules for mixing, composition, or exclusion that the AVPlayer honors among multiple enabled tracks of that media type for its own rendering purposes)。例如,video media会根据AVPlayerItem.videoComposition提供的指令来合并。
@class AVPlayerItemVideoOutput
@abstract
一个AVPlayerItemOutput的子类,把video images用CVPixelBuffers来“出售”?(vends)。
@discussion
最好是用一个AVPlayerItemVideoOutput连接一个CVDisplayLink or CADisplayLink的services,来确保与屏幕硬件刷新的同步。为了优化效率,这里可以有机会让services“静默”下来。例如当playback暂停或者在playback of empty edits的过程中。下面这个采样代码展示了在你使用AVPlayerItemVideoOutput时如何“静默”CVDisplayLink。
(void)CVDisplayLinkCreateWithActiveCGDisplays( &myDisplayLink ); CVDisplayLinkSetOutputCallback( myDisplayLink, myDisplayCallback, self ); [myPlayerItem addOutput:myVideoOutput]; [myVideoOutput setDelegate:self queue:myDispatchQueue]; ... static CVReturn myDisplayCallback ( CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, void *displayLinkContext ) { MYObject *self = displayLinkContext; CMTime outputItemTime = [[self myVideoOutput] itemTimeForCVTimeStamp:*inOutputTime]; if ( [[self myVideoOutput] hasNewPixelBufferForItemTime:outputItemTime] ) { CVPixelBufferRef pixBuff = NULL; CMTime presentationItemTime = kCMTimeZero; self->myLastHostTime = inOutputTime->hostTime; pixBuff = [[self myVideoOutput] copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:&presentationItemTime]; // Use pixBuff here // presentationItemTime is the item time appropriate for // the next screen refresh CVBufferRelease( pixBuff ); } else { CMTime elapsedTime = CMClockMakeHostTimeFromSystemUnits( inNow->hostTime - self->myLastHostTime ); if ( CMTimeGetSeconds( elapsedTime ) > NON_QUIESCENT_PERIOD_IN_SECONDS ) { [[self myVideoOutput] requestNotificationOfMediaDataChangeWithAdvanceInterval:MY_STARTUP_TIME_IN_SECONDS]; CVDisplayLinkStop( displayLink ); } } return kCVReturnSuccess; } - (void)outputMediaDataWillChange:(AVPlayerItemOutput *)output { // Start running again myLastHostTime = CVGetCurrentHostTime(); CVDisplayLinkStart( myDisplayLink ); }
- 翻译:AVPlayerItemOutput
- 翻译:AVPlayerItemOutput二
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- 翻译
- Scala 之 List 合并 以及去重小细节
- 平滑升级Nginx到新版本v1.12.1修复Nginx最新漏洞CVE-2017-7529
- linux的一些最基本命令
- Android studio安装使用教程(详细图文教程)
- ReactNative爬坑-小记<Image/>控件通过json数据加载App里drawable中图片资源
- 翻译:AVPlayerItemOutput
- 理解mysql_锁的概念
- Java中关于内存泄漏出现的原因以及如何避免内存泄漏
- Codeforces Round #392 (Div. 2) 758B Blown Garland
- 使用MultipartEntity对文字、图片、视频进行综合上传
- Python学习笔记——闭包
- 数据结构==二叉树(数组实现)
- ny-32-组合数
- GDB List no symbol table is loaded