| 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 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 } | 440 } |
| 441 | 441 |
| 442 graph_builder_->Disconnect(output_capture_pin_.get()); | 442 graph_builder_->Disconnect(output_capture_pin_.get()); |
| 443 graph_builder_->Disconnect(input_sink_pin_.get()); | 443 graph_builder_->Disconnect(input_sink_pin_.get()); |
| 444 | 444 |
| 445 client_.reset(); | 445 client_.reset(); |
| 446 state_ = kIdle; | 446 state_ = kIdle; |
| 447 } | 447 } |
| 448 | 448 |
| 449 // Implements SinkFilterObserver::SinkFilterObserver. | 449 // Implements SinkFilterObserver::SinkFilterObserver. |
| 450 void VideoCaptureDeviceWin::FrameReceived(const uint8* buffer, int length) { | 450 void VideoCaptureDeviceWin::FrameReceived( |
| 451 const uint8* buffer, |
| 452 int length, |
| 453 base::TimeTicks timestamp) { |
| 451 client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, | 454 client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, |
| 452 base::TimeTicks::Now()); | 455 timestamp); |
| 453 } | 456 } |
| 454 | 457 |
| 455 bool VideoCaptureDeviceWin::CreateCapabilityMap() { | 458 bool VideoCaptureDeviceWin::CreateCapabilityMap() { |
| 456 DCHECK(thread_checker_.CalledOnValidThread()); | 459 DCHECK(thread_checker_.CalledOnValidThread()); |
| 457 ScopedComPtr<IAMStreamConfig> stream_config; | 460 ScopedComPtr<IAMStreamConfig> stream_config; |
| 458 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); | 461 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); |
| 459 if (FAILED(hr)) { | 462 if (FAILED(hr)) { |
| 460 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " | 463 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " |
| 461 "capture device: " << logging::SystemErrorCodeToString(hr); | 464 "capture device: " << logging::SystemErrorCodeToString(hr); |
| 462 return false; | 465 return false; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 DVLOG(2) << "Anti-flicker setting not supported."; | 575 DVLOG(2) << "Anti-flicker setting not supported."; |
| 573 } | 576 } |
| 574 } | 577 } |
| 575 | 578 |
| 576 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 579 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| 577 DCHECK(thread_checker_.CalledOnValidThread()); | 580 DCHECK(thread_checker_.CalledOnValidThread()); |
| 578 state_ = kError; | 581 state_ = kError; |
| 579 client_->OnError(reason); | 582 client_->OnError(reason); |
| 580 } | 583 } |
| 581 } // namespace media | 584 } // namespace media |
| OLD | NEW |