OLD | NEW |
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 #ifndef MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ | 5 #ifndef MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ |
6 #define MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ | 6 #define MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ |
7 | 7 |
8 #include <SLES/OpenSLES.h> | 8 #include <SLES/OpenSLES.h> |
9 #include <SLES/OpenSLES_Android.h> | 9 #include <SLES/OpenSLES_Android.h> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 class OpenSLESInputStream : public AudioInputStream { | 27 class OpenSLESInputStream : public AudioInputStream { |
28 public: | 28 public: |
29 static const int kMaxNumOfBuffersInQueue = 2; | 29 static const int kMaxNumOfBuffersInQueue = 2; |
30 | 30 |
31 OpenSLESInputStream(AudioManagerAndroid* manager, | 31 OpenSLESInputStream(AudioManagerAndroid* manager, |
32 const AudioParameters& params); | 32 const AudioParameters& params); |
33 | 33 |
34 virtual ~OpenSLESInputStream(); | 34 virtual ~OpenSLESInputStream(); |
35 | 35 |
36 // Implementation of AudioInputStream. | 36 // Implementation of AudioInputStream. |
37 virtual bool Open() OVERRIDE; | 37 virtual bool Open() override; |
38 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 38 virtual void Start(AudioInputCallback* callback) override; |
39 virtual void Stop() OVERRIDE; | 39 virtual void Stop() override; |
40 virtual void Close() OVERRIDE; | 40 virtual void Close() override; |
41 virtual double GetMaxVolume() OVERRIDE; | 41 virtual double GetMaxVolume() override; |
42 virtual void SetVolume(double volume) OVERRIDE; | 42 virtual void SetVolume(double volume) override; |
43 virtual double GetVolume() OVERRIDE; | 43 virtual double GetVolume() override; |
44 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE; | 44 virtual void SetAutomaticGainControl(bool enabled) override; |
45 virtual bool GetAutomaticGainControl() OVERRIDE; | 45 virtual bool GetAutomaticGainControl() override; |
46 | 46 |
47 private: | 47 private: |
48 bool CreateRecorder(); | 48 bool CreateRecorder(); |
49 | 49 |
50 // Called from OpenSLES specific audio worker thread. | 50 // Called from OpenSLES specific audio worker thread. |
51 static void SimpleBufferQueueCallback( | 51 static void SimpleBufferQueueCallback( |
52 SLAndroidSimpleBufferQueueItf buffer_queue, | 52 SLAndroidSimpleBufferQueueItf buffer_queue, |
53 void* instance); | 53 void* instance); |
54 | 54 |
55 // Called from OpenSLES specific audio worker thread. | 55 // Called from OpenSLES specific audio worker thread. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool started_; | 96 bool started_; |
97 | 97 |
98 scoped_ptr<media::AudioBus> audio_bus_; | 98 scoped_ptr<media::AudioBus> audio_bus_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(OpenSLESInputStream); | 100 DISALLOW_COPY_AND_ASSIGN(OpenSLESInputStream); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace media | 103 } // namespace media |
104 | 104 |
105 #endif // MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ | 105 #endif // MEDIA_AUDIO_ANDROID_OPENSLES_INPUT_H_ |
OLD | NEW |