音视频通讯SDK API参考手册  Windows 1.6.0
av_context.h
1 #ifndef AV_CONTEXT_H_
2 #define AV_CONTEXT_H_
3 
4 #include "av_common.h"
5 #include "av_room.h"
6 #include "av_device_mgr.h"
7 #include "av_audio_ctrl.h"
8 #include "av_video_ctrl.h"
9 #ifdef WIN32
10 #include "av_device_test.h"
11 #endif
12 namespace tencent {
13 namespace av {
14 
21 class AV_EXPORT AVContext {
22  public:
23  virtual ~AVContext() {}
24 
37  static std::string GetSDKVersion();
38 
44  struct Config {
46  Config() {
47  sdk_app_id = 0;
48  account_type = "";
49  app_id_at3rd = "";
50  identifier = "";
51  }
52 
54  Config(const Config& other) {
55  sdk_app_id = other.sdk_app_id;
56  account_type = other.account_type;
57  app_id_at3rd = other.app_id_at3rd;
58  identifier = other.identifier;
59  }
60 
61  virtual ~Config() {}
62 
63  uint32 sdk_app_id;
64  std::string account_type;
65  std::string app_id_at3rd;
66  std::string identifier;
67  };
68 
83  static AVContext* CreateContext(const AVContext::Config& config);
84 
92  static void DestroyContext(AVContext* context);
93 
104  typedef void (*StartCompleteCallback)(int32 result, void* custom_data);
105 
130  virtual int32 StartContext(StartCompleteCallback start_complete_callback, void* custom_data = NULL) = 0;
131 
150  virtual int32 StopContext(AVClosure stop_complete_callback, void* custom_data = NULL) = 0;
151 
177  virtual int32 EnterRoom(AVRoom::Delegate* room_delegate, const AVRoom::EnterRoomParam* param) = 0;
178 
190  virtual int32 ExitRoom() = 0;
191 
199  virtual AVRoom* GetRoom() const = 0;
200 
208  virtual AVAudioCtrl* GetAudioCtrl() = 0;
209 
217  virtual AVDeviceMgr* GetAudioDeviceMgr() = 0;
218 
226  virtual AVVideoCtrl* GetVideoCtrl() = 0;
227 
235  virtual AVDeviceMgr* GetVideoDeviceMgr() = 0;
236 
237 #ifdef WIN32
238 
261  virtual int32 StartDeviceTest(StartCompleteCallback start_complete_callback, void* custom_data = NULL) = 0;
262 
278  virtual int32 StopDeviceTest(AVClosure stop_complete_callback, void* custom_data = NULL) = 0;
279 
289  virtual AVDeviceTest* GetDeviceTest() = 0;
290 #endif
291 
292 #if defined(ANDROID) || defined(TARGET_OS_IPHONE)
293  virtual void InitNetType(int netType) = 0;
294 #endif
295 
296 };
297 
298 } // namespace av
299 } // namespace tencent
300 
301 #endif // #ifndef AV_CONTEXT_H_
Definition: av_audio_ctrl.h:6
std::string identifier
帐号名(用户名)。
Definition: av_context.h:66
virtual ~Config()
Definition: av_context.h:61
设备测试的封装类。
Definition: av_device_test.h:15
房间委托的抽象基类,App需要实现其成员函数来得到房间异步操作的执行结果。
Definition: av_room.h:66
视频控制器的封装类。
Definition: av_video_ctrl.h:39
进入房间所需参数的基类,SDK内部会根据room_type的取值来判断对象的实际类型。
Definition: av_room.h:116
void(* AVClosure)(void *custom_data)
参数类型为void*的通用回调函数。
Definition: av_common.h:31
音视频房间封装类的基类。
Definition: av_room.h:29
std::string app_id_at3rd
App使用的OAuth授权体系分配的AppId。
Definition: av_context.h:65
std::string account_type
腾讯为每个接入方分配的账号类型。
Definition: av_context.h:64
uint32 sdk_app_id
腾讯为每个使用SDK的App分配的AppId。
Definition: av_context.h:63
virtual ~AVContext()
Definition: av_context.h:23
AVContext对象代表着一个SDK运行实例。
Definition: av_context.h:21
Config(const Config &other)
拷贝构造函数。
Definition: av_context.h:54
音频控制器的封装类。
Definition: av_audio_ctrl.h:25
设备管理器的封装类。
Definition: av_device_mgr.h:17
Config()
默认构造函数。
Definition: av_context.h:46
CreateContext()的入参。
Definition: av_context.h:44