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

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

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#8 Created 3 years, 9 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 return; 415 return;
416 } 416 }
417 417
418 // Start capturing. 418 // Start capturing.
419 hr = media_control_->Run(); 419 hr = media_control_->Run();
420 if (FAILED(hr)) { 420 if (FAILED(hr)) {
421 SetErrorState(FROM_HERE, "Failed to start the Capture device.", hr); 421 SetErrorState(FROM_HERE, "Failed to start the Capture device.", hr);
422 return; 422 return;
423 } 423 }
424 424
425 client_->OnStarted();
425 state_ = kCapturing; 426 state_ = kCapturing;
426 } 427 }
427 428
428 void VideoCaptureDeviceWin::StopAndDeAllocate() { 429 void VideoCaptureDeviceWin::StopAndDeAllocate() {
429 DCHECK(thread_checker_.CalledOnValidThread()); 430 DCHECK(thread_checker_.CalledOnValidThread());
430 if (state_ != kCapturing) 431 if (state_ != kCapturing)
431 return; 432 return;
432 433
433 HRESULT hr = media_control_->Stop(); 434 HRESULT hr = media_control_->Stop();
434 if (FAILED(hr)) { 435 if (FAILED(hr)) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 void VideoCaptureDeviceWin::SetErrorState( 590 void VideoCaptureDeviceWin::SetErrorState(
590 const tracked_objects::Location& from_here, 591 const tracked_objects::Location& from_here,
591 const std::string& reason, 592 const std::string& reason,
592 HRESULT hr) { 593 HRESULT hr) {
593 DCHECK(thread_checker_.CalledOnValidThread()); 594 DCHECK(thread_checker_.CalledOnValidThread());
594 DLOG_IF_FAILED_WITH_HRESULT(reason, hr); 595 DLOG_IF_FAILED_WITH_HRESULT(reason, hr);
595 state_ = kError; 596 state_ = kError;
596 client_->OnError(from_here, reason); 597 client_->OnError(from_here, reason);
597 } 598 }
598 } // namespace media 599 } // namespace media
OLDNEW
« no previous file with comments | « media/capture/video/win/video_capture_device_mf_win.cc ('k') | services/video_capture/public/interfaces/receiver.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698