OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 | (str[4] == c) << 3 | 40 | (str[4] == c) << 3 |
41 | (str[5] == c) << 2 | 41 | (str[5] == c) << 2 |
42 | (str[6] == c) << 1 | 42 | (str[6] == c) << 1 |
43 | (str[7] == c) << 0; | 43 | (str[7] == c) << 0; |
44 } | 44 } |
45 | 45 |
46 // Class for matching bit patterns such as "x1xx0000" where 'x' is allowed to be | 46 // Class for matching bit patterns such as "x1xx0000" where 'x' is allowed to be |
47 // either 0 or 1. | 47 // either 0 or 1. |
48 class BitPattern { | 48 class BitPattern { |
49 public: | 49 public: |
50 constexpr BitPattern(const char (&str)[9]) | 50 explicit constexpr BitPattern(const char (&str)[9]) |
51 : mask_(~ByteMaskString('x', str)), | 51 : mask_(~ByteMaskString('x', str)), |
52 masked_value_(ByteMaskString('1', str)) {} | 52 masked_value_(ByteMaskString('1', str)) {} |
53 | 53 |
54 bool IsMatch(uint8_t value) const { return masked_value_ == (value & mask_); } | 54 bool IsMatch(uint8_t value) const { return masked_value_ == (value & mask_); } |
55 | 55 |
56 private: | 56 private: |
57 const uint8_t mask_; | 57 const uint8_t mask_; |
58 const uint8_t masked_value_; | 58 const uint8_t masked_value_; |
59 }; | 59 }; |
60 | 60 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 // than the level in the offer. | 295 // than the level in the offer. |
296 const Level answer_level = level_asymmetry_allowed ? local_level : min_level; | 296 const Level answer_level = level_asymmetry_allowed ? local_level : min_level; |
297 | 297 |
298 // Set the resulting profile-level-id in the answer parameters. | 298 // Set the resulting profile-level-id in the answer parameters. |
299 (*answer_params)[kProfileLevelId] = *ProfileLevelIdToString( | 299 (*answer_params)[kProfileLevelId] = *ProfileLevelIdToString( |
300 ProfileLevelId(local_profile_level_id->profile, answer_level)); | 300 ProfileLevelId(local_profile_level_id->profile, answer_level)); |
301 } | 301 } |
302 | 302 |
303 } // namespace H264 | 303 } // namespace H264 |
304 } // namespace webrtc | 304 } // namespace webrtc |
OLD | NEW |