| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 17 matching lines...) Expand all Loading... |
| 28 namespace webrtc { | 28 namespace webrtc { |
| 29 | 29 |
| 30 ViEEncoder::ViEEncoder(uint32_t number_of_cores, | 30 ViEEncoder::ViEEncoder(uint32_t number_of_cores, |
| 31 ProcessThread* module_process_thread, | 31 ProcessThread* module_process_thread, |
| 32 SendStatisticsProxy* stats_proxy, | 32 SendStatisticsProxy* stats_proxy, |
| 33 OveruseFrameDetector* overuse_detector, | 33 OveruseFrameDetector* overuse_detector, |
| 34 EncodedImageCallback* sink) | 34 EncodedImageCallback* sink) |
| 35 : number_of_cores_(number_of_cores), | 35 : number_of_cores_(number_of_cores), |
| 36 sink_(sink), | 36 sink_(sink), |
| 37 vp_(VideoProcessing::Create()), | 37 vp_(VideoProcessing::Create()), |
| 38 video_sender_(Clock::GetRealTimeClock(), this, this, this), | 38 video_sender_(Clock::GetRealTimeClock(), this, this), |
| 39 stats_proxy_(stats_proxy), | 39 stats_proxy_(stats_proxy), |
| 40 overuse_detector_(overuse_detector), | 40 overuse_detector_(overuse_detector), |
| 41 time_of_last_frame_activity_ms_(std::numeric_limits<int64_t>::max()), | 41 time_of_last_frame_activity_ms_(std::numeric_limits<int64_t>::max()), |
| 42 encoder_config_(), | 42 encoder_config_(), |
| 43 last_observed_bitrate_bps_(0), | 43 last_observed_bitrate_bps_(0), |
| 44 encoder_paused_and_dropped_frame_(false), | 44 encoder_paused_and_dropped_frame_(false), |
| 45 module_process_thread_(module_process_thread), | 45 module_process_thread_(module_process_thread), |
| 46 has_received_sli_(false), | 46 has_received_sli_(false), |
| 47 picture_id_sli_(0), | 47 picture_id_sli_(0), |
| 48 has_received_rpsi_(false), | 48 has_received_rpsi_(false), |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 void ViEEncoder::SendKeyFrame() { | 187 void ViEEncoder::SendKeyFrame() { |
| 188 video_sender_.IntraFrameRequest(0); | 188 video_sender_.IntraFrameRequest(0); |
| 189 } | 189 } |
| 190 | 190 |
| 191 int64_t ViEEncoder::time_of_last_frame_activity_ms() { | 191 int64_t ViEEncoder::time_of_last_frame_activity_ms() { |
| 192 rtc::CritScope lock(&data_cs_); | 192 rtc::CritScope lock(&data_cs_); |
| 193 return time_of_last_frame_activity_ms_; | 193 return time_of_last_frame_activity_ms_; |
| 194 } | 194 } |
| 195 | 195 |
| 196 void ViEEncoder::OnSetRates(uint32_t bitrate_bps, int framerate) { | |
| 197 if (stats_proxy_) | |
| 198 stats_proxy_->OnSetRates(bitrate_bps, framerate); | |
| 199 } | |
| 200 | |
| 201 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, | 196 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, |
| 202 const CodecSpecificInfo* codec_specific_info, | 197 const CodecSpecificInfo* codec_specific_info, |
| 203 const RTPFragmentationHeader* fragmentation) { | 198 const RTPFragmentationHeader* fragmentation) { |
| 204 { | 199 { |
| 205 rtc::CritScope lock(&data_cs_); | 200 rtc::CritScope lock(&data_cs_); |
| 206 time_of_last_frame_activity_ms_ = rtc::TimeMillis(); | 201 time_of_last_frame_activity_ms_ = rtc::TimeMillis(); |
| 207 } | 202 } |
| 208 if (stats_proxy_) { | 203 if (stats_proxy_) { |
| 209 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info); | 204 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info); |
| 210 } | 205 } |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 264 } |
| 270 | 265 |
| 271 if (stats_proxy_ && video_suspension_changed) { | 266 if (stats_proxy_ && video_suspension_changed) { |
| 272 LOG(LS_INFO) << "Video suspend state changed to: " | 267 LOG(LS_INFO) << "Video suspend state changed to: " |
| 273 << (video_is_suspended ? "suspended" : "not suspended"); | 268 << (video_is_suspended ? "suspended" : "not suspended"); |
| 274 stats_proxy_->OnSuspendChange(video_is_suspended); | 269 stats_proxy_->OnSuspendChange(video_is_suspended); |
| 275 } | 270 } |
| 276 } | 271 } |
| 277 | 272 |
| 278 } // namespace webrtc | 273 } // namespace webrtc |
| OLD | NEW |