blob: de1998a69388cb805941f776745e31dd6c7b184e [file] [log] [blame]
Anders Carlsson6bf43d22017-10-16 13:51:43 +02001/*
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#import "RTCVideoCodecInfo+HumanReadable.h"
12
13@implementation RTCVideoCodecInfo (HumanReadable)
14
15- (NSString *)humanReadableDescription {
16 if ([self.name isEqualToString:@"H264"]) {
17 NSString *profileId = self.parameters[@"profile-level-id"];
18 if ([profileId isEqualToString:@"640c1f"]) {
19 return @"H264 (High)";
20 } else if ([profileId isEqualToString:@"42e01f"]) {
21 return @"H264 (Baseline)";
22 } else {
23 return [NSString stringWithFormat:@"H264 (%@)", profileId];
24 }
25 } else {
26 return self.name;
27 }
28}
29
30@end