| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/video/capture/file_video_capture_device.h" | 5 #include "media/video/capture/file_video_capture_device.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 current_byte_index_ = first_frame_byte_index_; | 266 current_byte_index_ = first_frame_byte_index_; |
| 267 CHECK_EQ(file_.Read(current_byte_index_, | 267 CHECK_EQ(file_.Read(current_byte_index_, |
| 268 reinterpret_cast<char*>(video_frame_.get()), | 268 reinterpret_cast<char*>(video_frame_.get()), |
| 269 frame_size_), | 269 frame_size_), |
| 270 frame_size_); | 270 frame_size_); |
| 271 } else { | 271 } else { |
| 272 current_byte_index_ += frame_size_ + kY4MSimpleFrameDelimiterSize; | 272 current_byte_index_ += frame_size_ + kY4MSimpleFrameDelimiterSize; |
| 273 } | 273 } |
| 274 | 274 |
| 275 // Give the captured frame to the client. | 275 // Give the captured frame to the client. |
| 276 client_->OnIncomingCapturedFrame(video_frame_.get(), | 276 client_->OnIncomingCapturedData(video_frame_.get(), |
| 277 frame_size_, | 277 frame_size_, |
| 278 base::TimeTicks::Now(), | 278 capture_format_, |
| 279 0, | 279 0, |
| 280 capture_format_); | 280 base::TimeTicks::Now()); |
| 281 // Reschedule next CaptureTask. | 281 // Reschedule next CaptureTask. |
| 282 base::MessageLoop::current()->PostDelayedTask( | 282 base::MessageLoop::current()->PostDelayedTask( |
| 283 FROM_HERE, | 283 FROM_HERE, |
| 284 base::Bind(&FileVideoCaptureDevice::OnCaptureTask, | 284 base::Bind(&FileVideoCaptureDevice::OnCaptureTask, |
| 285 base::Unretained(this)), | 285 base::Unretained(this)), |
| 286 base::TimeDelta::FromSeconds(1) / capture_format_.frame_rate); | 286 base::TimeDelta::FromSeconds(1) / capture_format_.frame_rate); |
| 287 } | 287 } |
| 288 | 288 |
| 289 } // namespace media | 289 } // namespace media |
| OLD | NEW |