| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/media/video_track_adapter.h" | 5 #include "content/renderer/media/video_track_adapter.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 keep_frame_counter_ += max_frame_rate_ / frame_rate_; | 317 keep_frame_counter_ += max_frame_rate_ / frame_rate_; |
| 318 if (keep_frame_counter_ >= 1) { | 318 if (keep_frame_counter_ >= 1) { |
| 319 keep_frame_counter_ -= 1; | 319 keep_frame_counter_ -= 1; |
| 320 // Keep the frame. | 320 // Keep the frame. |
| 321 return false; | 321 return false; |
| 322 } | 322 } |
| 323 DVLOG(3) << "Drop frame. Input frame_rate_ " << frame_rate_ << "."; | 323 DVLOG(3) << "Drop frame. Input frame_rate_ " << frame_rate_ << "."; |
| 324 return true; | 324 return true; |
| 325 } | 325 } |
| 326 | 326 |
| 327 VideoTrackAdapterSettings::VideoTrackAdapterSettings() |
| 328 : VideoTrackAdapterSettings(std::numeric_limits<int>::max(), |
| 329 std::numeric_limits<int>::max(), |
| 330 0.0, |
| 331 std::numeric_limits<double>::max(), |
| 332 0.0) {} |
| 333 |
| 327 VideoTrackAdapterSettings::VideoTrackAdapterSettings(int max_width, | 334 VideoTrackAdapterSettings::VideoTrackAdapterSettings(int max_width, |
| 328 int max_height, | 335 int max_height, |
| 329 double min_aspect_ratio, | 336 double min_aspect_ratio, |
| 330 double max_aspect_ratio, | 337 double max_aspect_ratio, |
| 331 double max_frame_rate) | 338 double max_frame_rate) |
| 332 : max_width(max_width), | 339 : max_width(max_width), |
| 333 max_height(max_height), | 340 max_height(max_height), |
| 334 min_aspect_ratio(min_aspect_ratio), | 341 min_aspect_ratio(min_aspect_ratio), |
| 335 max_aspect_ratio(max_aspect_ratio), | 342 max_aspect_ratio(max_aspect_ratio), |
| 336 max_frame_rate(max_frame_rate) { | 343 max_frame_rate(max_frame_rate) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 } | 526 } |
| 520 | 527 |
| 521 io_task_runner_->PostDelayedTask( | 528 io_task_runner_->PostDelayedTask( |
| 522 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, | 529 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, |
| 523 set_muted_state_callback, frame_counter_), | 530 set_muted_state_callback, frame_counter_), |
| 524 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / | 531 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / |
| 525 source_frame_rate_)); | 532 source_frame_rate_)); |
| 526 } | 533 } |
| 527 | 534 |
| 528 } // namespace content | 535 } // namespace content |
| OLD | NEW |