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

Unified Diff: media/capture/video/android/video_capture_device_android.cc

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/android/video_capture_device_android.cc
diff --git a/media/capture/video/android/video_capture_device_android.cc b/media/capture/video/android/video_capture_device_android.cc
index 69d8b056346d6535862aac7663527a25388f497f..ae38e99cff8602e5d232af19213f2b79a3bc942f 100644
--- a/media/capture/video/android/video_capture_device_android.cc
+++ b/media/capture/video/android/video_capture_device_android.cc
@@ -68,7 +68,7 @@ void VideoCaptureDeviceAndroid::AllocateAndStart(
params.requested_format.frame_size.height(),
params.requested_format.frame_rate);
if (!ret) {
- SetErrorState("failed to allocate");
+ SetErrorState(FROM_HERE, "failed to allocate");
return;
}
@@ -96,7 +96,7 @@ void VideoCaptureDeviceAndroid::AllocateAndStart(
ret = Java_VideoCapture_startCapture(env, j_capture_.obj());
if (!ret) {
- SetErrorState("failed to start capture");
+ SetErrorState(FROM_HERE, "failed to start capture");
return;
}
@@ -118,7 +118,7 @@ void VideoCaptureDeviceAndroid::StopAndDeAllocate() {
jboolean ret = Java_VideoCapture_stopCapture(env, j_capture_.obj());
if (!ret) {
- SetErrorState("failed to stop capture");
+ SetErrorState(FROM_HERE, "failed to stop capture");
return;
}
@@ -171,7 +171,8 @@ void VideoCaptureDeviceAndroid::OnFrameAvailable(JNIEnv* env,
void VideoCaptureDeviceAndroid::OnError(JNIEnv* env,
jobject obj,
jstring message) {
- SetErrorState(base::android::ConvertJavaStringToUTF8(env, message));
+ SetErrorState(FROM_HERE,
+ base::android::ConvertJavaStringToUTF8(env, message));
}
VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() {
@@ -191,12 +192,14 @@ VideoPixelFormat VideoCaptureDeviceAndroid::GetColorspace() {
}
}
-void VideoCaptureDeviceAndroid::SetErrorState(const std::string& reason) {
+void VideoCaptureDeviceAndroid::SetErrorState(
+ const tracked_objects::Location& from_here,
+ const std::string& reason) {
{
base::AutoLock lock(lock_);
state_ = kError;
}
- client_->OnError(reason);
+ client_->OnError(from_here, reason);
}
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698