A CMTime
struct 表示存储为有理数的时间长度(请参阅CM时间参考 https://developer.apple.com/library/mac/#documentation/CoreMedia/Reference/CMTime/Reference/reference.html). CMTime
has a value
and a timescale
字段,代表时间value/timescale seconds
.
CMTimeMake
是一个返回 a 的函数CMTime
结构,例如:
CMTime t1 = CMTimeMake(1, 10); // 1/10 second = 0.1 second
CMTime t2 = CMTimeMake(2, 1); // 2 seconds
CMTime t3 = CMTimeMake(3, 4); // 3/4 second = 0.75 second
CMTime t4 = CMTimeMake(6, 8); // 6/8 second = 0.75 second
最后两个时间值t3
and t4
代表相同的时间值,因此
CMTimeCompare(t3, t4) == 0
如果您设置videoMinFrameDuration
of a AVCaptureSession
如果你设置的话没有什么区别
connection.videoMinFrameDuration = CMTimeMake(1, 20); // or
connection.videoMinFrameDuration = CMTimeMake(2, 40);
在这两种情况下,帧之间的最小时间间隔均设置为 1/20 = 0.05 秒。