Infer appropriate GNU_STACK alignment for a shared library.
[chromium-blink-merge.git] / remoting / host / ipc_audio_capturer.h
blobd0bdbe3fc7b4772bf329f5349cb60519a7367f98
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.
5 #ifndef REMOTING_HOST_IPC_AUDIO_CAPTURER_H_
6 #define REMOTING_HOST_IPC_AUDIO_CAPTURER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "remoting/host/audio_capturer.h"
14 namespace remoting {
16 class AudioPacket;
17 class DesktopSessionProxy;
19 class IpcAudioCapturer : public AudioCapturer {
20 public:
21 explicit IpcAudioCapturer(
22 scoped_refptr<DesktopSessionProxy> desktop_session_proxy);
23 ~IpcAudioCapturer() override;
25 // AudioCapturer interface.
26 bool Start(const PacketCapturedCallback& callback) override;
27 void Stop() override;
28 bool IsStarted() override;
30 // Called by DesktopSessionProxy when an audio packet is received.
31 void OnAudioPacket(scoped_ptr<AudioPacket> packet);
33 private:
34 // Invoked when an audio packet was received.
35 PacketCapturedCallback callback_;
37 // Wraps the IPC channel to the desktop session agent.
38 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_;
40 // Used to cancel tasks pending on the capturer when it is stopped.
41 base::WeakPtrFactory<IpcAudioCapturer> weak_factory_;
43 DISALLOW_COPY_AND_ASSIGN(IpcAudioCapturer);
46 } // namespace remoting
48 #endif // REMOTING_HOST_IPC_AUDIO_CAPTURER_H_