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

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

Issue 1418263006: Extend VideoCaptureDevice::Client::OnError() to have a tracked_objects::Location param. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 5fc083e4d68169482e2c329d43ebbebcce1a7d83..cc8608e0998f0744525fb1bb614c0d810f99300f 100644
--- a/media/capture/video/mac/video_capture_device_mac.mm
+++ b/media/capture/video/mac/video_capture_device_mac.mm
@@ -381,7 +381,7 @@ void VideoCaptureDeviceMac::AllocateAndStart(
[capture_device_ setFrameReceiver:this];
if (![capture_device_ setCaptureDevice:deviceId]) {
- SetErrorState("Could not open capture device.");
+ SetErrorState(FROM_HERE, "Could not open capture device.");
return;
}
@@ -422,7 +422,7 @@ void VideoCaptureDeviceMac::AllocateAndStart(
}
if (![capture_device_ startCapture]) {
- SetErrorState("Could not start capture device.");
+ SetErrorState(FROM_HERE, "Could not start capture device.");
return;
}
@@ -530,8 +530,9 @@ void VideoCaptureDeviceMac::ReceiveFrame(const uint8* video_frame,
if (!AVFoundationGlue::IsAVFoundationSupported()) {
capture_format_.frame_size = frame_format.frame_size;
} else if (capture_format_.frame_size != frame_format.frame_size) {
- ReceiveError("Captured resolution " + frame_format.frame_size.ToString() +
- ", and expected " + capture_format_.frame_size.ToString());
+ ReceiveError(FROM_HERE,
+ "Captured resolution " + frame_format.frame_size.ToString() +
+ ", and expected " + capture_format_.frame_size.ToString());
return;
}
@@ -539,16 +540,20 @@ void VideoCaptureDeviceMac::ReceiveFrame(const uint8* video_frame,
0, base::TimeTicks::Now());
}
-void VideoCaptureDeviceMac::ReceiveError(const std::string& reason) {
- task_runner_->PostTask(FROM_HERE,
- base::Bind(&VideoCaptureDeviceMac::SetErrorState,
- weak_factory_.GetWeakPtr(), reason));
+void VideoCaptureDeviceMac::ReceiveError(
+ const tracked_objects::Location& from_here,
+ const std::string& reason) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&VideoCaptureDeviceMac::SetErrorState,
+ weak_factory_.GetWeakPtr(), from_here, reason));
}
-void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) {
+void VideoCaptureDeviceMac::SetErrorState(
+ const tracked_objects::Location& from_here,
+ const std::string& reason) {
DCHECK(task_runner_->BelongsToCurrentThread());
state_ = kError;
- client_->OnError(reason);
+ client_->OnError(from_here, reason);
}
void VideoCaptureDeviceMac::LogMessage(const std::string& message) {
@@ -561,7 +566,7 @@ bool VideoCaptureDeviceMac::UpdateCaptureResolution() {
if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
width:capture_format_.frame_size.width()
frameRate:capture_format_.frame_rate]) {
- ReceiveError("Could not configure capture device.");
+ ReceiveError(FROM_HERE, "Could not configure capture device.");
return false;
}
return true;

Powered by Google App Engine
This is Rietveld 408576698