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

Unified Diff: remoting/client/jni/chromoting_jni_instance.cc

Issue 2052723002: Adding an interface to allow extention of the audio player for CRD and iOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing comments in CL. 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/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/chromoting_jni_instance.cc
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc
index 6e96c3b6d3ec515857215ae2254e01ef38908cb3..2bfbd63bef1fc4b15419ef84a3747edebc2613d1 100644
--- a/remoting/client/jni/chromoting_jni_instance.cc
+++ b/remoting/client/jni/chromoting_jni_instance.cc
@@ -46,7 +46,7 @@ const bool kXmppUseTls = true;
// Interval at which to log performance statistics, if enabled.
const int kPerfStatsIntervalMs = 60000;
-}
+} // namespace
ChromotingJniInstance::ChromotingJniInstance(
ChromotingJniRuntime* jni_runtime,
@@ -400,9 +400,13 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() {
video_renderer_.reset(new SoftwareVideoRenderer(
client_context_->decode_task_runner(), view_.get(), perf_tracker_.get()));
- client_.reset(
- new ChromotingClient(client_context_.get(), this, video_renderer_.get(),
- base::WrapUnique(new AudioPlayerAndroid())));
+ if (!audio_player_) {
+ audio_player_.reset(new AudioPlayerAndroid());
+ }
+
+ client_.reset(new ChromotingClient(client_context_.get(), this,
+ video_renderer_.get(),
+ audio_player_->GetWeakPtr()));
signaling_.reset(
new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(),
@@ -503,6 +507,7 @@ void ChromotingJniInstance::LogPerfStats() {
void ChromotingJniInstance::ReleaseResources() {
// |client_| must be torn down before |signaling_|.
client_.reset();
+ audio_player_.reset();
video_renderer_.reset();
view_.reset();
signaling_.reset();
« no previous file with comments | « remoting/client/jni/chromoting_jni_instance.h ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698