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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 | 147 |
148 template <typename... T> | 148 template <typename... T> |
149 int InsertFrame(uint16_t picture_id, | 149 int InsertFrame(uint16_t picture_id, |
150 uint8_t spatial_layer, | 150 uint8_t spatial_layer, |
151 int64_t ts_ms, | 151 int64_t ts_ms, |
152 bool inter_layer_predicted, | 152 bool inter_layer_predicted, |
153 T... refs) { | 153 T... refs) { |
154 static_assert(sizeof...(refs) <= kMaxReferences, | 154 static_assert(sizeof...(refs) <= kMaxReferences, |
155 "To many references specified for FrameObject."); | 155 "To many references specified for FrameObject."); |
156 std::array<uint16_t, sizeof...(refs)> references = {{refs...}}; | 156 std::array<uint16_t, sizeof...(refs)> references = { |
| 157 {rtc::checked_cast<uint16_t>(refs)...}}; |
157 | 158 |
158 std::unique_ptr<FrameObjectFake> frame(new FrameObjectFake()); | 159 std::unique_ptr<FrameObjectFake> frame(new FrameObjectFake()); |
159 frame->picture_id = picture_id; | 160 frame->picture_id = picture_id; |
160 frame->spatial_layer = spatial_layer; | 161 frame->spatial_layer = spatial_layer; |
161 frame->timestamp = ts_ms * 90; | 162 frame->timestamp = ts_ms * 90; |
162 frame->num_references = references.size(); | 163 frame->num_references = references.size(); |
163 frame->inter_layer_predicted = inter_layer_predicted; | 164 frame->inter_layer_predicted = inter_layer_predicted; |
164 for (size_t r = 0; r < references.size(); ++r) | 165 for (size_t r = 0; r < references.size(); ++r) |
165 frame->references[r] = references[r]; | 166 frame->references[r] = references[r]; |
166 | 167 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 ExtractFrame(0, true); | 550 ExtractFrame(0, true); |
550 ExtractFrame(); | 551 ExtractFrame(); |
551 | 552 |
552 CheckFrame(0, 1, 0); | 553 CheckFrame(0, 1, 0); |
553 CheckFrame(1, 3, 0); | 554 CheckFrame(1, 3, 0); |
554 CheckNoFrame(2); | 555 CheckNoFrame(2); |
555 } | 556 } |
556 | 557 |
557 } // namespace video_coding | 558 } // namespace video_coding |
558 } // namespace webrtc | 559 } // namespace webrtc |
OLD | NEW |