音视频通讯SDK API参考手册  iOS 1.4.0
av_device_mgr.h
1 #ifndef AV_DEVICE_MGR_H_
2 #define AV_DEVICE_MGR_H_
3 
4 #include "av_common.h"
5 #include "av_device.h"
6 
7 namespace tencent {
8 namespace av {
9 
17 class AV_EXPORT AVDeviceMgr {
18  public:
19 
34  typedef void (*DeviceOperationCallback)(AVDeviceMgr* device_mgr, AVDevice::DeviceOperation oper, const std::string& device_id,
35  int32 result, void* custom_data);
36 
45  virtual void SetDeviceOperationCallback(DeviceOperationCallback device_operation_callback,
46  void* custom_data = NULL) = 0;
47 
56  typedef void (*DeviceChangeCallback)(AVDeviceMgr* device_mgr, void* custom_data);
57 
68  virtual void SetDeviceChangeCallback(DeviceChangeCallback device_change_callback, void* custom_data = NULL) = 0;
69 
82  typedef void (*OnDeviveDetectNotify)(AVDeviceMgr* device_mgr,DetectedDeviceInfo& info, bool*pbSelect, void* custom_data);
94  virtual void SetDeviceDetectNotify(OnDeviveDetectNotify notify, void* custom_data = NULL) = 0;
95 
96 
105  virtual void EnableInputDevice(bool is_enable = true) = 0;
106 
115  virtual void EnableOutputDevice(bool is_enable = true) = 0;
116 
122  virtual bool IsInputDeviceEnabled() = 0;
123 
129  virtual bool IsOutputDeviceEnabled() = 0;
130 
136  virtual int32 GetInputDeviceCount() = 0;
137 
145  virtual AVDevice* GetInputDevice(int32 index) = 0;
146 
152  virtual int32 GetOutputDeviceCount() = 0;
153 
161  virtual AVDevice* GetOutputDevice(int32 index) = 0;
162 
178  virtual int32 SelectInputDevice(const std::string& device_id, bool is_select = true) = 0;
179 
195  virtual int32 SelectOutputDevice(const std::string& device_id, bool is_select = true) = 0;
196 
202  virtual void ClearSelectedDevice(bool is_output) = 0;
203 
209  virtual int32 GetSelectedInputDeviceCount() = 0;
210 
218  virtual AVDevice* GetSelectedInputDevice(int32 index) = 0;
219 
225  virtual int32 GetSelectedOutputDeviceCount() = 0;
226 
234  virtual AVDevice* GetSelectedOutputDevice(int32 index) = 0;
235 
243  virtual AVDevice* GetDeviceById(const std::string& device_id) = 0;
244 
255  virtual int32 GetDeviceByType(const std::string& device_type, AVDevice** device_array[]) = 0;
256 
257  DISALLOW_EVIL_DESTRUCTIONS(AVDeviceMgr)
258 };
259 
260 } // namespace av
261 } // namespace tencent
262 
263 #endif // #ifndef AV_DEVICE_MGR_H_
Definition: av_audio_ctrl.h:6
Definition: av_common.h:190
音视频设备封装类的基类。
Definition: av_device_base.h:18
设备管理器的封装类。
Definition: av_device_mgr.h:17
DeviceOperation
设备操作类型。
Definition: av_device_base.h:21