音视频通讯SDK API参考手册  iOS 1.6.0
QAVCommon.h
1 //
2 // videoDef.h
3 // QAVSDK
4 //
5 // Created by xianhuanlin on 15/6/4.
6 // Copyright (c) 2015年 xianhuan. All rights reserved.
7 //
8 
9 #ifndef QAVSDK_videoDef_h
10 #define QAVSDK_videoDef_h
11 #import <Foundation/Foundation.h>
12 #import "QAVError.h"
13 
15 typedef NS_ENUM(NSInteger, avColorFormats){
16  AVCOLOR_FORMAT_I420 = 0,
17 };
18 
20 typedef NS_ENUM(NSInteger, avVideoSrcType){
21  QAVVIDEO_SRC_TYPE_NONE = 0,
22  QAVVIDEO_SRC_TYPE_CAMERA = 1,
23  QAVVIDEO_SRC_TYPE_SCREEN = 2,
24 };
25 
30 @interface QAVFrameDesc:NSObject{
31 
32 }
33 
34 //详情见avColorFormats的定义。
35 
36 @property(assign,nonatomic) UInt32 width;
37 @property(assign,nonatomic) UInt32 height;
38 
45 @property(assign,nonatomic)int rotate;
46 
47 @property(assign, nonatomic) avColorFormats color_format;
48 @property(assign,nonatomic)avVideoSrcType srcType;
49 @end
50 
52 @interface QAVVideoFrame : NSObject{
53 }
54 
55 @property(retain,nonatomic) QAVFrameDesc*frameDesc;
56 @property(copy, nonatomic) NSString*identifier;
57 @property(assign, nonatomic)UInt32 dataSize;
58 @property(assign,nonatomic) UInt8* data;
59 @property(assign, nonatomic)UInt64 roomID;
60 
61 @end
62 
66 @interface QAVCameraInfo:NSObject{
67 }
68 @property(copy, nonatomic) NSString *deviceID;
69 @property(assign, nonatomic)NSInteger width;
70 @property(assign, nonatomic)NSInteger height;
71 @property(assign, nonatomic)NSInteger fps;
72 
73 @end
74 
75 
76 
77 
78 
79 
83 typedef NS_ENUM(NSInteger, QAVAudioDataSourceType){
84  QAVAudioDataSource_Mic = 0,
85  QAVAudioDataSource_MixToSend = 1,
86  QAVAudioDataSource_Send = 2,
87  QAVAudioDataSource_MixToPlay = 3,
88  QAVAudioDataSource_Play = 4,
89  QAVAudioDataSource_NetStream = 5,
90  QAVAudioDataSource_End = 6,
91 };
92 
97  NSInteger SampleRate;
98  NSInteger ChannelNum;
99  NSInteger Bits;
100 };
101 
103 @interface QAVAudioFrame : NSObject{
104 
105 }
106 @property(copy, nonatomic)NSString*identifier;
107 @property(assign, nonatomic)struct QAVAudioFrameDesc desc;
108 @property(retain, nonatomic)NSData* buffer;
109 
110 @end
111 
112 
113 
115 typedef NS_ENUM(NSInteger, avRoomType){
116  ROOM_TYPE_PAIR = 1,
117  ROOM_TYPE_MULTI,
118 };
119 
121 typedef NS_ENUM(NSInteger, avRoomMode){
122  MODE_AUDIO = 0,
123  MODE_VIDEO = 1,
124 };
125 
127 typedef NS_ENUM(NSInteger, avAudioCategory){
128  CATEGORY_VOICECHAT = 0,
129  CATEGORY_MEDIA_PLAY_AND_RECORD = 1,
130  CATEGORY_MEDIA_PLAYBACK = 2,
131 };
132 
133 
135 typedef NS_ENUM(NSInteger, QAVOutputMode){
136  QAVOUTPUTMODE_EARPHONE = 0,
137  QAVOUTPUTMODE_SPEAKER,
138 };
139 
141 typedef NS_ENUM(NSInteger, QAVUpdateEvent){
142  QAV_EVENT_ID_NONE = 0,
143  QAV_EVENT_ID_ENDPOINT_ENTER = 1,
144  QAV_EVENT_ID_ENDPOINT_EXIT = 2,
145  QAV_EVENT_ID_ENDPOINT_HAS_CAMERA_VIDEO = 3,
146  QAV_EVENT_ID_ENDPOINT_NO_CAMERA_VIDEO = 4,
147  QAV_EVENT_ID_ENDPOINT_HAS_AUDIO = 5,
148  QAV_EVENT_ID_ENDPOINT_NO_AUDIO = 6,
149  QAV_EVENT_ID_ENDPOINT_HAS_SCREEN_VIDEO = 7,
150  QAV_EVENT_ID_ENDPOINT_NO_SCREEN_VIDEO = 8,
151 };
152 
153 
158 @interface QAVRoomParam: NSObject{
159 
160 }
161 @property(assign, nonatomic)avRoomType roomtype;
162 @end
163 
164 
165 
171 
172 }
173 @property(assign, nonatomic)avAudioCategory audioCategory;
174 @property(assign, nonatomic)UInt32 roomID;
175 
176 //advance property
177 @property(assign, nonatomic)UInt64 authBitMap;
178 @property(copy, nonatomic)NSData*authBuffer;
179 @property(copy, nonatomic)NSString*controlRole;
180 
181 @end
182 
183 //权限位
184 #define QAV_AUTH_BITS_DEFUALT 0xFFFFFFFFFFFFFFFF
185 #define QAV_AUTH_BITS_CREATE_ROOM 0x00000001
186 #define QAV_AUTH_BITS_JOIN_ROOM 0x00000002
187 #define QAV_AUTH_BITS_SEND_AUDIO 0x00000004
188 #define QAV_AUTH_BITS_RECV_AUDIO 0x00000008
189 #define QAV_AUTH_BITS_SEND_VIDEO 0x00000010
190 #define QAV_AUTH_BITS_RECV_VIDEO 0x00000020
191 #define QAV_AUTH_BITS_SEND_SUB 0x00000040
192 #define QAV_AUTH_BITS_RECV_SUB 0x00000080
193 
194 #endif
音频帧描述
Definition: QAVCommon.h:96
房间参数
Definition: QAVCommon.h:158
NSInteger SampleRate
采样率,单位:赫兹(Hz)。
Definition: QAVCommon.h:97
音频帧
Definition: QAVCommon.h:103
多人房间参数
Definition: QAVCommon.h:170
视频帧
Definition: QAVCommon.h:52
视频帧描述
Definition: QAVCommon.h:30
摄像头信息
Definition: QAVCommon.h:66
NSInteger Bits
音频的位宽,目前只能填16
Definition: QAVCommon.h:99
NSInteger ChannelNum
通道数,1表示单声道(mono),2表示立体声
Definition: QAVCommon.h:98