Pepper_31_C++_interfaces
audio_input_dev.h
Go to the documentation of this file.
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 PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_
6 #define PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_
7 
8 #include <vector>
9 
10 #include "ppapi/c/dev/ppb_audio_input_dev.h"
11 #include "ppapi/cpp/audio_config.h"
12 #include "ppapi/cpp/completion_callback.h"
13 #include "ppapi/cpp/dev/device_ref_dev.h"
14 #include "ppapi/cpp/resource.h"
15 
16 namespace pp {
17 
18 class InstanceHandle;
19 
20 class AudioInput_Dev : public Resource {
21  public:
22  /// An empty constructor for an AudioInput resource.
24 
25  /// Constructor to create an audio input resource.
26  explicit AudioInput_Dev(const InstanceHandle& instance);
27 
28  virtual ~AudioInput_Dev();
29 
30  /// Static function for determining whether the browser supports the required
31  /// AudioInput interface.
32  ///
33  /// @return true if the interface is available, false otherwise.
34  static bool IsAvailable();
35 
37  const CompletionCallbackWithOutput<std::vector<DeviceRef_Dev> >&
38  callback);
39 
40  int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback,
41  void* user_data);
42 
43  /// If |device_ref| is null (i.e., is_null() returns true), the default device
44  /// will be used.
45  ///
46  /// Requires <code>PPB_AudioInput_Dev</code> version 0.4 or up.
47  int32_t Open(const DeviceRef_Dev& device_ref,
48  const AudioConfig& config,
49  PPB_AudioInput_Callback audio_input_callback,
50  void* user_data,
51  const CompletionCallback& callback);
52 
53  /// Requires <code>PPB_AudioInput_Dev</code> version 0.2 or 0.3.
54  int32_t Open(const DeviceRef_Dev& device_ref,
55  const AudioConfig& config,
56  PPB_AudioInput_Callback_0_2 audio_input_callback_0_2,
57  void* user_data,
58  const CompletionCallback& callback);
59 
60  bool StartCapture();
61  bool StopCapture();
62  void Close();
63 };
64 
65 } // namespace pp
66 
67 #endif // PPAPI_CPP_DEV_AUDIO_INPUT_DEV_H_
int32_t MonitorDeviceChange(PP_MonitorDeviceChangeCallback callback, void *user_data)
static bool IsAvailable()
AudioInput_Dev()
An empty constructor for an AudioInput resource.
int32_t Open(const DeviceRef_Dev &device_ref, const AudioConfig &config, PPB_AudioInput_Callback audio_input_callback, void *user_data, const CompletionCallback &callback)
int32_t EnumerateDevices(const CompletionCallbackWithOutput< std::vector< DeviceRef_Dev > > &callback)
virtual ~AudioInput_Dev()
A reference counted module resource.
Definition: resource.h:18