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

Unified Diff: media/capture/video/mac/video_capture_device_mac.mm

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/mac/video_capture_device_mac.mm
diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm
index d14f55102f8559442b74095a7db9fb25cd0af198..3477a5abd4139527f0eebe09a23de163469845e8 100644
--- a/media/capture/video/mac/video_capture_device_mac.mm
+++ b/media/capture/video/mac/video_capture_device_mac.mm
@@ -359,6 +359,7 @@ void VideoCaptureDeviceMac::AllocateAndStart(
return;
}
+ client_->OnStarted();
state_ = kCapturing;
}
@@ -406,6 +407,9 @@ void VideoCaptureDeviceMac::ReceiveFrame(const uint8_t* video_frame,
int aspect_numerator,
int aspect_denominator,
base::TimeDelta timestamp) {
+ if (state_ != kCapturing)
chfremer 2017/02/17 23:51:15 Unless this runs on the same thread as AllocateAnd
braveyao 2017/02/22 18:06:44 Done. Tried to apply std::atomic<> to all other pl
+ return;
+
if (capture_format_.frame_size != frame_format.frame_size) {
ReceiveError(FROM_HERE,
"Captured resolution " + frame_format.frame_size.ToString() +

Powered by Google App Engine
This is Rietveld 408576698