| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/child/child_process.h" | 10 #include "content/child/child_process.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 void BufferReceived(int buffer_id, const gfx::Size& size) { | 129 void BufferReceived(int buffer_id, const gfx::Size& size) { |
| 130 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New(); | 130 mojom::VideoFrameInfoPtr info = mojom::VideoFrameInfo::New(); |
| 131 | 131 |
| 132 const base::TimeTicks now = base::TimeTicks::Now(); | 132 const base::TimeTicks now = base::TimeTicks::Now(); |
| 133 media::VideoFrameMetadata frame_metadata; | 133 media::VideoFrameMetadata frame_metadata; |
| 134 frame_metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, now); | 134 frame_metadata.SetTimeTicks(media::VideoFrameMetadata::REFERENCE_TIME, now); |
| 135 frame_metadata.MergeInternalValuesInto(&info->metadata); | 135 frame_metadata.MergeInternalValuesInto(&info->metadata); |
| 136 | 136 |
| 137 info->timestamp = now - base::TimeTicks(); | 137 info->timestamp = now - base::TimeTicks(); |
| 138 info->pixel_format = media::mojom::VideoFormat::I420; | 138 info->pixel_format = media::PIXEL_FORMAT_I420; |
| 139 info->storage_type = media::PIXEL_STORAGE_CPU; | 139 info->storage_type = media::PIXEL_STORAGE_CPU; |
| 140 info->coded_size = size; | 140 info->coded_size = size; |
| 141 info->visible_rect = gfx::Rect(size); | 141 info->visible_rect = gfx::Rect(size); |
| 142 | 142 |
| 143 video_capture_impl_->OnBufferReady(buffer_id, std::move(info)); | 143 video_capture_impl_->OnBufferReady(buffer_id, std::move(info)); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void BufferDestroyed(int buffer_id) { | 146 void BufferDestroyed(int buffer_id) { |
| 147 video_capture_impl_->OnBufferDestroyed(buffer_id); | 147 video_capture_impl_->OnBufferDestroyed(buffer_id); |
| 148 } | 148 } |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 EXPECT_CALL(mock_video_capture_host_, DoStart(_, kSessionId, params_small_)); | 340 EXPECT_CALL(mock_video_capture_host_, DoStart(_, kSessionId, params_small_)); |
| 341 | 341 |
| 342 StartCapture(0, params_small_); | 342 StartCapture(0, params_small_); |
| 343 | 343 |
| 344 OnStateChanged(mojom::VideoCaptureState::FAILED); | 344 OnStateChanged(mojom::VideoCaptureState::FAILED); |
| 345 | 345 |
| 346 StopCapture(0); | 346 StopCapture(0); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace content | 349 } // namespace content |
| OLD | NEW |