| 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 13 matching lines...) Expand all Loading... |
| 24 const int& i) { | 24 const int& i) { |
| 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_ = |
| 35 encoded_image.timing_.flags != TimingFrameFlags::kInvalid; |
| 35 return Result::OK; | 36 return Result::OK; |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 bool WasTimingFrame() { return last_frame_was_timing_; } | 39 bool WasTimingFrame() { return last_frame_was_timing_; } |
| 39 | 40 |
| 40 private: | 41 private: |
| 41 bool last_frame_was_timing_; | 42 bool last_frame_was_timing_; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 enum class FrameType { | 45 enum class FrameType { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 kAverageSize[s] * kDefaultOutlierFrameSizePercent / 100) { | 160 kAverageSize[s] * kDefaultOutlierFrameSizePercent / 100) { |
| 160 // Too big frame. May be dropped or timing, but not normal. | 161 // Too big frame. May be dropped or timing, but not normal. |
| 161 EXPECT_NE(frames[s][i], FrameType::kNormal); | 162 EXPECT_NE(frames[s][i], FrameType::kNormal); |
| 162 } | 163 } |
| 163 } | 164 } |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 | 167 |
| 167 } // namespace test | 168 } // namespace test |
| 168 } // namespace webrtc | 169 } // namespace webrtc |
| OLD | NEW |