V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
meathill
V2EX  ›  Swift

请教一个 Swift 问题

  •  
  •   meathill ·
    meathill · 2020-11-10 11:08:12 +08:00 · 1738 次点击
    这是一个创建于 1234 天前的主题,其中的信息可能已经有所发展或是发生改变。

    大家早上好。

    我现在计划用 https://github.com/wulkano/Aperture 录制屏幕,需要比较准确的开始时间。我自己实验,它在我的电脑上( iMac 2019 )完成启动到录屏,需要 1.2s 的时间。不太好判断。

    我想请教大家,AVCaptureSession 有没有一个类似启动事件之类的东西,可以准确获得开始录屏的时间戳?我在 apple 的文档里没找到。

    有劳各位。

    1 条回复    2020-11-10 11:10:47 +08:00
    FaXiaoKe
        1
    FaXiaoKe  
       2020-11-10 11:10:47 +08:00
    监听 Session 状态
    可以使用通知监听相机当前状态,如开始,停止,意外中断等等...
    - (void)captureOutput:(AVCaptureOutput *)output didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5858 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 02:24 · PVG 10:24 · LAX 19:24 · JFK 22:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.