@tencent-rtc/mcp 1.2.7 → 1.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/resource/doc/native_live/android/V2TXLiveCode_api_android.md +312 -0
- package/resource/doc/native_live/android/V2TXLiveDef_api_android.md +430 -0
- package/resource/doc/native_live/android/V2TXLivePlayerObserver_api_android.md +679 -0
- package/resource/doc/native_live/android/V2TXLivePlayer_api_android.md +671 -0
- package/resource/doc/native_live/android/V2TXLivePremier_api_android.md +271 -0
- package/resource/doc/native_live/android/V2TXLivePusherObserver_api_android.md +849 -0
- package/resource/doc/native_live/android/V2TXLivePusher_api_android.md +1046 -0
- package/resource/doc/native_live/flutter/V2TXLiveCode_api_flutter.md +460 -0
- package/resource/doc/native_live/flutter/V2TXLiveDef_api_flutter.md +558 -0
- package/resource/doc/native_live/flutter/V2TXLivePlayerObserver_api_flutter.md +865 -0
- package/resource/doc/native_live/flutter/V2TXLivePlayer_api_flutter.md +657 -0
- package/resource/doc/native_live/flutter/V2TXLivePremier_api_flutter.md +437 -0
- package/resource/doc/native_live/flutter/V2TXLivePusherObserver_api_flutter.md +335 -0
- package/resource/doc/native_live/flutter/V2TXLivePusher_api_flutter.md +748 -0
- package/resource/doc/native_live/iOS/V2TXLiveCode_api_iOS.md +327 -0
- package/resource/doc/native_live/iOS/V2TXLiveDef_api_iOS.md +507 -0
- package/resource/doc/native_live/iOS/V2TXLivePlayerObserver_api_iOS.md +507 -0
- package/resource/doc/native_live/iOS/V2TXLivePlayer_api_iOS.md +659 -0
- package/resource/doc/native_live/iOS/V2TXLivePremier_api_iOS.md +284 -0
- package/resource/doc/native_live/iOS/V2TXLivePusherObserver_api_iOS.md +814 -0
- package/resource/doc/native_live/iOS/V2TXLivePusher_api_iOS.md +1000 -0
- package/tools/common/get-faq.js +1 -1
- package/tools/common/get-faq.js.map +1 -1
- package/tools/definitions/get_native_live_api_def.js +23 -0
- package/tools/definitions/get_native_live_api_def.js.map +1 -0
- package/tools/index.js +4 -0
- package/tools/index.js.map +1 -1
- package/tools/native_live/get-native-live-api.js +31 -0
- package/tools/native_live/get-native-live-api.js.map +1 -0
- package/utils/report-cls-client.js +1 -1
- package/utils/report-es-client.js +1 -1
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
# Tencent Cloud Live Streaming SDK V2TXLiveDef Type Definition Documentation
|
|
2
|
+
|
|
3
|
+
## Feature Overview
|
|
4
|
+
|
|
5
|
+
`V2TXLiveDef.h` is the primary type definition file for the Tencent Cloud Live Streaming SDK on iOS and macOS. It provides all enumerations, constants, and data structures required for live stream publishing and playback.
|
|
6
|
+
|
|
7
|
+
**Platform Support**: iOS, macOS
|
|
8
|
+
**Type Coverage**: Includes video, audio, statistics, configuration, and more
|
|
9
|
+
|
|
10
|
+
## 📋 Table of Contents
|
|
11
|
+
|
|
12
|
+
### 1. [Supported Protocols](#supported-protocols)
|
|
13
|
+
### 2. [Video Types](#video-types)
|
|
14
|
+
### 3. [Audio Types](#audio-types)
|
|
15
|
+
### 4. [Statistics Data](#statistics-data)
|
|
16
|
+
### 5. [Connection Status](#connection-status)
|
|
17
|
+
### 6. [Cloud Stream Mixing Configuration](#cloud-stream-mixing-configuration)
|
|
18
|
+
### 7. [Local Recording Configuration](#local-recording-configuration)
|
|
19
|
+
### 8. [Log Configuration](#log-configuration)
|
|
20
|
+
### 9. [Other Configuration](#other-configuration)
|
|
21
|
+
|
|
22
|
+
## 1. Supported Protocols
|
|
23
|
+
|
|
24
|
+
### V2TXLiveMode - Supported Protocols for Stream Publishing
|
|
25
|
+
```objc
|
|
26
|
+
typedef NS_ENUM(NSUInteger, V2TXLiveMode) {
|
|
27
|
+
/// Supported protocol: RTMP
|
|
28
|
+
V2TXLiveMode_RTMP,
|
|
29
|
+
|
|
30
|
+
/// Supported protocol: RTC
|
|
31
|
+
V2TXLiveMode_RTC
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Protocol Details**:
|
|
36
|
+
- RTMP: Standard protocol for live streaming
|
|
37
|
+
- RTC: Real-Time Communication (TRTC) protocol
|
|
38
|
+
|
|
39
|
+
## 2. Video Types
|
|
40
|
+
|
|
41
|
+
### V2TXLiveVideoResolution - Video Resolution Enumeration
|
|
42
|
+
```objc
|
|
43
|
+
typedef NS_ENUM(NSInteger, V2TXLiveVideoResolution) {
|
|
44
|
+
/// 160x160, bitrate: 100Kbps–150Kbps, frame rate: 15fps
|
|
45
|
+
V2TXLiveVideoResolution160x160,
|
|
46
|
+
|
|
47
|
+
/// 270x270, bitrate: 200Kbps–300Kbps, frame rate: 15fps
|
|
48
|
+
V2TXLiveVideoResolution270x270,
|
|
49
|
+
|
|
50
|
+
/// 480x480, bitrate: 350Kbps–525Kbps, frame rate: 15fps
|
|
51
|
+
V2TXLiveVideoResolution480x480,
|
|
52
|
+
|
|
53
|
+
/// 320x240, bitrate: 250Kbps–375Kbps, frame rate: 15fps
|
|
54
|
+
V2TXLiveVideoResolution320x240,
|
|
55
|
+
|
|
56
|
+
/// 480x360, bitrate: 400Kbps–600Kbps, frame rate: 15fps
|
|
57
|
+
V2TXLiveVideoResolution480x360,
|
|
58
|
+
|
|
59
|
+
/// 640x480, bitrate: 600Kbps–900Kbps, frame rate: 15fps
|
|
60
|
+
V2TXLiveVideoResolution640x480,
|
|
61
|
+
|
|
62
|
+
/// 320x180, bitrate: 250Kbps–400Kbps, frame rate: 15fps
|
|
63
|
+
V2TXLiveVideoResolution320x180,
|
|
64
|
+
|
|
65
|
+
/// 480x270, bitrate: 350Kbps–550Kbps, frame rate: 15fps
|
|
66
|
+
V2TXLiveVideoResolution480x270,
|
|
67
|
+
|
|
68
|
+
/// 640x360, bitrate: 500Kbps–900Kbps, frame rate: 15fps
|
|
69
|
+
V2TXLiveVideoResolution640x360,
|
|
70
|
+
|
|
71
|
+
/// 960x540, bitrate: 800Kbps–1500Kbps, frame rate: 15fps
|
|
72
|
+
V2TXLiveVideoResolution960x540,
|
|
73
|
+
|
|
74
|
+
/// 1280x720, bitrate: 1000Kbps–1800Kbps, frame rate: 15fps
|
|
75
|
+
V2TXLiveVideoResolution1280x720,
|
|
76
|
+
|
|
77
|
+
/// 1920x1080, bitrate: 2500Kbps–3000Kbps, frame rate: 15fps
|
|
78
|
+
V2TXLiveVideoResolution1920x1080
|
|
79
|
+
};
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### V2TXLiveVideoResolutionMode - Video Resolution Mode
|
|
83
|
+
```objc
|
|
84
|
+
typedef NS_ENUM(NSInteger, V2TXLiveVideoResolutionMode) {
|
|
85
|
+
/// Landscape mode
|
|
86
|
+
V2TXLiveVideoResolutionModeLandscape,
|
|
87
|
+
|
|
88
|
+
/// Portrait mode
|
|
89
|
+
V2TXLiveVideoResolutionModePortrait
|
|
90
|
+
};
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Resolution Options**:
|
|
94
|
+
- Supports a range of resolutions from 160×160 up to 1920×1080
|
|
95
|
+
- Landscape and portrait orientation available
|
|
96
|
+
|
|
97
|
+
### V2TXLiveMirrorType - Camera Mirroring Mode
|
|
98
|
+
```objc
|
|
99
|
+
typedef NS_ENUM(NSInteger, V2TXLiveMirrorType) {
|
|
100
|
+
/// System default: front camera mirrored, rear camera not mirrored
|
|
101
|
+
V2TXLiveMirrorTypeAuto,
|
|
102
|
+
|
|
103
|
+
/// Mirror mode enabled for both front and rear cameras
|
|
104
|
+
V2TXLiveMirrorTypeEnable,
|
|
105
|
+
|
|
106
|
+
/// Mirror mode disabled for both front and rear cameras
|
|
107
|
+
V2TXLiveMirrorTypeDisable
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### V2TXLiveFillMode - Video Fill Mode
|
|
112
|
+
```objc
|
|
113
|
+
typedef NS_ENUM(NSInteger, V2TXLiveFillMode) {
|
|
114
|
+
/// Fill screen by cropping excess, may lose content
|
|
115
|
+
V2TXLiveFillModeFill,
|
|
116
|
+
|
|
117
|
+
/// Fit long edge to screen, black bars on short edge, content remains intact
|
|
118
|
+
V2TXLiveFillModeFit,
|
|
119
|
+
|
|
120
|
+
/// Stretch to fill screen, aspect ratio may not be preserved
|
|
121
|
+
V2TXLiveFillModeScaleFill
|
|
122
|
+
};
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### V2TXLiveRotation - Video Rotation Angle
|
|
126
|
+
```objc
|
|
127
|
+
typedef NS_ENUM(NSInteger, V2TXLiveRotation) {
|
|
128
|
+
/// No rotation
|
|
129
|
+
V2TXLiveRotation0,
|
|
130
|
+
|
|
131
|
+
/// 90° clockwise
|
|
132
|
+
V2TXLiveRotation90,
|
|
133
|
+
|
|
134
|
+
/// 180° clockwise
|
|
135
|
+
V2TXLiveRotation180,
|
|
136
|
+
|
|
137
|
+
/// 270° clockwise
|
|
138
|
+
V2TXLiveRotation270
|
|
139
|
+
};
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### V2TXLiveVideoEncoderParam - Video Encoder Parameter Configuration
|
|
143
|
+
```objc
|
|
144
|
+
@interface V2TXLiveVideoEncoderParam : NSObject
|
|
145
|
+
|
|
146
|
+
@property(nonatomic, assign) V2TXLiveVideoResolution videoResolution; // Video resolution
|
|
147
|
+
@property(nonatomic, assign) V2TXLiveVideoResolutionMode videoResolutionMode; // Resolution mode
|
|
148
|
+
@property(nonatomic, assign) int videoFps; // Capture Frame Rate (fps)
|
|
149
|
+
@property(nonatomic, assign) int videoBitrate; // Target video bitrate (kbps)
|
|
150
|
+
@property(nonatomic, assign) int minVideoBitrate; // Minimum video bitrate (kbps)
|
|
151
|
+
|
|
152
|
+
- (instancetype)initWith:(V2TXLiveVideoResolution)resolution; // Initialization method
|
|
153
|
+
|
|
154
|
+
@end
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Recommended Settings**:
|
|
158
|
+
- **Frame Rate**: Set to 15fps or 20fps. Frame rates below 5fps cause noticeable Playback Stuttering; rates above 20fps may waste bandwidth.
|
|
159
|
+
- **Adaptive Bitrate**: Specify both videoBitrate and minVideoBitrate to define the bitrate adjustment range.
|
|
160
|
+
|
|
161
|
+
### V2TXLivePixelFormat - Video Frame Pixel Format
|
|
162
|
+
```objc
|
|
163
|
+
typedef NS_ENUM(NSInteger, V2TXLivePixelFormat) {
|
|
164
|
+
/// Unknown pixel format
|
|
165
|
+
V2TXLivePixelFormatUnknown,
|
|
166
|
+
|
|
167
|
+
/// I420 (YUV420P)
|
|
168
|
+
V2TXLivePixelFormatI420,
|
|
169
|
+
|
|
170
|
+
/// NV12
|
|
171
|
+
V2TXLivePixelFormatNV12,
|
|
172
|
+
|
|
173
|
+
/// BGRA32
|
|
174
|
+
V2TXLivePixelFormatBGRA32,
|
|
175
|
+
|
|
176
|
+
/// OpenGL 2D texture
|
|
177
|
+
V2TXLivePixelFormatTexture2D
|
|
178
|
+
};
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### V2TXLiveBufferType - Video Data Buffer Type
|
|
182
|
+
```objc
|
|
183
|
+
typedef NS_ENUM(NSInteger, V2TXLiveBufferType) {
|
|
184
|
+
/// Unknown buffer type
|
|
185
|
+
V2TXLiveBufferTypeUnknown,
|
|
186
|
+
|
|
187
|
+
/// PixelBuffer (native iOS video format)
|
|
188
|
+
V2TXLiveBufferTypePixelBuffer,
|
|
189
|
+
|
|
190
|
+
/// NSData (used for I420 and other buffer types)
|
|
191
|
+
V2TXLiveBufferTypeNSData,
|
|
192
|
+
|
|
193
|
+
/// OpenGL texture (highest performance, minimal quality loss)
|
|
194
|
+
V2TXLiveBufferTypeTexture
|
|
195
|
+
};
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### V2TXLiveVideoFrame - Video Frame Data Structure
|
|
199
|
+
```objc
|
|
200
|
+
@interface V2TXLiveVideoFrame : NSObject
|
|
201
|
+
|
|
202
|
+
@property(nonatomic, assign) V2TXLivePixelFormat pixelFormat; // Pixel format
|
|
203
|
+
@property(nonatomic, assign) V2TXLiveBufferType bufferType; // Buffer type
|
|
204
|
+
@property(nonatomic, strong) NSData *data; // Video data
|
|
205
|
+
@property(nonatomic, assign) CVPixelBufferRef pixelBuffer; // PixelBuffer data
|
|
206
|
+
@property(nonatomic, assign) NSUInteger width; // Video width
|
|
207
|
+
@property(nonatomic, assign) NSUInteger height; // Video height
|
|
208
|
+
@property(nonatomic, assign) V2TXLiveRotation rotation; // Rotation angle
|
|
209
|
+
@property(nonatomic, assign) GLuint textureId; // Texture ID
|
|
210
|
+
|
|
211
|
+
@end
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Picture-in-Picture State
|
|
215
|
+
|
|
216
|
+
### V2TXLivePictureInPictureState - Picture-in-Picture State Enumeration
|
|
217
|
+
```objc
|
|
218
|
+
typedef NS_ENUM(NSInteger, V2TXLivePictureInPictureState) {
|
|
219
|
+
/// Undefined state
|
|
220
|
+
V2TXLivePictureInPictureStateUndefined,
|
|
221
|
+
|
|
222
|
+
/// Error occurred
|
|
223
|
+
V2TXLivePictureInPictureStateOccurError,
|
|
224
|
+
|
|
225
|
+
/// Will start
|
|
226
|
+
V2TXLivePictureInPictureStateWillStart,
|
|
227
|
+
|
|
228
|
+
/// Started
|
|
229
|
+
V2TXLivePictureInPictureStateDidStart,
|
|
230
|
+
|
|
231
|
+
/// Will stop
|
|
232
|
+
V2TXLivePictureInPictureStateWillStop,
|
|
233
|
+
|
|
234
|
+
/// Stopped
|
|
235
|
+
V2TXLivePictureInPictureStateDidStop,
|
|
236
|
+
|
|
237
|
+
/// Restore UI from picture-in-picture
|
|
238
|
+
V2TXLivePictureInPictureStateRestoreUI
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## 3. Audio Types
|
|
243
|
+
|
|
244
|
+
### V2TXLiveAudioQuality - Audio Quality Options
|
|
245
|
+
```objc
|
|
246
|
+
typedef NS_ENUM(NSInteger, V2TXLiveAudioQuality) {
|
|
247
|
+
/// Speech: 16k sample rate, mono, 16kbps; suitable for voice calls
|
|
248
|
+
V2TXLiveAudioQualitySpeech,
|
|
249
|
+
|
|
250
|
+
/// Default: 48k sample rate, mono, 50kbps; SDK default
|
|
251
|
+
V2TXLiveAudioQualityDefault,
|
|
252
|
+
|
|
253
|
+
/// Music: 48k sample rate, stereo, full band, 128kbps; suitable for high-fidelity music
|
|
254
|
+
V2TXLiveAudioQualityMusic
|
|
255
|
+
};
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### V2TXLiveAudioFrame - Audio Frame Data Structure
|
|
259
|
+
```objc
|
|
260
|
+
@interface V2TXLiveAudioFrame : NSObject
|
|
261
|
+
|
|
262
|
+
@property(nonatomic, strong) NSData *data; // Audio data
|
|
263
|
+
@property(nonatomic, assign) int sampleRate; // Sample rate (default: 48000Hz)
|
|
264
|
+
@property(nonatomic, assign) int channel; // Audio Channel count (default: 1, mono)
|
|
265
|
+
@property(nonatomic, assign) uint64_t timestamp; // Timestamp (ms)
|
|
266
|
+
|
|
267
|
+
@end
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### V2TXLiveAudioFrameOperationMode - Audio Callback Data Mode
|
|
271
|
+
```objc
|
|
272
|
+
typedef NS_ENUM(NSInteger, V2TXLiveAudioFrameOperationMode) {
|
|
273
|
+
/// Read/Write: get and modify callback audio data (default)
|
|
274
|
+
V2TXLiveAudioFrameOperationModeReadWrite,
|
|
275
|
+
|
|
276
|
+
/// Read-only: only get audio data from callback
|
|
277
|
+
V2TXLiveAudioFrameOperationModeReadOnly
|
|
278
|
+
};
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
### V2TXLiveAudioFrameObserverFormat - Audio Frame Callback Format
|
|
282
|
+
```objc
|
|
283
|
+
@interface V2TXLiveAudioFrameObserverFormat : NSObject
|
|
284
|
+
|
|
285
|
+
@property(nonatomic, assign) int sampleRate; // Sample rate (default: 48000Hz)
|
|
286
|
+
@property(nonatomic, assign) int channel; // Audio Channel count (default: 1)
|
|
287
|
+
@property(nonatomic, assign) int samplesPerCall; // Samples per callback
|
|
288
|
+
@property(nonatomic, assign) V2TXLiveAudioFrameOperationMode mode; // Callback data mode
|
|
289
|
+
|
|
290
|
+
@end
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Parameter Notes**:
|
|
294
|
+
- **samplesPerCall**: Must be an integer multiple of sampleRate/100
|
|
295
|
+
|
|
296
|
+
## 4. Statistics Data
|
|
297
|
+
|
|
298
|
+
### V2TXLivePusherStatistics - Stream Publisher Statistics
|
|
299
|
+
```objc
|
|
300
|
+
@interface V2TXLivePusherStatistics : NSObject
|
|
301
|
+
|
|
302
|
+
@property(nonatomic, assign) NSUInteger appCpu; // App CPU usage (%)
|
|
303
|
+
@property(nonatomic, assign) NSUInteger systemCpu; // System CPU usage (%)
|
|
304
|
+
@property(nonatomic, assign) NSUInteger width; // Video width
|
|
305
|
+
@property(nonatomic, assign) NSUInteger height; // Video height
|
|
306
|
+
@property(nonatomic, assign) NSUInteger fps; // Frame rate (fps)
|
|
307
|
+
@property(nonatomic, assign) NSUInteger videoBitrate; // Video bitrate (Kbps)
|
|
308
|
+
@property(nonatomic, assign) NSUInteger audioBitrate; // Audio bitrate (Kbps)
|
|
309
|
+
@property(nonatomic, assign) NSUInteger rtt; // Round-Trip Time (RTT) (ms)
|
|
310
|
+
@property(nonatomic, assign) NSUInteger netSpeed; // Upload speed (kbps)
|
|
311
|
+
|
|
312
|
+
@end
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### V2TXLivePlayerStatistics - Player Statistics
|
|
316
|
+
```objc
|
|
317
|
+
@interface V2TXLivePlayerStatistics : NSObject
|
|
318
|
+
|
|
319
|
+
@property(nonatomic, assign) NSUInteger appCpu; // App CPU usage (%)
|
|
320
|
+
@property(nonatomic, assign) NSUInteger systemCpu; // System CPU usage (%)
|
|
321
|
+
@property(nonatomic, assign) NSUInteger width; // Video width
|
|
322
|
+
@property(nonatomic, assign) NSUInteger height; // Video height
|
|
323
|
+
@property(nonatomic, assign) NSUInteger fps; // Frame rate (fps)
|
|
324
|
+
@property(nonatomic, assign) NSUInteger videoBitrate; // Video bitrate (Kbps)
|
|
325
|
+
@property(nonatomic, assign) NSUInteger audioBitrate; // Audio bitrate (Kbps)
|
|
326
|
+
@property(nonatomic, assign) NSUInteger audioPacketLoss; // Audio packet loss rate (%)
|
|
327
|
+
@property(nonatomic, assign) NSUInteger videoPacketLoss; // Video Packet Loss Rate (%)
|
|
328
|
+
@property(nonatomic, assign) NSUInteger jitterBufferDelay; // Playback delay (ms)
|
|
329
|
+
@property(nonatomic, assign) NSUInteger audioTotalBlockTime; // Total audio Playback Stuttering duration (ms)
|
|
330
|
+
@property(nonatomic, assign) NSUInteger audioBlockRate; // Audio Playback Stuttering rate (%)
|
|
331
|
+
@property(nonatomic, assign) NSUInteger videoTotalBlockTime; // Total video Playback Stuttering duration (ms)
|
|
332
|
+
@property(nonatomic, assign) NSUInteger videoBlockRate; // Video Playback Stuttering rate (%)
|
|
333
|
+
@property(nonatomic, assign) NSUInteger rtt; // Round-Trip Time (RTT) (ms)
|
|
334
|
+
@property(nonatomic, assign) NSUInteger netSpeed; // Download speed (kbps)
|
|
335
|
+
|
|
336
|
+
@end
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
## 5. Connection Status
|
|
340
|
+
|
|
341
|
+
### V2TXLivePushStatus - Stream Publishing Connection Status
|
|
342
|
+
```objc
|
|
343
|
+
typedef NS_ENUM(NSInteger, V2TXLivePushStatus) {
|
|
344
|
+
/// Disconnected from server
|
|
345
|
+
V2TXLivePushStatusDisconnected,
|
|
346
|
+
|
|
347
|
+
/// Connecting to server
|
|
348
|
+
V2TXLivePushStatusConnecting,
|
|
349
|
+
|
|
350
|
+
/// Connected to server
|
|
351
|
+
V2TXLivePushStatusConnectSuccess,
|
|
352
|
+
|
|
353
|
+
/// Reconnecting to server
|
|
354
|
+
V2TXLivePushStatusReconnecting
|
|
355
|
+
};
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### V2TXAudioRoute - Audio Output Mode
|
|
359
|
+
```objc
|
|
360
|
+
typedef NS_ENUM(NSInteger, V2TXAudioRoute) {
|
|
361
|
+
/// Play via the speaker (device speaker)
|
|
362
|
+
V2TXAudioRouteSpeakerphone,
|
|
363
|
+
|
|
364
|
+
/// Play via the receiver (device earpiece)
|
|
365
|
+
V2TXAudioRouteEarpiece
|
|
366
|
+
};
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
## 6. Cloud Stream Mixing Configuration
|
|
370
|
+
|
|
371
|
+
### V2TXLiveMixInputType - Stream Mixing Input Type
|
|
372
|
+
```objc
|
|
373
|
+
typedef NS_ENUM(NSInteger, V2TXLiveMixInputType) {
|
|
374
|
+
/// Mix audio and video
|
|
375
|
+
V2TXLiveMixInputTypeAudioVideo,
|
|
376
|
+
|
|
377
|
+
/// Mix video only
|
|
378
|
+
V2TXLiveMixInputTypePureVideo,
|
|
379
|
+
|
|
380
|
+
/// Mix audio only
|
|
381
|
+
V2TXLiveMixInputTypePureAudio
|
|
382
|
+
};
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### V2TXLiveMixStream - Cloud Stream Mixing Sub-Screen Layout
|
|
386
|
+
```objc
|
|
387
|
+
@interface V2TXLiveMixStream : NSObject
|
|
388
|
+
|
|
389
|
+
@property(nonatomic, copy) NSString *userId; // userId participating in Cloud stream mixing
|
|
390
|
+
@property(nonatomic, copy) NSString *streamId; // streamId for publishing
|
|
391
|
+
@property(nonatomic, assign) NSInteger x; // Layer X position (pixels)
|
|
392
|
+
@property(nonatomic, assign) NSInteger y; // Layer Y position (pixels)
|
|
393
|
+
@property(nonatomic, assign) NSInteger width; // Layer width (pixels)
|
|
394
|
+
@property(nonatomic, assign) NSInteger height; // Layer height (pixels)
|
|
395
|
+
@property(nonatomic, assign) NSUInteger zOrder; // Layer z-order (1–15, must be unique)
|
|
396
|
+
@property(nonatomic, assign) V2TXLiveMixInputType inputType; // Stream input type
|
|
397
|
+
|
|
398
|
+
@end
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### V2TXLiveTranscodingConfig - Cloud Stream Mixing MixTranscoding Configuration
|
|
402
|
+
```objc
|
|
403
|
+
@interface V2TXLiveTranscodingConfig : NSObject
|
|
404
|
+
|
|
405
|
+
@property(nonatomic, assign) NSUInteger videoWidth; // Output video width
|
|
406
|
+
@property(nonatomic, assign) NSUInteger videoHeight; // Output video height
|
|
407
|
+
@property(nonatomic, assign) NSUInteger videoBitrate; // Output video bitrate (kbps)
|
|
408
|
+
@property(nonatomic, assign) NSUInteger videoFramerate; // Output video frame rate (FPS)
|
|
409
|
+
@property(nonatomic, assign) NSUInteger videoGOP; // Keyframe interval (seconds)
|
|
410
|
+
@property(nonatomic, assign) NSUInteger backgroundColor; // Background color
|
|
411
|
+
@property(nonatomic, copy) NSString *backgroundImage; // Background image
|
|
412
|
+
@property(nonatomic, assign) NSUInteger audioSampleRate; // Output audio sample rate
|
|
413
|
+
@property(nonatomic, assign) NSUInteger audioBitrate; // Output audio bitrate (kbps)
|
|
414
|
+
@property(nonatomic, assign) NSUInteger audioChannels; // Output audio channel count
|
|
415
|
+
@property(nonatomic, copy) NSArray<V2TXLiveMixStream *> *mixStreams; // Sub-screen layout info
|
|
416
|
+
@property(nonatomic, copy) NSString *outputStreamId; // Output stream ID for CDN
|
|
417
|
+
|
|
418
|
+
@end
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## 7. Local Recording Configuration
|
|
422
|
+
|
|
423
|
+
### V2TXLiveRecordMode - Local Recording Mode
|
|
424
|
+
```objc
|
|
425
|
+
typedef NS_ENUM(NSUInteger, V2TXLiveRecordMode) {
|
|
426
|
+
/// Record both audio and video
|
|
427
|
+
V2TXLiveRecordModeBoth
|
|
428
|
+
};
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### V2TXLiveLocalRecordingParams - Local Recording Parameters
|
|
432
|
+
```objc
|
|
433
|
+
@interface V2TXLiveLocalRecordingParams : NSObject
|
|
434
|
+
|
|
435
|
+
@property(nonatomic, copy) NSString *filePath; // Path for recording file (required, must include filename and extension)
|
|
436
|
+
@property(nonatomic, assign) V2TXLiveRecordMode recordMode; // Recording mode
|
|
437
|
+
@property(nonatomic, assign) int interval; // Recording info update interval (ms)
|
|
438
|
+
|
|
439
|
+
@end
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
**Parameter Notes**:
|
|
443
|
+
- **filePath**: Must include filename and extension (currently supports MP4 only)
|
|
444
|
+
- **interval**: Valid range is 1000–10000ms; set to -1 to disable recording info callback
|
|
445
|
+
|
|
446
|
+
## 8. Log Configuration
|
|
447
|
+
|
|
448
|
+
### V2TXLiveLogLevel - Log Level
|
|
449
|
+
```objc
|
|
450
|
+
typedef NS_ENUM(NSInteger, V2TXLiveLogLevel) {
|
|
451
|
+
V2TXLiveLogLevelAll, // Output all levels
|
|
452
|
+
V2TXLiveLogLevelDebug, // Output DEBUG and above
|
|
453
|
+
V2TXLiveLogLevelInfo, // Output INFO and above
|
|
454
|
+
V2TXLiveLogLevelWarning, // Output WARNING and above
|
|
455
|
+
V2TXLiveLogLevelError, // Output ERROR and above
|
|
456
|
+
V2TXLiveLogLevelFatal, // Output FATAL only
|
|
457
|
+
V2TXLiveLogLevelNULL // No log output
|
|
458
|
+
};
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
### V2TXLiveLogConfig - Log Configuration
|
|
462
|
+
```objc
|
|
463
|
+
@interface V2TXLiveLogConfig : NSObject
|
|
464
|
+
|
|
465
|
+
@property(nonatomic, assign) V2TXLiveLogLevel logLevel; // Log level
|
|
466
|
+
@property(nonatomic, assign) BOOL enableObserver; // Receive log info via Observer
|
|
467
|
+
@property(nonatomic, assign) BOOL enableConsole; // Print log info to console
|
|
468
|
+
@property(nonatomic, assign) BOOL enableLogFile; // Enable local log file
|
|
469
|
+
@property(nonatomic, copy) NSString *logPath; // Log storage directory
|
|
470
|
+
|
|
471
|
+
@end
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
**Default Storage Path**: On iOS/macOS, logs are stored in the Documents/log directory by default.
|
|
475
|
+
|
|
476
|
+
**Field Descriptions**:
|
|
477
|
+
- **logLevel**: Controls the verbosity of SDK log output
|
|
478
|
+
- **enableObserver**: Receive log info via Observer for custom handling
|
|
479
|
+
- **enableConsole**: Print log info to the editor console for debugging
|
|
480
|
+
- **enableLogFile**: Enable local log file for troubleshooting
|
|
481
|
+
- **logPath**: Directory for storing logs; uses default path if not specified
|
|
482
|
+
|
|
483
|
+
## 9. Other Configuration
|
|
484
|
+
|
|
485
|
+
### V2TXLiveSocks5ProxyConfig - SOCKS5 Proxy Configuration
|
|
486
|
+
```objc
|
|
487
|
+
@interface V2TXLiveSocks5ProxyConfig : NSObject
|
|
488
|
+
|
|
489
|
+
@property(nonatomic, assign) BOOL supportHttps; // Enable HTTPS support
|
|
490
|
+
@property(nonatomic, assign) BOOL supportTcp; // Enable TCP support
|
|
491
|
+
@property(nonatomic, assign) BOOL supportUdp; // Enable UDP support
|
|
492
|
+
|
|
493
|
+
@end
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### V2TXLiveStreamInfo - Adaptive Bitrate Stream Info
|
|
497
|
+
```objc
|
|
498
|
+
@interface V2TXLiveStreamInfo : NSObject
|
|
499
|
+
|
|
500
|
+
@property(nonatomic, assign) int width; // Video width
|
|
501
|
+
@property(nonatomic, assign) int height; // Video height
|
|
502
|
+
@property(nonatomic, assign) int bitrate; // Bitrate (bps)
|
|
503
|
+
@property(nonatomic, assign) float framerate; // Frame rate
|
|
504
|
+
@property(nonatomic, copy) NSString *url; // Stream URL
|
|
505
|
+
|
|
506
|
+
@end
|
|
507
|
+
```
|