| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 rtc::CritScope lock(&crit_); | 155 rtc::CritScope lock(&crit_); |
| 156 return number_of_reconfigurations_; | 156 return number_of_reconfigurations_; |
| 157 } | 157 } |
| 158 | 158 |
| 159 int last_min_transmit_bitrate() { | 159 int last_min_transmit_bitrate() { |
| 160 rtc::CritScope lock(&crit_); | 160 rtc::CritScope lock(&crit_); |
| 161 return min_transmit_bitrate_bps_; | 161 return min_transmit_bitrate_bps_; |
| 162 } | 162 } |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 Result OnEncodedImage( | 165 int32_t Encoded(const EncodedImage& encoded_image, |
| 166 const EncodedImage& encoded_image, | 166 const CodecSpecificInfo* codec_specific_info, |
| 167 const CodecSpecificInfo* codec_specific_info, | 167 const RTPFragmentationHeader* fragmentation) override { |
| 168 const RTPFragmentationHeader* fragmentation) override { | |
| 169 rtc::CritScope lock(&crit_); | 168 rtc::CritScope lock(&crit_); |
| 170 EXPECT_TRUE(expect_frames_); | 169 EXPECT_TRUE(expect_frames_); |
| 171 timestamp_ = encoded_image._timeStamp; | 170 timestamp_ = encoded_image._timeStamp; |
| 172 encoded_frame_event_.Set(); | 171 encoded_frame_event_.Set(); |
| 173 return Result(Result::OK, timestamp_); | 172 return 0; |
| 174 } | 173 } |
| 175 | 174 |
| 176 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams, | 175 void OnEncoderConfigurationChanged(std::vector<VideoStream> streams, |
| 177 int min_transmit_bitrate_bps) override { | 176 int min_transmit_bitrate_bps) override { |
| 178 rtc::CriticalSection crit_; | 177 rtc::CriticalSection crit_; |
| 179 ++number_of_reconfigurations_; | 178 ++number_of_reconfigurations_; |
| 180 min_transmit_bitrate_bps_ = min_transmit_bitrate_bps; | 179 min_transmit_bitrate_bps_ = min_transmit_bitrate_bps; |
| 181 } | 180 } |
| 182 | 181 |
| 183 rtc::CriticalSection crit_; | 182 rtc::CriticalSection crit_; |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr)); | 328 video_source_.IncomingCapturedFrame(CreateFrame(2, nullptr)); |
| 330 sink_.WaitForEncodedFrame(2); | 329 sink_.WaitForEncodedFrame(2); |
| 331 EXPECT_EQ(codec_width_, fake_encoder_.codec_config().width); | 330 EXPECT_EQ(codec_width_, fake_encoder_.codec_config().width); |
| 332 EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height); | 331 EXPECT_EQ(codec_height_, fake_encoder_.codec_config().height); |
| 333 EXPECT_EQ(3, sink_.number_of_reconfigurations()); | 332 EXPECT_EQ(3, sink_.number_of_reconfigurations()); |
| 334 | 333 |
| 335 vie_encoder_->Stop(); | 334 vie_encoder_->Stop(); |
| 336 } | 335 } |
| 337 | 336 |
| 338 } // namespace webrtc | 337 } // namespace webrtc |
| OLD | NEW |