音视频通讯SDK API参考手册  Windows 1.6.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 
70  //AUDIO_SRC_TYPE_MIC = 1, ///< 麦克风。
71  //AUDIO_SRC_TYPE_ACCOMPANY = 2, ///< 伴奏。
72  //AUDIO_SRC_TYPE_MIX_INPUT = 3, ///< 混音输入。
73  //AUDIO_SRC_TYPE_MIX_OUTPUT = 4, ///< 混音输出。
74 };
75 
83  : sample_rate(0)
84  , channel_num(0)
86 
87  uint32 sample_rate;
88  uint32 channel_num;
89  uint32 bits;
90  int32 src_type;
91 };
92 
98 struct AudioFrame {
100  : data_size(0)
101  , data(NULL) {}
102 
103  std::string identifier;
105  uint32 data_size;
106  uint8* data;
107 };
108 
109 
111 //
112 // 视频相关的由此开始
113 
122 //COLOR_FORMAT_NV21 = 1,
123 //COLOR_FORMAT_YV12 = 2,
124 #ifdef TARGET_OS_IPHONE
125  COLOR_FORMAT_NV12 = 3,
126 #endif
127 //COLOR_FORMAT_UYVY = 4,
128 //COLOR_FORMAT_YUYV = 5,
129 //COLOR_FORMAT_YUY2 = 6,
130 //COLOR_FORMAT_RGB16 = 7,
132 //COLOR_FORMAT_RGB32 = 9,
133 };
134 
144 };
145 
146 
155 };
156 
162 typedef struct View {
166  {}
167 
170 }View;
171 
182  , width(0)
183  , height(0)
184  , rotate(0)
186 
188  uint32 width;
189  uint32 height;
190 
197  int32 rotate;
198 
200 };
201 
207 struct VideoFrame {
209  : data_size(0)
210  , data(NULL) {}
211 
212  std::string identifier;
214  uint32 data_size;
215  uint8* data;
216 };
217 
230 };
231 
237 typedef enum {
240 //Detect_Camera,
242 
248 typedef struct {
250  std::string strName;
251  std::string strGuid;
253  bool isNewDevice;
255 
256 } // namespace av
257 } // namespace tencent
258 
259 #endif // #ifndef AV_COMMON_H_
Definition: av_audio_ctrl.h:6
摄像头。
Definition: av_common.h:142
QQ好友。
Definition: av_common.h:54
4G
Definition: av_common.h:229
NetStateType
网络连接类型。
Definition: av_common.h:223
VideoSrcType
视频源类型。
Definition: av_common.h:140
音频数据帧格式。
Definition: av_common.h:81
AudioFrameDesc()
Definition: av_common.h:82
无意义
Definition: av_common.h:120
QQ群。
Definition: av_common.h:52
DetectedDeviceType
硬件检测类型。
Definition: av_common.h:237
默认值,无意义。
Definition: av_common.h:51
std::string identifier
音频帧所属的房间成员id。
Definition: av_common.h:103
AudioFrameDesc desc
音频帧描述。
Definition: av_common.h:104
uint32 sample_rate
采样率,单位:赫兹(Hz)。
Definition: av_common.h:87
uint32 data_size
视频帧的数据缓冲区大小,单位:字节。
Definition: av_common.h:105
VideoFrameDesc()
Definition: av_common.h:180
ColorFormat
色彩格式。
Definition: av_common.h:119
音频数据帧。
Definition: av_common.h:98
uint32 channel_num
通道数,1表示单声道(mono),2表示立体声(stereo)。
Definition: av_common.h:88
bool isUsedDevice
仅对拔出设备时有效,代表拔出的是使用中的设备。
Definition: av_common.h:252
uint32 width
宽度,单位:像素。
Definition: av_common.h:188
AudioSrcType
音频源类型。
Definition: av_common.h:68
i420格式
Definition: av_common.h:121
QQ临时会话。
Definition: av_common.h:55
AudioFrame()
Definition: av_common.h:99
大画面,分辨率包含320x240、480x360、640x480、800x600、720P、1080P。
Definition: av_common.h:154
VideoFrame()
Definition: av_common.h:208
音视频开放SDK,第三方App专用。
Definition: av_common.h:56
WIFI.
Definition: av_common.h:226
视频帧。
Definition: av_common.h:207
硬件检测信息。
Definition: av_common.h:248
无连接.
Definition: av_common.h:224
2G
Definition: av_common.h:228
View()
Definition: av_common.h:163
VideoSrcType src_type
视频源类型,详情见VideoSrcType的定义。
Definition: av_common.h:199
LINE.
Definition: av_common.h:225
uint32 data_size
视频帧的数据缓冲区大小,单位:字节。
Definition: av_common.h:214
视频画面参数。
Definition: av_common.h:162
检测到扬声器
Definition: av_common.h:238
视频帧描述。
Definition: av_common.h:179
int32 rotate
Definition: av_common.h:197
QQ讨论组。
Definition: av_common.h:53
std::string identifier
视频帧所属的房间成员id。
Definition: av_common.h:212
void(* AVClosure)(void *custom_data)
参数类型为void*的通用回调函数。
Definition: av_common.h:31
小画面,分辨率包含192x144、160x120。
Definition: av_common.h:153
DetectedDeviceType flow
硬件检测类型
Definition: av_common.h:249
VideoSrcType video_src_type
视频源类型,详情见VideoSrcType的定义。
Definition: av_common.h:168
std::string strName
设备名称。
Definition: av_common.h:250
int32 src_type
音频源类型。
Definition: av_common.h:90
检测到麦克风
Definition: av_common.h:239
ViewSizeType
画面大小。
Definition: av_common.h:152
std::string strGuid
设备GUID。
Definition: av_common.h:251
ColorFormat color_format
色彩格式,详情见ColorFormat的定义。
Definition: av_common.h:187
bool isNewDevice
true: 新启用设备,false: 拔出或禁用设备。
Definition: av_common.h:253
默认值,无意义。
Definition: av_common.h:141
uint8 * data
视频帧的数据缓冲区,SDK内部会管理缓冲区的分配和释放。
Definition: av_common.h:106
ViewSizeType size_type
画面大小,详情见ViewSizeType的定义。
Definition: av_common.h:169
uint8 * data
视频帧的数据缓冲区,SDK内部会管理缓冲区的分配和释放。
Definition: av_common.h:215
3G
Definition: av_common.h:227
uint32 bits
音频数据位宽。SDK1.6版本暂固定为16。
Definition: av_common.h:89
struct tencent::av::View View
视频画面参数。
RelationType
关系类型。
Definition: av_common.h:50
默认值,无意义。
Definition: av_common.h:69
rgb24格式
Definition: av_common.h:131
屏幕。
Definition: av_common.h:143
VideoFrameDesc desc
视频帧描述。
Definition: av_common.h:213
uint32 height
高度,单位:像素。
Definition: av_common.h:189