| 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 "media/capture/video/fake_video_capture_device.h" | 5 #include "media/capture/video/fake_video_capture_device.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 if (client_ == nullptr) | 573 if (client_ == nullptr) |
| 574 return; | 574 return; |
| 575 | 575 |
| 576 const int arbitrary_frame_feedback_id = 0; | 576 const int arbitrary_frame_feedback_id = 0; |
| 577 auto capture_buffer = client_->ReserveOutputBuffer( | 577 auto capture_buffer = client_->ReserveOutputBuffer( |
| 578 device_state_->format.frame_size, device_state_->format.pixel_format, | 578 device_state_->format.frame_size, device_state_->format.pixel_format, |
| 579 device_state_->format.pixel_storage, arbitrary_frame_feedback_id); | 579 device_state_->format.pixel_storage, arbitrary_frame_feedback_id); |
| 580 DLOG_IF(ERROR, !capture_buffer.is_valid()) | 580 DLOG_IF(ERROR, !capture_buffer.is_valid()) |
| 581 << "Couldn't allocate Capture Buffer"; | 581 << "Couldn't allocate Capture Buffer"; |
| 582 auto buffer_access = | 582 auto buffer_access = |
| 583 capture_buffer.handle_provider()->GetHandleForInProcessAccess(); | 583 capture_buffer.handle_provider->GetHandleForInProcessAccess(); |
| 584 DCHECK(buffer_access->data()) << "Buffer has NO backing memory"; | 584 DCHECK(buffer_access->data()) << "Buffer has NO backing memory"; |
| 585 | 585 |
| 586 DCHECK_EQ(PIXEL_STORAGE_CPU, device_state_->format.pixel_storage); | 586 DCHECK_EQ(PIXEL_STORAGE_CPU, device_state_->format.pixel_storage); |
| 587 | 587 |
| 588 uint8_t* data_ptr = buffer_access->data(); | 588 uint8_t* data_ptr = buffer_access->data(); |
| 589 memset(data_ptr, 0, buffer_access->mapped_size()); | 589 memset(data_ptr, 0, buffer_access->mapped_size()); |
| 590 frame_painter_->PaintFrame(timestamp_to_paint, data_ptr); | 590 frame_painter_->PaintFrame(timestamp_to_paint, data_ptr); |
| 591 | 591 |
| 592 base::TimeTicks now = base::TimeTicks::Now(); | 592 base::TimeTicks now = base::TimeTicks::Now(); |
| 593 client_->OnIncomingCapturedBuffer(std::move(capture_buffer), | 593 client_->OnIncomingCapturedBuffer(std::move(capture_buffer), |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 int session_id) { | 630 int session_id) { |
| 631 DCHECK(thread_checker_.CalledOnValidThread()); | 631 DCHECK(thread_checker_.CalledOnValidThread()); |
| 632 if (session_id != current_session_id_) | 632 if (session_id != current_session_id_) |
| 633 return; | 633 return; |
| 634 | 634 |
| 635 frame_deliverer_->PaintAndDeliverNextFrame(elapsed_time_); | 635 frame_deliverer_->PaintAndDeliverNextFrame(elapsed_time_); |
| 636 BeepAndScheduleNextCapture(expected_execution_time); | 636 BeepAndScheduleNextCapture(expected_execution_time); |
| 637 } | 637 } |
| 638 | 638 |
| 639 } // namespace media | 639 } // namespace media |
| OLD | NEW |