Chromium Code Reviews| 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 client_->OnIncomingCapturedData(buffer, length, capture_format_, 0, | 451 const uint8* buffer, |
| 452 base::TimeTicks::Now()); | 452 int length, |
| 453 REFERENCE_TIME raw_timestamp) { | |
| 454 client_->OnIncomingCapturedData( | |
| 455 buffer, | |
| 456 length, | |
| 457 capture_format_, | |
| 458 0, | |
| 459 base::TimeTicks() + | |
|
mcasas
2015/09/09 23:33:27
Funny you need to add a dummy ctor to add a TimeDe
qiangchen
2015/09/10 18:03:01
TimeTicks has only static function FromInternalVal
| |
| 460 base::TimeDelta::FromMicroseconds(raw_timestamp / 10)); | |
| 453 } | 461 } |
| 454 | 462 |
| 455 bool VideoCaptureDeviceWin::CreateCapabilityMap() { | 463 bool VideoCaptureDeviceWin::CreateCapabilityMap() { |
| 456 DCHECK(thread_checker_.CalledOnValidThread()); | 464 DCHECK(thread_checker_.CalledOnValidThread()); |
| 457 ScopedComPtr<IAMStreamConfig> stream_config; | 465 ScopedComPtr<IAMStreamConfig> stream_config; |
| 458 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); | 466 HRESULT hr = output_capture_pin_.QueryInterface(stream_config.Receive()); |
| 459 if (FAILED(hr)) { | 467 if (FAILED(hr)) { |
| 460 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " | 468 DPLOG(ERROR) << "Failed to get IAMStreamConfig interface from " |
| 461 "capture device: " << logging::SystemErrorCodeToString(hr); | 469 "capture device: " << logging::SystemErrorCodeToString(hr); |
| 462 return false; | 470 return false; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 572 DVLOG(2) << "Anti-flicker setting not supported."; | 580 DVLOG(2) << "Anti-flicker setting not supported."; |
| 573 } | 581 } |
| 574 } | 582 } |
| 575 | 583 |
| 576 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 584 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| 577 DCHECK(thread_checker_.CalledOnValidThread()); | 585 DCHECK(thread_checker_.CalledOnValidThread()); |
| 578 state_ = kError; | 586 state_ = kError; |
| 579 client_->OnError(reason); | 587 client_->OnError(reason); |
| 580 } | 588 } |
| 581 } // namespace media | 589 } // namespace media |
| OLD | NEW |