| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 previous_width_(0), | 175 previous_width_(0), |
| 176 previous_height_(0), | 176 previous_height_(0), |
| 177 interval_next_frame_(0) { | 177 interval_next_frame_(0) { |
| 178 } | 178 } |
| 179 | 179 |
| 180 VideoAdapter::~VideoAdapter() { | 180 VideoAdapter::~VideoAdapter() { |
| 181 } | 181 } |
| 182 | 182 |
| 183 void VideoAdapter::SetInputFormat(const VideoFormat& format) { | 183 void VideoAdapter::SetInputFormat(const VideoFormat& format) { |
| 184 rtc::CritScope cs(&critical_section_); | 184 rtc::CritScope cs(&critical_section_); |
| 185 int64 old_input_interval = input_format_.interval; | 185 int64_t old_input_interval = input_format_.interval; |
| 186 input_format_ = format; | 186 input_format_ = format; |
| 187 output_format_.interval = | 187 output_format_.interval = |
| 188 std::max(output_format_.interval, input_format_.interval); | 188 std::max(output_format_.interval, input_format_.interval); |
| 189 if (old_input_interval != input_format_.interval) { | 189 if (old_input_interval != input_format_.interval) { |
| 190 LOG(LS_INFO) << "VAdapt input interval changed from " | 190 LOG(LS_INFO) << "VAdapt input interval changed from " |
| 191 << old_input_interval << " to " << input_format_.interval; | 191 << old_input_interval << " to " << input_format_.interval; |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 void CoordinatedVideoAdapter::SetInputFormat(const VideoFormat& format) { | 195 void CoordinatedVideoAdapter::SetInputFormat(const VideoFormat& format) { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 216 } | 216 } |
| 217 | 217 |
| 218 void CoordinatedVideoAdapter::set_cpu_smoothing(bool enable) { | 218 void CoordinatedVideoAdapter::set_cpu_smoothing(bool enable) { |
| 219 LOG(LS_INFO) << "CPU smoothing is now " | 219 LOG(LS_INFO) << "CPU smoothing is now " |
| 220 << (enable ? "enabled" : "disabled"); | 220 << (enable ? "enabled" : "disabled"); |
| 221 cpu_smoothing_ = enable; | 221 cpu_smoothing_ = enable; |
| 222 } | 222 } |
| 223 | 223 |
| 224 void VideoAdapter::SetOutputFormat(const VideoFormat& format) { | 224 void VideoAdapter::SetOutputFormat(const VideoFormat& format) { |
| 225 rtc::CritScope cs(&critical_section_); | 225 rtc::CritScope cs(&critical_section_); |
| 226 int64 old_output_interval = output_format_.interval; | 226 int64_t old_output_interval = output_format_.interval; |
| 227 output_format_ = format; | 227 output_format_ = format; |
| 228 output_num_pixels_ = output_format_.width * output_format_.height; | 228 output_num_pixels_ = output_format_.width * output_format_.height; |
| 229 output_format_.interval = | 229 output_format_.interval = |
| 230 std::max(output_format_.interval, input_format_.interval); | 230 std::max(output_format_.interval, input_format_.interval); |
| 231 if (old_output_interval != output_format_.interval) { | 231 if (old_output_interval != output_format_.interval) { |
| 232 LOG(LS_INFO) << "VAdapt output interval changed from " | 232 LOG(LS_INFO) << "VAdapt output interval changed from " |
| 233 << old_output_interval << " to " << output_format_.interval; | 233 << old_output_interval << " to " << output_format_.interval; |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 | 236 |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // When any adaptation occurs, historic CPU load levels are no longer | 710 // When any adaptation occurs, historic CPU load levels are no longer |
| 711 // accurate. Clear out our state so we can re-learn at the new normal. | 711 // accurate. Clear out our state so we can re-learn at the new normal. |
| 712 cpu_load_num_samples_ = 0; | 712 cpu_load_num_samples_ = 0; |
| 713 system_load_average_ = kCpuLoadInitialAverage; | 713 system_load_average_ = kCpuLoadInitialAverage; |
| 714 } | 714 } |
| 715 | 715 |
| 716 return changed; | 716 return changed; |
| 717 } | 717 } |
| 718 | 718 |
| 719 } // namespace cricket | 719 } // namespace cricket |
| OLD | NEW |