Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Side by Side Diff: media/capture/video/win/video_capture_device_win.cc

Issue 1324683004: Win Video Capture: Sending the timestamps provided by the driver to the capture pipeline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698