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