From 9f486a889e8fbe684c3fdfdc529286b2cf6fa170 Mon Sep 17 00:00:00 2001 From: Anton Holmberg Date: Thu, 12 Oct 2017 13:45:14 -0700 Subject: [PATCH] Rename audioRecordOffset to audioToVideoRecordStartOffset to make the name clearer --- Source/PBJVision.h | 2 +- Source/PBJVision.m | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/PBJVision.h b/Source/PBJVision.h index 7b47b4e..8fc21ee 100644 --- a/Source/PBJVision.h +++ b/Source/PBJVision.h @@ -238,7 +238,7 @@ static CGFloat const PBJVideoBitRate1280x750 = 5000000 * 8; // 40bmps @property (nonatomic, readonly) NSMutableArray *luminanceValues; @property (nonatomic, readonly) Float64 averageISO; -@property (nonatomic) CMTime audioRecordOffset; +@property (nonatomic) CMTime audioToVideoRecordStartOffset; - (void)setAudioStartTimestamp:(CMTime)audioStartTimestamp; - (void)setAudioStopTimestamp:(CMTime)audioStopTimestamp; diff --git a/Source/PBJVision.m b/Source/PBJVision.m index e342c31..20e0212 100644 --- a/Source/PBJVision.m +++ b/Source/PBJVision.m @@ -171,7 +171,7 @@ @interface PBJVision () < CMTime _lastAudioTimestamp; - CMTime _audioRecordOffset; + CMTime _audioToVideoRecordStartOffset; CMTime _lastVideoDisplayTimestamp; CMTime _minDisplayDuration; @@ -261,7 +261,7 @@ @implementation PBJVision @synthesize maximumCaptureDuration = _maximumCaptureDuration; @synthesize detectLowLight = _detectLowLight; @synthesize luminanceValues = _luminanceValues; -@synthesize audioRecordOffset = _audioRecordOffset; +@synthesize audioToVideoRecordStartOffset = _audioToVideoRecordStartOffset; + (NSString*)hardwareString { @@ -679,8 +679,8 @@ - (AVCaptureDeviceFormat *)formatForDevice:(AVCaptureDevice*)device withDim:(NSI - (void)setAudioStartTimestamp:(CMTime)audioStartTimestamp { [self _enqueueBlockOnCaptureVideoQueue:^{ - _audioRecordOffset = CMTimeSubtract(_startTimestamp, audioStartTimestamp); - DLog(@"_audioRecordOffset: %f", CMTimeGetSeconds(_audioRecordOffset)); + _audioToVideoRecordStartOffset = CMTimeSubtract(_startTimestamp, audioStartTimestamp); + DLog(@"_audioToVideoRecordStartOffset: %f", CMTimeGetSeconds(_audioToVideoRecordStartOffset)); if (CMTIME_IS_INVALID(_lastTimestamp)) { _lastTimestamp = audioStartTimestamp; @@ -1939,7 +1939,7 @@ - (void)startVideoCapture _lastTimestamp = kCMTimeInvalid; //_lastTimestamp = _startTimestamp; _lastAudioTimestamp = kCMTimeInvalid; - _audioRecordOffset = kCMTimeInvalid; + _audioToVideoRecordStartOffset = kCMTimeInvalid; _totalPauseTime = kCMTimeZero; _lastPauseTimestamp = kCMTimeInvalid; @@ -1994,7 +1994,7 @@ - (void)resumeVideoCapture DLog(@"resuming video capture"); - //_audioRecordOffset = kCMTimeInvalid; + //_audioToVideoRecordStartOffset = kCMTimeInvalid; _flags.paused = NO; _flags.interrupted = NO; @@ -2210,8 +2210,8 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM CMTime currentTimestamp = CMSampleBufferGetPresentationTimeStamp(sampleBuffer); - if (_flags.recording && CMTIME_IS_INVALID(_audioRecordOffset)) { - // this will grab the info need to compute _audioRecordOffset + if (_flags.recording && CMTIME_IS_INVALID(_audioToVideoRecordStartOffset)) { + // this will grab the info need to compute _audioToVideoRecordStartOffset if ([_delegate respondsToSelector:@selector(visionWillStartWritingVideo:fileURL:)]) { [_delegate visionWillStartWritingVideo:self fileURL:_mediaWriter.outputURL]; }