| 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/video/capture/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 SetErrorState("Failed to Stop the Capture device"); | 493 SetErrorState("Failed to Stop the Capture device"); |
| 494 return; | 494 return; |
| 495 } | 495 } |
| 496 client_.reset(); | 496 client_.reset(); |
| 497 state_ = kIdle; | 497 state_ = kIdle; |
| 498 } | 498 } |
| 499 | 499 |
| 500 // Implements SinkFilterObserver::SinkFilterObserver. | 500 // Implements SinkFilterObserver::SinkFilterObserver. |
| 501 void VideoCaptureDeviceWin::FrameReceived(const uint8* buffer, | 501 void VideoCaptureDeviceWin::FrameReceived(const uint8* buffer, |
| 502 int length) { | 502 int length) { |
| 503 client_->OnIncomingCapturedFrame( | 503 client_->OnIncomingCapturedData( |
| 504 buffer, length, base::TimeTicks::Now(), 0, capture_format_); | 504 buffer, length, capture_format_, 0, base::TimeTicks::Now()); |
| 505 } | 505 } |
| 506 | 506 |
| 507 bool VideoCaptureDeviceWin::CreateCapabilityMap() { | 507 bool VideoCaptureDeviceWin::CreateCapabilityMap() { |
| 508 DCHECK(CalledOnValidThread()); | 508 DCHECK(CalledOnValidThread()); |
| 509 ScopedComPtr<IAMStreamConfig> stream_config; | 509 ScopedComPtr<IAMStreamConfig> stream_config; |
| 510 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); | 510 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); |
| 511 if (FAILED(hr)) { | 511 if (FAILED(hr)) { |
| 512 DVLOG(2) << "Failed to get IAMStreamConfig interface from " | 512 DVLOG(2) << "Failed to get IAMStreamConfig interface from " |
| 513 "capture device"; | 513 "capture device"; |
| 514 return false; | 514 return false; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 return !capabilities_.empty(); | 613 return !capabilities_.empty(); |
| 614 } | 614 } |
| 615 | 615 |
| 616 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 616 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| 617 DCHECK(CalledOnValidThread()); | 617 DCHECK(CalledOnValidThread()); |
| 618 DVLOG(1) << reason; | 618 DVLOG(1) << reason; |
| 619 state_ = kError; | 619 state_ = kError; |
| 620 client_->OnError(reason); | 620 client_->OnError(reason); |
| 621 } | 621 } |
| 622 } // namespace media | 622 } // namespace media |
| OLD | NEW |