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

Unified Diff: media/capture/video/win/video_capture_device_mf_win.cc

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#4 and revise unittests Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: media/capture/video/win/video_capture_device_mf_win.cc
diff --git a/media/capture/video/win/video_capture_device_mf_win.cc b/media/capture/video/win/video_capture_device_mf_win.cc
index 88fd33d2c83c82bd56e92c738a7d802fb6cde53f..55df893518f81124f87977b1fc0f1ea03f1e977c 100644
--- a/media/capture/video/win/video_capture_device_mf_win.cc
+++ b/media/capture/video/win/video_capture_device_mf_win.cc
@@ -239,6 +239,7 @@ void VideoCaptureDeviceMFWin::AllocateAndStart(
reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL);
if (SUCCEEDED(hr)) {
capture_format_ = found_capability.supported_format;
+ client_->OnStarted();
capture_ = true;
return;
}
@@ -286,22 +287,23 @@ void VideoCaptureDeviceMFWin::OnIncomingCapturedData(
base::TimeTicks reference_time,
base::TimeDelta timestamp) {
base::AutoLock lock(lock_);
+ if (!capture_)
+ return;
+
if (data && client_.get()) {
client_->OnIncomingCapturedData(data, length, capture_format_, rotation,
reference_time, timestamp);
}
- if (capture_) {
- HRESULT hr =
- reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL);
- if (FAILED(hr)) {
- // If running the *VideoCap* unit tests on repeat, this can sometimes
- // fail with HRESULT_FROM_WINHRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION).
- // It's not clear to me why this is, but it is possible that it has
- // something to do with this bug:
- // http://support.microsoft.com/kb/979567
- OnError(FROM_HERE, hr);
- }
+ HRESULT hr =
+ reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL);
+ if (FAILED(hr)) {
+ // If running the *VideoCap* unit tests on repeat, this can sometimes
+ // fail with HRESULT_FROM_WINHRESULT_FROM_WIN32(ERROR_INVALID_FUNCTION).
+ // It's not clear to me why this is, but it is possible that it has
+ // something to do with this bug:
+ // http://support.microsoft.com/kb/979567
+ OnError(FROM_HERE, hr);
}
}

Powered by Google App Engine
This is Rietveld 408576698