OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2017 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 14 matching lines...) Expand all Loading... | |
25 return min_frame_size + (s + 1) * i % (max_frame_size - min_frame_size); | 25 return min_frame_size + (s + 1) * i % (max_frame_size - min_frame_size); |
26 } | 26 } |
27 | 27 |
28 class FakeEncodedImageCallback : public EncodedImageCallback { | 28 class FakeEncodedImageCallback : public EncodedImageCallback { |
29 public: | 29 public: |
30 FakeEncodedImageCallback() : last_frame_was_timing_(false) {} | 30 FakeEncodedImageCallback() : last_frame_was_timing_(false) {} |
31 Result OnEncodedImage(const EncodedImage& encoded_image, | 31 Result OnEncodedImage(const EncodedImage& encoded_image, |
32 const CodecSpecificInfo* codec_specific_info, | 32 const CodecSpecificInfo* codec_specific_info, |
33 const RTPFragmentationHeader* fragmentation) override { | 33 const RTPFragmentationHeader* fragmentation) override { |
34 last_frame_was_timing_ = encoded_image.timing_.is_timing_frame; | 34 last_frame_was_timing_ = encoded_image.timing_.is_timing_frame; |
35 return Result::OK; | 35 return Result(Result::OK); |
mflodman
2017/08/08 15:21:21
Needed after making the 'Result' ctor explicit.
| |
36 }; | 36 }; |
37 | 37 |
38 bool WasTimingFrame() { return last_frame_was_timing_; } | 38 bool WasTimingFrame() { return last_frame_was_timing_; } |
39 | 39 |
40 private: | 40 private: |
41 bool last_frame_was_timing_; | 41 bool last_frame_was_timing_; |
42 }; | 42 }; |
43 | 43 |
44 enum class FrameType { | 44 enum class FrameType { |
45 kNormal, | 45 kNormal, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 kAverageSize[s] * kDefaultOutlierFrameSizePercent / 100) { | 159 kAverageSize[s] * kDefaultOutlierFrameSizePercent / 100) { |
160 // Too big frame. May be dropped or timing, but not normal. | 160 // Too big frame. May be dropped or timing, but not normal. |
161 EXPECT_NE(frames[s][i], FrameType::kNormal); | 161 EXPECT_NE(frames[s][i], FrameType::kNormal); |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 } // namespace test | 167 } // namespace test |
168 } // namespace webrtc | 168 } // namespace webrtc |
OLD | NEW |