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

Unified Diff: content/browser/renderer_host/media/peer_connection_tracker_host.cc

Issue 2123863004: ScreenCapture for Android phase1, part II (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: UI tweaking and rebase Created 4 years, 4 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: content/browser/renderer_host/media/peer_connection_tracker_host.cc
diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.cc b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
index 7afc300c9eb94d0b825a8e883b9864497ffae011..5c07430f80933ed6caf3c5e96b31efcfc9d80c39 100644
--- a/content/browser/renderer_host/media/peer_connection_tracker_host.cc
+++ b/content/browser/renderer_host/media/peer_connection_tracker_host.cc
@@ -7,6 +7,7 @@
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/webrtc/webrtc_eventlog_host.h"
#include "content/browser/webrtc/webrtc_internals.h"
+#include "content/common/media/media_stream_options.h"
#include "content/common/media/peer_connection_tracker_messages.h"
namespace content {
@@ -16,6 +17,7 @@ PeerConnectionTrackerHost::PeerConnectionTrackerHost(
const base::WeakPtr<WebRTCEventLogHost>& event_log_host)
: BrowserMessageFilter(PeerConnectionTrackerMsgStart),
render_process_id_(render_process_id),
+ is_screen_capture_(false),
event_log_host_(event_log_host) {
DCHECK(event_log_host);
}
@@ -103,16 +105,21 @@ void PeerConnectionTrackerHost::OnAddStats(int lid,
void PeerConnectionTrackerHost::OnGetUserMedia(
const std::string& origin,
bool audio,
- bool video,
+ const VideoInfo& video_info,
const std::string& audio_constraints,
const std::string& video_constraints) {
+ base::AutoLock lock(lock_);
WebRTCInternals::GetInstance()->OnGetUserMedia(render_process_id_,
peer_pid(),
origin,
audio,
- video,
+ video_info.video,
audio_constraints,
video_constraints);
+#if defined(OS_ANDROID)
+ is_screen_capture_ =
+ video_info.video_stream_source == kMediaStreamSourceScreen;
+#endif
}
void PeerConnectionTrackerHost::OnSuspend() {
@@ -121,10 +128,11 @@ void PeerConnectionTrackerHost::OnSuspend() {
}
void PeerConnectionTrackerHost::SendOnSuspendOnUIThread() {
+ base::AutoLock lock(lock_);
DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::RenderProcessHost* host =
content::RenderProcessHost::FromID(render_process_id_);
- if (host)
+ if (host && !is_screen_capture_)
host->Send(new PeerConnectionTracker_OnSuspend());
}

Powered by Google App Engine
This is Rietveld 408576698