Log reason for dropped frame in RTCCameraVideoCapturer.

Bug: None
Change-Id: Ie4a41382c9fbf38c102d3850877545881f6a3d21
Reviewed-on: https://webrtc-review.googlesource.com/c/116063
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26146}
This commit is contained in:
Kári Tristan Helgason 2019-01-07 14:12:04 +01:00 committed by Commit Bot
parent 77aedaee69
commit 73eb41fe9e

View File

@ -287,7 +287,14 @@ const int64_t kNanosecondsPerSecond = 1000000000;
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didDropSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection {
RTCLogError(@"Dropped sample buffer.");
#if TARGET_OS_IPHONE
CFStringRef droppedReason =
CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_DroppedFrameReason, nil);
#else
// DroppedFrameReason unavailable on macOS.
CFStringRef droppedReason = nil;
#endif
RTCLogError(@"Dropped sample buffer. Reason: %@", (__bridge NSString *)droppedReason);
}
#pragma mark - AVCaptureSession notifications