| 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/media/capture/web_contents_video_capture_device.h" | 5 #include "content/browser/media/capture/web_contents_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 if (success) { | 276 if (success) { |
| 277 // We can get a callback in the shutdown sequence for the browser main loop | 277 // We can get a callback in the shutdown sequence for the browser main loop |
| 278 // and this can result in a DCHECK failure. Avoid this by doing DCHECK only | 278 // and this can result in a DCHECK failure. Avoid this by doing DCHECK only |
| 279 // on success. | 279 // on success. |
| 280 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 280 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 281 | 281 |
| 282 if (frame_subscriber_ && frame_subscriber_->cursor_renderer_) { | 282 if (frame_subscriber_ && frame_subscriber_->cursor_renderer_) { |
| 283 CursorRenderer* cursor_renderer = | 283 CursorRenderer* cursor_renderer = |
| 284 frame_subscriber_->cursor_renderer_.get(); | 284 frame_subscriber_->cursor_renderer_.get(); |
| 285 if (cursor_renderer->SnapshotCursorState(region_in_frame)) | 285 if (cursor_renderer->SnapshotCursorState(region_in_frame)) |
| 286 cursor_renderer->RenderOnVideoFrame(frame); | 286 cursor_renderer->RenderOnVideoFrame(frame.get()); |
| 287 frame->metadata()->SetBoolean( | 287 frame->metadata()->SetBoolean( |
| 288 media::VideoFrameMetadata::INTERACTIVE_CONTENT, | 288 media::VideoFrameMetadata::INTERACTIVE_CONTENT, |
| 289 frame_subscriber_->IsUserInteractingWithContent()); | 289 frame_subscriber_->IsUserInteractingWithContent()); |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 capture_frame_cb.Run(std::move(frame), timestamp, success); | 292 capture_frame_cb.Run(std::move(frame), timestamp, success); |
| 293 } | 293 } |
| 294 | 294 |
| 295 bool FrameSubscriber::IsUserInteractingWithContent() { | 295 bool FrameSubscriber::IsUserInteractingWithContent() { |
| 296 bool ui_activity = window_activity_tracker_ && | 296 bool ui_activity = window_activity_tracker_ && |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { | 744 void WebContentsVideoCaptureDevice::StopAndDeAllocate() { |
| 745 core_->StopAndDeAllocate(); | 745 core_->StopAndDeAllocate(); |
| 746 } | 746 } |
| 747 | 747 |
| 748 void WebContentsVideoCaptureDevice::OnUtilizationReport(int frame_feedback_id, | 748 void WebContentsVideoCaptureDevice::OnUtilizationReport(int frame_feedback_id, |
| 749 double utilization) { | 749 double utilization) { |
| 750 core_->OnConsumerReportingUtilization(frame_feedback_id, utilization); | 750 core_->OnConsumerReportingUtilization(frame_feedback_id, utilization); |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace content | 753 } // namespace content |
| OLD | NEW |