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

Unified Diff: remoting/host/audio_capturer_linux.h

Issue 10907041: Implement Linux audio capturer. (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
« no previous file with comments | « no previous file | remoting/host/audio_capturer_linux.cc » ('j') | remoting/host/audio_capturer_linux.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/audio_capturer_linux.h
diff --git a/remoting/host/audio_capturer_linux.h b/remoting/host/audio_capturer_linux.h
new file mode 100644
index 0000000000000000000000000000000000000000..4572e6ac65cd1a0fd1469f9df7e8a09305612db7
--- /dev/null
+++ b/remoting/host/audio_capturer_linux.h
@@ -0,0 +1,56 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
+#define REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
+
+#include "remoting/host/audio_capturer.h"
+
+#include "base/message_loop.h"
+#include "base/time.h"
+#include "base/timer.h"
+
+class FilePath;
+
+namespace remoting {
+
+class AudioCapturerLinux : public AudioCapturer,
+ public MessageLoopForIO::Watcher {
+ public:
+ explicit AudioCapturerLinux(const FilePath& pipe_name);
+ virtual ~AudioCapturerLinux();
+
+ // AudioCapturer interface.
+ virtual bool Start(const PacketCapturedCallback& callback) OVERRIDE;
+ virtual void Stop() OVERRIDE;
+ virtual bool IsRunning() OVERRIDE;
Wez 2012/09/06 21:47:29 nit: IsStarted()
Sergey Ulanov 2012/09/06 23:18:53 Done
+
+ // MessageLoopForIO::Watcher interface.
+ virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
+ virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
+
+ private:
+ void StartTimer();
+ void DoCapture();
+ void Sleep();
+
+ int pipe_fd_;
+ base::RepeatingTimer<AudioCapturerLinux> timer_;
+ PacketCapturedCallback callback_;
+
+ // Time when capturing was started.
+ base::TimeTicks started_time_;
+
+ // Time of the last capture measured in samples relative to the beginning of
+ // the stream.
+ int64 last_capture_time_samples_;
Wez 2012/09/06 21:47:29 Express this simply as the stream position of the
Sergey Ulanov 2012/09/06 23:18:53 Done
+
+ MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
+
+ DISALLOW_COPY_AND_ASSIGN(AudioCapturerLinux);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
« no previous file with comments | « no previous file | remoting/host/audio_capturer_linux.cc » ('j') | remoting/host/audio_capturer_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698