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

Side by Side Diff: remoting/client/plugin/chromoting_instance.cc

Issue 10843031: Piping for audio decoding. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made the AudioDecodeScheduler destructor virtual Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/client/plugin/chromoting_instance.h" 5 #include "remoting/client/plugin/chromoting_instance.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); 463 scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
464 PostChromotingMessage("onFirstFrameReceived", data.Pass()); 464 PostChromotingMessage("onFirstFrameReceived", data.Pass());
465 } 465 }
466 466
467 void ChromotingInstance::Connect(const ClientConfig& config) { 467 void ChromotingInstance::Connect(const ClientConfig& config) {
468 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); 468 DCHECK(plugin_task_runner_->BelongsToCurrentThread());
469 469
470 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread(); 470 jingle_glue::JingleThreadWrapper::EnsureForCurrentThread();
471 471
472 host_connection_.reset(new protocol::ConnectionToHost(true)); 472 host_connection_.reset(new protocol::ConnectionToHost(true));
473 audio_player_.reset(new PepperAudioPlayer(this)); 473 scoped_ptr<AudioPlayer> audio_player(new PepperAudioPlayer(this));
474 client_.reset(new ChromotingClient(config, context_.main_task_runner(), 474 client_.reset(new ChromotingClient(config, &context_,
475 host_connection_.get(), this, 475 host_connection_.get(), this,
476 rectangle_decoder_.get(), 476 rectangle_decoder_.get(),
477 audio_player_.get())); 477 audio_player.Pass()));
478 478
479 // Construct the input pipeline 479 // Construct the input pipeline
480 mouse_input_filter_.reset( 480 mouse_input_filter_.reset(
481 new protocol::MouseInputFilter(host_connection_->input_stub())); 481 new protocol::MouseInputFilter(host_connection_->input_stub()));
482 mouse_input_filter_->set_input_size(view_->get_view_size_dips()); 482 mouse_input_filter_->set_input_size(view_->get_view_size_dips());
483 input_tracker_.reset( 483 input_tracker_.reset(
484 new protocol::InputEventTracker(mouse_input_filter_.get())); 484 new protocol::InputEventTracker(mouse_input_filter_.get()));
485 485
486 #if defined(OS_MACOSX) 486 #if defined(OS_MACOSX)
487 // On Mac we need an extra filter to inject missing keyup events. 487 // On Mac we need an extra filter to inject missing keyup events.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 base::WaitableEvent done_event(true, false); 529 base::WaitableEvent done_event(true, false);
530 client_->Stop(base::Bind(&base::WaitableEvent::Signal, 530 client_->Stop(base::Bind(&base::WaitableEvent::Signal,
531 base::Unretained(&done_event))); 531 base::Unretained(&done_event)));
532 done_event.Wait(); 532 done_event.Wait();
533 client_.reset(); 533 client_.reset();
534 } 534 }
535 535
536 input_handler_.reset(); 536 input_handler_.reset();
537 input_tracker_.reset(); 537 input_tracker_.reset();
538 mouse_input_filter_.reset(); 538 mouse_input_filter_.reset();
539 audio_player_.reset();
540 host_connection_.reset(); 539 host_connection_.reset();
541 } 540 }
542 541
543 void ChromotingInstance::OnIncomingIq(const std::string& iq) { 542 void ChromotingInstance::OnIncomingIq(const std::string& iq) {
544 xmpp_proxy_->OnIq(iq); 543 xmpp_proxy_->OnIq(iq);
545 } 544 }
546 545
547 void ChromotingInstance::ReleaseAllKeys() { 546 void ChromotingInstance::ReleaseAllKeys() {
548 if (IsConnected()) 547 if (IsConnected())
549 input_tracker_->ReleaseAll(); 548 input_tracker_->ReleaseAll();
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 PostChromotingMessage("logDebugMessage", data.Pass()); 746 PostChromotingMessage("logDebugMessage", data.Pass());
748 g_logging_to_plugin = false; 747 g_logging_to_plugin = false;
749 } 748 }
750 749
751 bool ChromotingInstance::IsConnected() { 750 bool ChromotingInstance::IsConnected() {
752 return host_connection_.get() && 751 return host_connection_.get() &&
753 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED); 752 (host_connection_->state() == protocol::ConnectionToHost::CONNECTED);
754 } 753 }
755 754
756 } // namespace remoting 755 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698