スクリーンショットavplayer 29日に第37回の月

1。

- (ボイド)displayLinkCallback:(CADisplayLink * )差出人{ 
    CMTIME時間 = [snapshotOutput itemTimeForHostTime:CACurrentMediaTime()]。
    もし([snapshotOutput hasNewPixelBufferForItemTime:時間]){ 
        lastSnapshotPixelBuffer = [snapshotOutput copyPixelBufferForItemTime:時間itemTimeForDisplay:NULL]。
    } 
}

 - (UIImage * )snapshotImage {
     場合(lastSnapshotPixelBuffer){ 
        CIImage * ciImage = [CIImage imageWithCVPixelBuffer:lastSnapshotPixelBuffer]。
        CIContext *コンテキスト= [CIContext contextWithOptions:NULL]。 
        CGRect RECT = CGRectMake(00 
                                 CVPixelBufferGetWidth(lastSnapshotPixelBuffer)、
                                 CVPixelBufferGetHeight(lastSnapshotPixelBuffer))。
        CGImageRef cgImage = [コンテキストcreateCGImage:ciImage fromRect:RECT]。
        戻る[UIImage imageWithCGImage:cgImage]; 
    } 
    戻りNULL。
}

 

http://darktechlabs.com/2016/07/15/iOS-%E5%B0%8F%E5%9D%91%E8%AE%B0%E5%BD%95%EF%BC%9A%E5%A6 %82%E4%のBDの%95%E7%のBB%の99-AVPlayer-%E6%88%AA%はE5%9B%/ BE

おすすめ

転載: www.cnblogs.com/javastart/p/11758849.html