音视频通讯SDK API参考手册  Windows 1.6.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,
35  const std::string& device_id,
36  int32 result, void* custom_data);
37 
46  virtual void SetDeviceOperationCallback(DeviceOperationCallback device_operation_callback,
47  void* custom_data = NULL) = 0;
48 
57  typedef void (*DeviceChangeCallback)(AVDeviceMgr* device_mgr, void* custom_data);
58 
69  virtual void SetDeviceChangeCallback(DeviceChangeCallback device_change_callback, void* custom_data = NULL) = 0;
70 
83  typedef void (*OnDeviveDetectNotify)(AVDeviceMgr* device_mgr, DetectedDeviceInfo& info, bool*pbSelect,
84  void* custom_data);
97  virtual void SetDeviceDetectNotify(OnDeviveDetectNotify notify, void* custom_data = NULL) = 0;
98 
99 
108  virtual void EnableInputDevice(bool is_enable = true) = 0;
109 
118  virtual void EnableOutputDevice(bool is_enable = true) = 0;
119 
125  virtual bool IsInputDeviceEnabled() = 0;
126 
132  virtual bool IsOutputDeviceEnabled() = 0;
133 
139  virtual int32 GetInputDeviceCount() = 0;
140 
148  virtual AVDevice* GetInputDevice(int32 index) = 0;
149 
155  virtual int32 GetOutputDeviceCount() = 0;
156 
164  virtual AVDevice* GetOutputDevice(int32 index) = 0;
165 
181  virtual int32 SelectInputDevice(const std::string& device_id, bool is_select = true) = 0;
182 
198  virtual int32 SelectOutputDevice(const std::string& device_id, bool is_select = true) = 0;
199 
205  virtual void ClearSelectedDevice(bool is_output) = 0;
206 
212  virtual int32 GetSelectedInputDeviceCount() = 0;
213 
221  virtual AVDevice* GetSelectedInputDevice(int32 index) = 0;
222 
228  virtual int32 GetSelectedOutputDeviceCount() = 0;
229 
237  virtual AVDevice* GetSelectedOutputDevice(int32 index) = 0;
238 
246  virtual AVDevice* GetDeviceById(const std::string& device_id) = 0;
247 
258  virtual int32 GetDeviceByType(const std::string& device_type, AVDevice** device_array[]) = 0;
259 
260  DISALLOW_EVIL_DESTRUCTIONS(AVDeviceMgr)
261 };
262 
263 } // namespace av
264 } // namespace tencent
265 
266 #endif // #ifndef AV_DEVICE_MGR_H_
Definition: av_audio_ctrl.h:6
硬件检测信息。
Definition: av_common.h:248
音视频设备封装类的基类。
Definition: av_device_base.h:18
设备管理器的封装类。
Definition: av_device_mgr.h:17
DeviceOperation
设备操作类型。
Definition: av_device_base.h:21