From 69b03e960ed6ebfda624c4ad9ef7159d8083ea62 Mon Sep 17 00:00:00 2001 From: Piasy Xu Date: Tue, 28 Aug 2018 00:44:51 +0800 Subject: [PATCH] Fix iOS demo H264 profile display. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: none Change-Id: I5e770f0b6b90822f4ab00432f0cbebc510d46a48 Reviewed-on: https://webrtc-review.googlesource.com/96360 Reviewed-by: Anders Carlsson Reviewed-by: Kári Helgason Commit-Queue: Kári Helgason Cr-Commit-Position: refs/heads/master@{#24462} --- .../AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m b/examples/objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m index de1998a693..6c18cf3ebb 100644 --- a/examples/objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m +++ b/examples/objc/AppRTCMobile/ios/RTCVideoCodecInfo+HumanReadable.m @@ -9,15 +9,20 @@ */ #import "RTCVideoCodecInfo+HumanReadable.h" +#import "WebRTC/RTCVideoCodecH264.h" @implementation RTCVideoCodecInfo (HumanReadable) - (NSString *)humanReadableDescription { if ([self.name isEqualToString:@"H264"]) { NSString *profileId = self.parameters[@"profile-level-id"]; - if ([profileId isEqualToString:@"640c1f"]) { + RTCH264ProfileLevelId *profileLevelId = + [[RTCH264ProfileLevelId alloc] initWithHexString:profileId]; + if (profileLevelId.profile == RTCH264ProfileConstrainedHigh || + profileLevelId.profile == RTCH264ProfileHigh) { return @"H264 (High)"; - } else if ([profileId isEqualToString:@"42e01f"]) { + } else if (profileLevelId.profile == RTCH264ProfileConstrainedBaseline || + profileLevelId.profile == RTCH264ProfileBaseline) { return @"H264 (Baseline)"; } else { return [NSString stringWithFormat:@"H264 (%@)", profileId];