音视频通讯SDK API参考手册  iOS 1.4.0
av_common.h
1 #ifndef AV_COMMON_H_
2 #define AV_COMMON_H_
3 
4 #include "build_config.h"
5 #include "basictypes.h"
6 #include "av_error.h"
7 #include "av_export.h"
8 #include <string>
9 #include <vector>
10 
11 #ifdef WIN32
12 #include <windows.h>
13 #endif
14 
15 namespace tencent {
16 namespace av {
17 
19 //
20 // 通用的,未分类的由此开始
21 
31 typedef void (*AVClosure)(void* custom_data);
32 
33 
35 //
36 // AVContext相关的由此开始
37 
38 
39 
41 //
42 // AVRoom相关的由此开始
43 
57 };
58 
60 //
61 // 音频相关的由此开始
62 
66  //AUDIO_SRC_TYPE_MIC = 1, ///< 麦克风。
67  //AUDIO_SRC_TYPE_ACCOMPANY = 2, ///< 伴奏。
68  //AUDIO_SRC_TYPE_MIX_INPUT = 3, ///< 混音输入。
69  //AUDIO_SRC_TYPE_MIX_OUTPUT = 4, ///< 混音输出。
70 };
71 
79  : sample_rate(0)
80  , channel_num(0)
82 
83  uint32 sample_rate;
84  uint32 channel_num;
85  int32 src_type;
86 };
87 
89 struct AudioFrame {
91  : data_size(0)
92  , data(NULL) {}
93 
94  std::string identifier;
96  uint32 data_size;
97  uint8* data;
98 };
99 
100 
102 //
103 // 视频相关的由此开始
104 
108 // COLOR_FORMAT_NV21 = 1,
109 // COLOR_FORMAT_YV12 = 2,
110 #ifdef TARGET_OS_IPHONE
112 #endif
113 // COLOR_FORMAT_UYVY = 4,
114 // COLOR_FORMAT_YUYV = 5,
115 // COLOR_FORMAT_YUY2 = 6,
116 // COLOR_FORMAT_RGB16 = 7,
118 // COLOR_FORMAT_RGB32 = 9,
119 };
120 
125 };
126 
136  , width(0)
137  , height(0)
138  , rotate(0)
140 
142  uint32 width;
143  uint32 height;
144 
151  int32 rotate;
152 
154 };
155 
157 struct VideoFrame {
159  : data_size(0)
160  , data(NULL) {}
161 
162  std::string identifier;
164  uint32 data_size;
165  uint8* data;
166 };
167 
169 typedef enum VideoChannelType {
172 
173 
181 };
182 
183 typedef enum
184 {
187 // Detect_Camera, //not supported now
189 
190 typedef struct{
192  std::string strName;
193  std::string strGuid;
195  bool isNewDevice;
197 
198 } // namespace av
199 } // namespace tencent
200 
201 #endif // #ifndef AV_COMMON_H_
Definition: av_audio_ctrl.h:6
摄像头。
Definition: av_common.h:124
QQ好友。
Definition: av_common.h:54
4G
Definition: av_common.h:180
NetStateType
Definition: av_common.h:174
VideoSrcType
视频源类型。
Definition: av_common.h:122
音频帧描述。
Definition: av_common.h:77
AudioFrameDesc()
Definition: av_common.h:78
QQ群。
Definition: av_common.h:52
DetectedDeviceType
Definition: av_common.h:183
默认值,无意义。
Definition: av_common.h:51
std::string identifier
音频帧所属的房间成员id。
Definition: av_common.h:94
AudioFrameDesc desc
音频帧描述。
Definition: av_common.h:95
uint32 sample_rate
采样率,单位:赫兹(Hz)。
Definition: av_common.h:83
uint32 data_size
视频帧的数据缓冲区大小,单位:字节。
Definition: av_common.h:96
VideoFrameDesc()
Definition: av_common.h:134
ColorFormat
色彩格式。
Definition: av_common.h:106
音频帧。
Definition: av_common.h:89
uint32 channel_num
通道数,1表示单声道(mono),2表示立体声(stereo)。
Definition: av_common.h:84
bool isUsedDevice
设备GUID。
Definition: av_common.h:194
uint32 width
宽度,单位:像素。
Definition: av_common.h:142
AudioSrcType
音频源类型。
Definition: av_common.h:64
Definition: av_common.h:107
QQ临时会话。
Definition: av_common.h:55
AudioFrame()
Definition: av_common.h:90
VideoFrame()
Definition: av_common.h:158
音视频开放SDK,第三方App专用。
Definition: av_common.h:56
WIFI.
Definition: av_common.h:177
视频帧。
Definition: av_common.h:157
Definition: av_common.h:190
no network.
Definition: av_common.h:175
2G
Definition: av_common.h:179
VideoSrcType src_type
视频源类型,详情见VideoSrcType的定义。
Definition: av_common.h:153
LINE.
Definition: av_common.h:176
uint32 data_size
视频帧的数据缓冲区大小,单位:字节。
Definition: av_common.h:164
Definition: av_common.h:185
视频帧描述。
Definition: av_common.h:133
int32 rotate
Definition: av_common.h:151
QQ讨论组。
Definition: av_common.h:53
std::string identifier
视频帧所属的房间成员id。
Definition: av_common.h:162
void(* AVClosure)(void *custom_data)
参数类型为void*的通用回调函数。
Definition: av_common.h:31
Definition: av_common.h:111
主路视频。
Definition: av_common.h:170
DetectedDeviceType flow
Definition: av_common.h:191
std::string strName
Definition: av_common.h:192
int32 src_type
音频源类型。
Definition: av_common.h:85
扬声器
Definition: av_common.h:186
std::string strGuid
设备名称。
Definition: av_common.h:193
ColorFormat color_format
色彩格式,详情见ColorFormat的定义。
Definition: av_common.h:141
bool isNewDevice
仅对拔出设备时有效,代表拔出的是使用中的设备。
Definition: av_common.h:195
默认值,无意义。
Definition: av_common.h:123
uint8 * data
视频帧的数据缓冲区,SDK内部会管理缓冲区的分配和释放。
Definition: av_common.h:97
uint8 * data
视频帧的数据缓冲区,SDK内部会管理缓冲区的分配和释放。
Definition: av_common.h:165
3G
Definition: av_common.h:178
RelationType
关系类型。
Definition: av_common.h:50
默认值,无意义。
Definition: av_common.h:65
Definition: av_common.h:117
VideoFrameDesc desc
视频帧描述。
Definition: av_common.h:163
uint32 height
高度,单位:像素。
Definition: av_common.h:143
VideoChannelType
视频通道类型。
Definition: av_common.h:169