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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 rtc::CritScope lock(&crit_); | 201 rtc::CritScope lock(&crit_); |
202 return number_of_reconfigurations_; | 202 return number_of_reconfigurations_; |
203 } | 203 } |
204 | 204 |
205 int last_min_transmit_bitrate() { | 205 int last_min_transmit_bitrate() { |
206 rtc::CritScope lock(&crit_); | 206 rtc::CritScope lock(&crit_); |
207 return min_transmit_bitrate_bps_; | 207 return min_transmit_bitrate_bps_; |
208 } | 208 } |
209 | 209 |
210 private: | 210 private: |
211 int32_t Encoded(const EncodedImage& encoded_image, | 211 Result OnEncodedImage( |
212 const CodecSpecificInfo* codec_specific_info, | 212 const EncodedImage& encoded_image, |
213 const RTPFragmentationHeader* fragmentation) override { | 213 const CodecSpecificInfo* codec_specific_info, |
| 214 const RTPFragmentationHeader* fragmentation) override { |
214 rtc::CritScope lock(&crit_); | 215 rtc::CritScope lock(&crit_); |
215 EXPECT_TRUE(expect_frames_); | 216 EXPECT_TRUE(expect_frames_); |
216 timestamp_ = encoded_image._timeStamp; | 217 timestamp_ = encoded_image._timeStamp; |
217 encoded_frame_event_.Set(); | 218 encoded_frame_event_.Set(); |
218 return 0; | 219 return Result(Result::OK, timestamp_); |
219 } | 220 } |
220 | 221 |
221 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams, | 222 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams, |
222 int min_transmit_bitrate_bps) override { | 223 int min_transmit_bitrate_bps) override { |
223 rtc::CriticalSection crit_; | 224 rtc::CriticalSection crit_; |
224 ++number_of_reconfigurations_; | 225 ++number_of_reconfigurations_; |
225 min_transmit_bitrate_bps_ = min_transmit_bitrate_bps; | 226 min_transmit_bitrate_bps_ = min_transmit_bitrate_bps; |
226 } | 227 } |
227 | 228 |
228 rtc::CriticalSection crit_; | 229 rtc::CriticalSection crit_; |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
619 vie_encoder_->Stop(); | 620 vie_encoder_->Stop(); |
620 | 621 |
621 stats_proxy_.reset(); | 622 stats_proxy_.reset(); |
622 EXPECT_EQ(1, | 623 EXPECT_EQ(1, |
623 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); | 624 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); |
624 EXPECT_EQ( | 625 EXPECT_EQ( |
625 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); | 626 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); |
626 } | 627 } |
627 | 628 |
628 } // namespace webrtc | 629 } // namespace webrtc |
OLD | NEW |