我有一个视频AVCaptureDevice
(AVMediaTypeVideo
),我正在使用setExposureTargetBias:completionHandler
短暂减少曝光,然后再次恢复。 我需要知道captureOutput:didOutputSampleBuffer:fromConnection:
中的哪个缓冲区对应于曝光量减少的第一帧。AVCaptureDevice:比较采样缓冲时间戳
的文档说:
块接收该匹配所述第一缓冲器的所述设置已被应用到的时间戳。时间戳与设备时钟同步,因此必须在与通过AVCaptureVideoDataOutput实例传送的缓冲区时间戳进行比较之前转换为主时钟。
如何获得 “设备时钟”? 我在completionHandler
中做了以下工作,但主时钟似乎与主时钟一致。
CMClockRef masterClock = self.captureSession.masterClock;
CMClockRef deviceClock = CMClockGetHostTimeClock();
syncTimeConverted = CMSyncConvertTime(syncTime, deviceClock, masterClock);
我打算做中captureOutput:didOutputSampleBuffer:fromConnection:
下面来测试一个缓冲区是否是一个我想
CMTime bufferTime = CMSampleBufferGetPresentationTimeStamp(sampleBuffer);
bool isDroppedExposureFrame = CMTimeCompare(bufferTime, syncTimeConverted) == 0;
我在正确的轨道上?