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

Unified Diff: remoting/host/audio_capturer_linux.cc

Issue 10911271: Remove CommandLine dependency from the Linux's AudioCapturer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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: remoting/host/audio_capturer_linux.cc
diff --git a/remoting/host/audio_capturer_linux.cc b/remoting/host/audio_capturer_linux.cc
index 5af0d4cf76b9685270258ac193596b6073e21ee2..73188dc15142dfdef20a650fcb612c3e57b22257 100644
--- a/remoting/host/audio_capturer_linux.cc
+++ b/remoting/host/audio_capturer_linux.cc
@@ -9,19 +9,17 @@
#include <sys/types.h>
#include <unistd.h>
-#include "base/command_line.h"
#include "base/eintr_wrapper.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "remoting/proto/audio.pb.h"
+#include "remoting/host/chromoting_host_context.h"
namespace remoting {
namespace {
-const char kAudioPipeOptionName[] = "audio-pipe-name";
-
// PulseAudio's module-pipe-sink must be configured to use the following
// parameters for the sink we read from.
const AudioPacket_SamplingRate kSamplingRate = AudioPacket::SAMPLING_RATE_44100;
@@ -175,14 +173,14 @@ void AudioCapturerLinux::WaitForPipeReadable() {
&file_descriptor_watcher_, this);
}
-bool AudioCapturer::IsSupported() {
- CommandLine* cl = CommandLine::ForCurrentProcess();
- return !cl->GetSwitchValuePath(kAudioPipeOptionName).empty();
+bool AudioCapturer::IsSupported(
+ ChromotingHostContext* context) {
+ return !context->audio_capturer_pipe().empty();
}
-scoped_ptr<AudioCapturer> AudioCapturer::Create() {
- CommandLine* cl = CommandLine::ForCurrentProcess();
- FilePath path = cl->GetSwitchValuePath(kAudioPipeOptionName);
+scoped_ptr<AudioCapturer> AudioCapturer::Create(
+ ChromotingHostContext* context) {
+ FilePath path = context->audio_capturer_pipe();
if (path.empty())
return scoped_ptr<AudioCapturer>();
return scoped_ptr<AudioCapturer>(new AudioCapturerLinux(path));

Powered by Google App Engine
This is Rietveld 408576698