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

Side by Side Diff: remoting/host/remoting_me2me_host.cc

Issue 11316010: Fix AudioCapturer implementation to read from audio pipe even when there are no active clients. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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
« no previous file with comments | « remoting/host/linux/audio_pipe_reader.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // This file implements a standalone host process for Me2Me. 5 // This file implements a standalone host process for Me2Me.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 } 437 }
438 438
439 void HostProcess::StartHostProcess() { 439 void HostProcess::StartHostProcess() {
440 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread()); 440 DCHECK(context_->ui_task_runner()->BelongsToCurrentThread());
441 441
442 if (!InitWithCommandLine(CommandLine::ForCurrentProcess())) { 442 if (!InitWithCommandLine(CommandLine::ForCurrentProcess())) {
443 OnConfigWatcherError(); 443 OnConfigWatcherError();
444 return; 444 return;
445 } 445 }
446 446
447 #if defined(OS_LINUX)
448 // TODO(sergeyu): Pass configuration parameters to the Linux-specific version
449 // of DesktopEnvironmentFactory when we have it.
450 remoting::VideoFrameCapturer::EnableXDamage(true);
451
452 // If an audio pipe is specific on the command-line then initialize
453 // AudioCapturerLinux to capture from it.
454 FilePath audio_pipe_name = CommandLine::ForCurrentProcess()->
455 GetSwitchValuePath(kAudioPipeSwitchName);
456 if (!audio_pipe_name.empty()) {
457 remoting::AudioCapturerLinux::InitializePipeReader(
458 context_->audio_task_runner(), audio_pipe_name);
459 }
460 #endif // defined(OS_LINUX)
461
447 // Create a desktop environment factory appropriate to the build type & 462 // Create a desktop environment factory appropriate to the build type &
448 // platform. 463 // platform.
449 #if defined(OS_WIN) 464 #if defined(OS_WIN)
450 465
451 #if defined(REMOTING_MULTI_PROCESS) 466 #if defined(REMOTING_MULTI_PROCESS)
452 IpcDesktopEnvironmentFactory* desktop_environment_factory = 467 IpcDesktopEnvironmentFactory* desktop_environment_factory =
453 new IpcDesktopEnvironmentFactory( 468 new IpcDesktopEnvironmentFactory(
454 daemon_channel_.get(), 469 daemon_channel_.get(),
455 context_->input_task_runner(), 470 context_->input_task_runner(),
456 context_->network_task_runner(), 471 context_->network_task_runner(),
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 net::EnableSSLServerSockets(); 905 net::EnableSSLServerSockets();
891 906
892 // Create the main message loop and start helper threads. 907 // Create the main message loop and start helper threads.
893 MessageLoop message_loop(MessageLoop::TYPE_UI); 908 MessageLoop message_loop(MessageLoop::TYPE_UI);
894 base::Closure quit_message_loop = base::Bind(&QuitMessageLoop, &message_loop); 909 base::Closure quit_message_loop = base::Bind(&QuitMessageLoop, &message_loop);
895 scoped_ptr<remoting::ChromotingHostContext> context( 910 scoped_ptr<remoting::ChromotingHostContext> context(
896 new remoting::ChromotingHostContext( 911 new remoting::ChromotingHostContext(
897 new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(), 912 new remoting::AutoThreadTaskRunner(message_loop.message_loop_proxy(),
898 quit_message_loop))); 913 quit_message_loop)));
899 914
900 #if defined(OS_LINUX)
901 // TODO(sergeyu): Pass configuration parameters to the Linux-specific version
902 // of DesktopEnvironmentFactory when we have it.
903 remoting::VideoFrameCapturer::EnableXDamage(true);
904 remoting::AudioCapturerLinux::SetPipeName(CommandLine::ForCurrentProcess()->
905 GetSwitchValuePath(kAudioPipeSwitchName));
906 #endif // defined(OS_LINUX)
907
908 if (!context->Start()) 915 if (!context->Start())
909 return remoting::kInitializationFailed; 916 return remoting::kInitializationFailed;
910 917
911 // Create the host process instance and enter the main message loop. 918 // Create the host process instance and enter the main message loop.
912 remoting::HostProcess me2me_host(context.Pass()); 919 remoting::HostProcess me2me_host(context.Pass());
913 me2me_host.StartHostProcess(); 920 me2me_host.StartHostProcess();
914 message_loop.Run(); 921 message_loop.Run();
915 return me2me_host.get_exit_code(); 922 return me2me_host.get_exit_code();
916 } 923 }
917 924
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 user32.GetFunctionPointer("SetProcessDPIAware")); 956 user32.GetFunctionPointer("SetProcessDPIAware"));
950 set_process_dpi_aware(); 957 set_process_dpi_aware();
951 } 958 }
952 959
953 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting 960 // CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
954 // the command line from GetCommandLineW(), so we can safely pass NULL here. 961 // the command line from GetCommandLineW(), so we can safely pass NULL here.
955 return main(0, NULL); 962 return main(0, NULL);
956 } 963 }
957 964
958 #endif // defined(OS_WIN) 965 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « remoting/host/linux/audio_pipe_reader.cc ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698