From 27af5db5e08034ac8432bfa263edec29afe471cc Mon Sep 17 00:00:00 2001 From: Yura Yaroshevich Date: Tue, 10 Apr 2018 19:43:20 +0300 Subject: [PATCH] Log video toolbox error codes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log OSStatus returned by VideoToolbox to simplify debugging. Bug: webrtc:9134 Change-Id: Ib9e4f208a823d4be58324dd1f9dde833cba8afbe Reviewed-on: https://webrtc-review.googlesource.com/69080 Reviewed-by: Kári Helgason Commit-Queue: Kári Helgason Cr-Commit-Position: refs/heads/master@{#22823} --- .../Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm | 1 + .../Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm index 8460228a76..859bf033ac 100644 --- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm +++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm @@ -242,6 +242,7 @@ void decompressionOutputCallback(void *decoderRef, nullptr, _videoFormat, nullptr, attributes, &record, &_decompressionSession); CFRelease(attributes); if (status != noErr) { + RTC_LOG(LS_ERROR) << "Failed to create decompression session: " << status; [self destroyDecompressionSession]; return WEBRTC_VIDEO_CODEC_ERROR; } diff --git a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm index 792dad5ef2..39620d2012 100644 --- a/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm +++ b/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm @@ -678,7 +678,7 @@ CFStringRef ExtractProfile(webrtc::SdpVideoFormat videoFormat) { CFRelease(dataRateLimits); } if (status != noErr) { - RTC_LOG(LS_ERROR) << "Failed to set data rate limit"; + RTC_LOG(LS_ERROR) << "Failed to set data rate limit with code: " << status; } _encoderBitrateBps = bitrateBps; @@ -695,7 +695,7 @@ CFStringRef ExtractProfile(webrtc::SdpVideoFormat videoFormat) { timestamp:(uint32_t)timestamp rotation:(RTCVideoRotation)rotation { if (status != noErr) { - RTC_LOG(LS_ERROR) << "H264 encode failed."; + RTC_LOG(LS_ERROR) << "H264 encode failed with code: " << status; return; } if (infoFlags & kVTEncodeInfo_FrameDropped) {