OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ | 5 #ifndef PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ |
6 #define PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ | 6 #define PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ |
7 | 7 |
8 #include "ppapi/c/dev/ppb_audio_input_dev.h" | 8 #include "ppapi/c/dev/ppb_audio_input_dev.h" |
9 #include "ppapi/cpp/audio_config.h" | 9 #include "ppapi/cpp/audio_config.h" |
10 #include "ppapi/cpp/resource.h" | 10 #include "ppapi/cpp/resource.h" |
11 | 11 |
12 namespace pp { | 12 namespace pp { |
13 | 13 |
14 class Instance; | 14 class Instance; |
15 | 15 |
16 class AudioInput_Dev : public Resource { | 16 class AudioInput_Dev : public Resource { |
17 public: | 17 public: |
18 /// An empty constructor for an AudioInput resource. | 18 /// An empty constructor for an AudioInput resource. |
19 AudioInput_Dev() {} | 19 AudioInput_Dev() {} |
20 | 20 |
21 AudioInput_Dev(Instance* instance, | 21 AudioInput_Dev(Instance* instance, |
22 const AudioConfig& config, | 22 const AudioConfig& config, |
23 PPB_AudioInput_Callback callback, | 23 PPB_AudioInput_Callback callback, |
24 void* user_data); | 24 void* user_data); |
25 | 25 |
| 26 /// Static function for determining whether the browser supports the required |
| 27 /// AudioInput interface. |
| 28 /// |
| 29 /// @return true if the interface is available, false otherwise. |
| 30 static bool IsAvailable(); |
| 31 |
26 /// Getter function for returning the internal <code>PPB_AudioConfig</code> | 32 /// Getter function for returning the internal <code>PPB_AudioConfig</code> |
27 /// struct. | 33 /// struct. |
28 /// | 34 /// |
29 /// @return A mutable reference to the PPB_AudioConfig struct. | 35 /// @return A mutable reference to the PPB_AudioConfig struct. |
30 AudioConfig& config() { return config_; } | 36 AudioConfig& config() { return config_; } |
31 | 37 |
32 /// Getter function for returning the internal <code>PPB_AudioConfig</code> | 38 /// Getter function for returning the internal <code>PPB_AudioConfig</code> |
33 /// struct. | 39 /// struct. |
34 /// | 40 /// |
35 /// @return A const reference to the internal <code>PPB_AudioConfig</code> | 41 /// @return A const reference to the internal <code>PPB_AudioConfig</code> |
36 /// struct. | 42 /// struct. |
37 const AudioConfig& config() const { return config_; } | 43 const AudioConfig& config() const { return config_; } |
38 | 44 |
39 bool StartCapture(); | 45 bool StartCapture(); |
40 bool StopCapture(); | 46 bool StopCapture(); |
41 | 47 |
42 private: | 48 private: |
43 AudioConfig config_; | 49 AudioConfig config_; |
44 }; | 50 }; |
45 | 51 |
46 } // namespace pp | 52 } // namespace pp |
47 | 53 |
48 #endif // PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ | 54 #endif // PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_ |
OLD | NEW |