音视频通讯SDK API参考手册  iOS 1.4.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  int32 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 
179  virtual int32 EnterRoom(AVRoom::Delegate* room_delegate, const AVRoom::EnterRoomParam* param) = 0;
180 
192  virtual int32 ExitRoom() = 0;
193 
201  virtual AVRoom* GetRoom() const = 0;
202 
210  virtual AVAudioCtrl* GetAudioCtrl() = 0;
211 
219  virtual AVDeviceMgr* GetAudioDeviceMgr() = 0;
220 
233  virtual AVVideoCtrl* GetVideoCtrl(VideoChannelType channel = VIDEO_CHANNEL_MAIN) = 0;
234 
244  virtual AVDeviceMgr* GetVideoDeviceMgr(VideoChannelType channel = VIDEO_CHANNEL_MAIN) = 0;
245 
246 #ifdef WIN32
247 
270  virtual int32 StartDeviceTest(StartCompleteCallback start_complete_callback, void* custom_data = NULL) = 0;
271 
287  virtual int32 StopDeviceTest(AVClosure stop_complete_callback, void* custom_data = NULL) = 0;
288 
298  virtual AVDeviceTest* GetDeviceTest() = 0;
299 #endif
300 };
301 
302 } // namespace av
303 } // namespace tencent
304 
305 #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
房间委托的抽象基类,App需要实现其成员函数来得到房间异步操作的执行结果。
Definition: av_room.h:64
int32 sdk_app_id
腾讯为每个使用SDK的App分配的AppId。
Definition: av_context.h:63
Definition: av_video_ctrl.h:24
进入房间所需参数的基类,SDK内部会根据room_type的取值来判断对象的实际类型。
Definition: av_room.h:114
void(* AVClosure)(void *custom_data)
参数类型为void*的通用回调函数。
Definition: av_common.h:31
主路视频。
Definition: av_common.h:170
音视频房间封装类的基类。
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
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:15
设备管理器的封装类。
Definition: av_device_mgr.h:17
Config()
默认构造函数。
Definition: av_context.h:46
VideoChannelType
视频通道类型。
Definition: av_common.h:169
CreateContext()的入参。
Definition: av_context.h:44