OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/renderer_host/media/video_capture_controller.h" | 5 #include "content/browser/renderer_host/media/video_capture_controller.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (!has_received_frames_) { | 443 if (!has_received_frames_) { |
444 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.Width", | 444 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.Width", |
445 frame_info->coded_size.width()); | 445 frame_info->coded_size.width()); |
446 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.Height", | 446 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.Height", |
447 frame_info->coded_size.height()); | 447 frame_info->coded_size.height()); |
448 UMA_HISTOGRAM_ASPECT_RATIO("Media.VideoCapture.AspectRatio", | 448 UMA_HISTOGRAM_ASPECT_RATIO("Media.VideoCapture.AspectRatio", |
449 frame_info->coded_size.width(), | 449 frame_info->coded_size.width(), |
450 frame_info->coded_size.height()); | 450 frame_info->coded_size.height()); |
451 double frame_rate = 0.0f; | 451 double frame_rate = 0.0f; |
452 media::VideoFrameMetadata metadata; | 452 media::VideoFrameMetadata metadata; |
453 metadata.MergeInternalValuesFrom(*frame_info->metadata); | 453 metadata.MergeInternalValuesFrom(frame_info->metadata); |
454 if (!metadata.GetDouble(VideoFrameMetadata::FRAME_RATE, &frame_rate)) { | 454 if (!metadata.GetDouble(VideoFrameMetadata::FRAME_RATE, &frame_rate)) { |
455 frame_rate = video_capture_format_.frame_rate; | 455 frame_rate = video_capture_format_.frame_rate; |
456 } | 456 } |
457 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.FrameRate", frame_rate); | 457 UMA_HISTOGRAM_COUNTS("Media.VideoCapture.FrameRate", frame_rate); |
458 has_received_frames_ = true; | 458 has_received_frames_ = true; |
459 } | 459 } |
460 } | 460 } |
461 | 461 |
462 void VideoCaptureController::OnBufferRetired(int buffer_id) { | 462 void VideoCaptureController::OnBufferRetired(int buffer_id) { |
463 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 463 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 EventHandlerAction action) { | 622 EventHandlerAction action) { |
623 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 623 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
624 for (const auto& client : controller_clients_) { | 624 for (const auto& client : controller_clients_) { |
625 if (client->session_closed) | 625 if (client->session_closed) |
626 continue; | 626 continue; |
627 action.Run(client->event_handler, client->controller_id); | 627 action.Run(client->event_handler, client->controller_id); |
628 } | 628 } |
629 } | 629 } |
630 | 630 |
631 } // namespace content | 631 } // namespace content |
OLD | NEW |