| 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/win/video_capture_device_win.h" | 5 #include "media/capture/video/win/video_capture_device_win.h" |
| 6 | 6 |
| 7 #include <ks.h> | 7 #include <ks.h> |
| 8 #include <ksmedia.h> | 8 #include <ksmedia.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 | 445 |
| 446 client_.reset(); | 446 client_.reset(); |
| 447 state_ = kIdle; | 447 state_ = kIdle; |
| 448 } | 448 } |
| 449 | 449 |
| 450 // Implements SinkFilterObserver::SinkFilterObserver. | 450 // Implements SinkFilterObserver::SinkFilterObserver. |
| 451 void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer, | 451 void VideoCaptureDeviceWin::FrameReceived(const uint8_t* buffer, |
| 452 int length, | 452 int length, |
| 453 base::TimeTicks timestamp) { | 453 base::TimeTicks timestamp) { |
| 454 client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, | 454 client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, |
| 455 timestamp); | 455 base::TimeTicks::Now()); |
| 456 } | 456 } |
| 457 | 457 |
| 458 bool VideoCaptureDeviceWin::CreateCapabilityMap() { | 458 bool VideoCaptureDeviceWin::CreateCapabilityMap() { |
| 459 DCHECK(thread_checker_.CalledOnValidThread()); | 459 DCHECK(thread_checker_.CalledOnValidThread()); |
| 460 ScopedComPtr<IAMStreamConfig> stream_config; | 460 ScopedComPtr<IAMStreamConfig> stream_config; |
| 461 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); | 461 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); |
| 462 if (FAILED(hr)) { | 462 if (FAILED(hr)) { |
| 463 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " | 463 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " |
| 464 "capture device: " << logging::SystemErrorCodeToString(hr); | 464 "capture device: " << logging::SystemErrorCodeToString(hr); |
| 465 return false; | 465 return false; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 } | 574 } |
| 575 | 575 |
| 576 void VideoCaptureDeviceWin::SetErrorState( | 576 void VideoCaptureDeviceWin::SetErrorState( |
| 577 const tracked_objects::Location& from_here, | 577 const tracked_objects::Location& from_here, |
| 578 const std::string& reason) { | 578 const std::string& reason) { |
| 579 DCHECK(thread_checker_.CalledOnValidThread()); | 579 DCHECK(thread_checker_.CalledOnValidThread()); |
| 580 state_ = kError; | 580 state_ = kError; |
| 581 client_->OnError(from_here, reason); | 581 client_->OnError(from_here, reason); |
| 582 } | 582 } |
| 583 } // namespace media | 583 } // namespace media |
| OLD | NEW |