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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/host/audio_capturer.h ('k') | remoting/host/audio_capturer_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
6 #define REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
7
8 #include "remoting/host/audio_capturer.h"
9
10 #include "base/message_loop.h"
11 #include "base/time.h"
12 #include "base/timer.h"
13
14 class FilePath;
15
16 namespace remoting {
17
18 class AudioCapturerLinux : public AudioCapturer,
19 public MessageLoopForIO::Watcher {
20 public:
21 explicit AudioCapturerLinux(const FilePath& pipe_name);
22 virtual ~AudioCapturerLinux();
23
24 // AudioCapturer interface.
25 virtual bool Start(const PacketCapturedCallback& callback) OVERRIDE;
26 virtual void Stop() OVERRIDE;
27 virtual bool IsStarted() OVERRIDE;
28
29 // MessageLoopForIO::Watcher interface.
30 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE;
31 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE;
32
33 private:
34 void StartTimer();
35 void DoCapture();
36 void WaitForPipeReadable();
37
38 int pipe_fd_;
39 base::RepeatingTimer<AudioCapturerLinux> timer_;
40 PacketCapturedCallback callback_;
41
42 // Time when capturing was started.
43 base::TimeTicks started_time_;
44
45 // Stream position of the last capture.
46 int64 last_capture_samples_;
47
48 // Bytes left from the previous read.
49 std::string left_over_bytes_;
50
51 MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_;
52
53 DISALLOW_COPY_AND_ASSIGN(AudioCapturerLinux);
54 };
55
56 } // namespace remoting
57
58 #endif // REMOTING_HOST_AUDIO_CAPTURER_LINUX_H_
OLDNEW
« no previous file with comments | « remoting/host/audio_capturer.h ('k') | remoting/host/audio_capturer_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698