예제 #1
0
        public void TryTranslateTimeValidTest()
        {
            TestRuntime.AssertNotVSTS();
            TestRuntime.AssertSystemVersion(ApplePlatform.MacOSX, 12, 0);
            var outTime = new CVTimeStamp {
                Version = 0,
                Flags   = (1L << 0) | (1L << 1),               // kCVTimeStampVideoTimeValid | kCVTimeStampHostTimeValid
            };

            using var displayLink = new CVDisplayLink();
            // it has to be running else you will get a crash
            if (displayLink.Start() == 0)
            {
                displayLink.GetCurrentTime(out var timeStamp);
                Assert.True(displayLink.TryTranslateTime(timeStamp, ref outTime));
                displayLink.Stop();
            }
        }