| 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 <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 (*it)->RemoveCallback(track); | 472 (*it)->RemoveCallback(track); |
| 473 if ((*it)->IsEmpty()) { | 473 if ((*it)->IsEmpty()) { |
| 474 adapters_.erase(it); | 474 adapters_.erase(it); |
| 475 break; | 475 break; |
| 476 } | 476 } |
| 477 } | 477 } |
| 478 } | 478 } |
| 479 | 479 |
| 480 void VideoTrackAdapter::DeliverFrameOnIO( | 480 void VideoTrackAdapter::DeliverFrameOnIO( |
| 481 const scoped_refptr<media::VideoFrame>& frame, | 481 const scoped_refptr<media::VideoFrame>& frame, |
| 482 const base::TimeTicks& estimated_capture_time) { | 482 base::TimeTicks estimated_capture_time) { |
| 483 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 483 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 484 TRACE_EVENT0("video", "VideoTrackAdapter::DeliverFrameOnIO"); | 484 TRACE_EVENT0("video", "VideoTrackAdapter::DeliverFrameOnIO"); |
| 485 ++frame_counter_; | 485 ++frame_counter_; |
| 486 for (const auto& adapter : adapters_) | 486 for (const auto& adapter : adapters_) |
| 487 adapter->DeliverFrame(frame, estimated_capture_time); | 487 adapter->DeliverFrame(frame, estimated_capture_time); |
| 488 } | 488 } |
| 489 | 489 |
| 490 void VideoTrackAdapter::CheckFramesReceivedOnIO( | 490 void VideoTrackAdapter::CheckFramesReceivedOnIO( |
| 491 const OnMutedCallback& set_muted_state_callback, | 491 const OnMutedCallback& set_muted_state_callback, |
| 492 uint64 old_frame_counter_snapshot) { | 492 uint64 old_frame_counter_snapshot) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 505 } | 505 } |
| 506 | 506 |
| 507 io_task_runner_->PostDelayedTask( | 507 io_task_runner_->PostDelayedTask( |
| 508 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, | 508 FROM_HERE, base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, |
| 509 set_muted_state_callback, frame_counter_), | 509 set_muted_state_callback, frame_counter_), |
| 510 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / | 510 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / |
| 511 source_frame_rate_)); | 511 source_frame_rate_)); |
| 512 } | 512 } |
| 513 | 513 |
| 514 } // namespace content | 514 } // namespace content |
| OLD | NEW |