| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) | 334 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) |
| 335 : io_message_loop_(io_message_loop), | 335 : io_message_loop_(io_message_loop), |
| 336 renderer_task_runner_(base::MessageLoopProxy::current()), | 336 renderer_task_runner_(base::MessageLoopProxy::current()), |
| 337 frame_counter_(0), | 337 frame_counter_(0), |
| 338 source_frame_rate_(0.0f) { | 338 source_frame_rate_(0.0f) { |
| 339 DCHECK(io_message_loop_.get()); | 339 DCHECK(io_message_loop_.get()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 VideoTrackAdapter::~VideoTrackAdapter() { | 342 VideoTrackAdapter::~VideoTrackAdapter() { |
| 343 DCHECK(adapters_.empty()); | 343 DCHECK(adapters_.empty()); |
| 344 UMA_HISTOGRAM_BOOLEAN("Media.VideoTrackAdapter.FramesReceived", | |
| 345 frame_counter_ > 0); | |
| 346 } | 344 } |
| 347 | 345 |
| 348 void VideoTrackAdapter::AddTrack( | 346 void VideoTrackAdapter::AddTrack( |
| 349 const MediaStreamVideoTrack* track, | 347 const MediaStreamVideoTrack* track, |
| 350 VideoCaptureDeliverFrameCB frame_callback, | 348 VideoCaptureDeliverFrameCB frame_callback, |
| 351 int max_width, | 349 int max_width, |
| 352 int max_height, | 350 int max_height, |
| 353 double min_aspect_ratio, | 351 double min_aspect_ratio, |
| 354 double max_aspect_ratio, | 352 double max_aspect_ratio, |
| 355 double max_frame_rate, | 353 double max_frame_rate, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 // Rearm the monitoring while there are active Tracks, i.e. as long as the | 459 // Rearm the monitoring while there are active Tracks, i.e. as long as the |
| 462 // owner MediaStreamSource is active. | 460 // owner MediaStreamSource is active. |
| 463 io_message_loop_->PostDelayedTask(FROM_HERE, | 461 io_message_loop_->PostDelayedTask(FROM_HERE, |
| 464 base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, | 462 base::Bind(&VideoTrackAdapter::CheckFramesReceivedOnIO, this, |
| 465 set_muted_state_callback, frame_counter_), | 463 set_muted_state_callback, frame_counter_), |
| 466 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / | 464 base::TimeDelta::FromSecondsD(kNormalFrameTimeoutInFrameIntervals / |
| 467 source_frame_rate_)); | 465 source_frame_rate_)); |
| 468 } | 466 } |
| 469 | 467 |
| 470 } // namespace content | 468 } // namespace content |
| OLD | NEW |