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

Unified Diff: remoting/host/desktop_session_proxy.cc

Issue 2050353002: Update webrtc::DesktopCapturer clients to implement OnCaptureResult(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix chromeos Created 4 years, 6 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
« no previous file with comments | « remoting/host/desktop_session_proxy.h ('k') | remoting/host/ipc_desktop_environment_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/desktop_session_proxy.cc
diff --git a/remoting/host/desktop_session_proxy.cc b/remoting/host/desktop_session_proxy.cc
index 2cd68c3d85f9c7f0278024d61c51db9324e14e00..636c177695e2114ff538339108783cb4b53337ae 100644
--- a/remoting/host/desktop_session_proxy.cc
+++ b/remoting/host/desktop_session_proxy.cc
@@ -178,8 +178,8 @@ bool DesktopSessionProxy::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(DesktopSessionProxy, message)
IPC_MESSAGE_HANDLER(ChromotingDesktopNetworkMsg_AudioPacket,
OnAudioPacket)
- IPC_MESSAGE_HANDLER(ChromotingDesktopNetworkMsg_CaptureCompleted,
- OnCaptureCompleted)
+ IPC_MESSAGE_HANDLER(ChromotingDesktopNetworkMsg_CaptureResult,
+ OnCaptureResult)
IPC_MESSAGE_HANDLER(ChromotingDesktopNetworkMsg_MouseCursor,
OnMouseCursor)
IPC_MESSAGE_HANDLER(ChromotingDesktopNetworkMsg_CreateSharedBuffer,
@@ -262,7 +262,8 @@ void DesktopSessionProxy::DetachFromDesktop() {
// Generate fake responses to keep the video capturer in sync.
while (pending_capture_frame_requests_) {
--pending_capture_frame_requests_;
- video_capturer_->OnCaptureCompleted(nullptr);
+ video_capturer_->OnCaptureResult(
+ webrtc::DesktopCapturer::Result::ERROR_PERMANENT, nullptr);
}
}
@@ -280,7 +281,8 @@ void DesktopSessionProxy::CaptureFrame() {
++pending_capture_frame_requests_;
SendToDesktop(new ChromotingNetworkDesktopMsg_CaptureFrame());
} else {
- video_capturer_->OnCaptureCompleted(nullptr);
+ video_capturer_->OnCaptureResult(
+ webrtc::DesktopCapturer::Result::ERROR_PERMANENT, nullptr);
}
}
@@ -467,16 +469,15 @@ void DesktopSessionProxy::OnReleaseSharedBuffer(int id) {
shared_buffers_.erase(id);
}
-void DesktopSessionProxy::OnCaptureCompleted(
+void DesktopSessionProxy::OnCaptureResult(
+ webrtc::DesktopCapturer::Result result,
const SerializedDesktopFrame& serialized_frame) {
DCHECK(caller_task_runner_->BelongsToCurrentThread());
--pending_capture_frame_requests_;
- // If the input serialized_frame does not have a screen size, it means the
- // capturer returns a nullptr for OnCaptureCompleted call.
- if (serialized_frame.dimensions.is_empty()) {
- video_capturer_->OnCaptureCompleted(nullptr);
+ if (result != webrtc::DesktopCapturer::Result::SUCCESS) {
+ video_capturer_->OnCaptureResult(result, nullptr);
return;
}
@@ -493,11 +494,12 @@ void DesktopSessionProxy::OnCaptureCompleted(
frame->set_capture_time_ms(serialized_frame.capture_time_ms);
frame->set_dpi(serialized_frame.dpi);
- for (size_t i = 0; i < serialized_frame.dirty_region.size(); ++i) {
- frame->mutable_updated_region()->AddRect(serialized_frame.dirty_region[i]);
+ for (const auto& rect : serialized_frame.dirty_region) {
+ frame->mutable_updated_region()->AddRect(rect);
}
- video_capturer_->OnCaptureCompleted(std::move(frame));
+ video_capturer_->OnCaptureResult(webrtc::DesktopCapturer::Result::SUCCESS,
+ std::move(frame));
}
void DesktopSessionProxy::OnMouseCursor(
« no previous file with comments | « remoting/host/desktop_session_proxy.h ('k') | remoting/host/ipc_desktop_environment_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698