tirtc-devtools-cli 0.3.0 → 0.3.2
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/README.md +3 -2
- package/dist/cli/src/index.js +4 -0
- package/dist/cli/src/role_driver.d.ts +4 -0
- package/dist/cli/src/role_driver.js +42 -0
- package/dist/cli/src/role_live_log.js +14 -2
- package/package.json +1 -1
- package/vendor/devtools/driver/linux-x64/devtools_driver_probe +0 -0
- package/vendor/devtools/driver/macos-arm64/devtools_driver_probe +0 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio.h +50 -3
- package/vendor/runtime/linux-x64/include/tirtc/audio_codec.h +6 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_format.h +20 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_frame.h +3 -4
- package/vendor/runtime/linux-x64/include/tirtc/audio_io.h +2 -3
- package/vendor/runtime/linux-x64/include/tirtc/audio_processing.h +1 -0
- package/vendor/runtime/linux-x64/include/tirtc/av.h +7 -2
- package/vendor/runtime/linux-x64/include/tirtc/media_codec.h +1 -0
- package/vendor/runtime/linux-x64/include/tirtc/media_downlink.h +28 -0
- package/vendor/runtime/linux-x64/include/tirtc/media_uplink.h +2 -1
- package/vendor/runtime/linux-x64/include/tirtc/transport.h +1 -1
- package/vendor/runtime/linux-x64/include/tirtc/trp.h +1 -0
- package/vendor/runtime/linux-x64/lib/libTiRTC.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmbedtls.a +0 -0
- package/vendor/runtime/linux-x64/lib/libusrsctp.a +0 -0
- package/vendor/runtime/linux-x64/lib/libwebrtc.a +0 -0
- package/vendor/runtime/linux-x64/manifest.txt +23 -19
- package/vendor/runtime/macos-arm64/include/tirtc/audio.h +50 -3
- package/vendor/runtime/macos-arm64/include/tirtc/audio_codec.h +6 -0
- package/vendor/runtime/macos-arm64/include/tirtc/audio_format.h +20 -0
- package/vendor/runtime/macos-arm64/include/tirtc/audio_frame.h +3 -4
- package/vendor/runtime/macos-arm64/include/tirtc/audio_io.h +2 -3
- package/vendor/runtime/macos-arm64/include/tirtc/audio_processing.h +1 -0
- package/vendor/runtime/macos-arm64/include/tirtc/av.h +7 -2
- package/vendor/runtime/macos-arm64/include/tirtc/media_codec.h +1 -0
- package/vendor/runtime/macos-arm64/include/tirtc/media_downlink.h +28 -0
- package/vendor/runtime/macos-arm64/include/tirtc/media_uplink.h +2 -1
- package/vendor/runtime/macos-arm64/include/tirtc/transport.h +1 -1
- package/vendor/runtime/macos-arm64/include/tirtc/trp.h +1 -0
- package/vendor/runtime/macos-arm64/lib/libTiRTC.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/runtime/macos-arm64/manifest.txt +21 -20
- package/vendor/runtime/script/prepare_runtime_media_dataset.sh +198 -95
package/README.md
CHANGED
|
@@ -65,8 +65,9 @@ prepared asset 会按完整音视频轨循环,任一轨到达源文件末尾
|
|
|
65
65
|
`device start` 的启动成功条件是 device listener 已就绪;客户端是否已经扫码连接不属于
|
|
66
66
|
device 启动失败条件。没有 client 时命令会继续常驻,直到用户结束进程或显式
|
|
67
67
|
`--duration-ms` 到期,summary 中 `media_send` 会保持未开始或标记为跳过。有 client
|
|
68
|
-
连接时 driver
|
|
69
|
-
|
|
68
|
+
连接时 driver 会把该连接挂到共享音视频输入上;client 断开后,device 会清理该连接,
|
|
69
|
+
并继续接受新的连接。若旧连接的断开回调尚未到达,新连接也会立即挂载并收到同一组
|
|
70
|
+
音视频输入的数据。
|
|
70
71
|
|
|
71
72
|
native role 失败时,`reason_code` 与 `failed_stage` 仍是主失败事实;`log_upload`
|
|
72
73
|
只说明失败现场日志是否已上传。上传成功时,CLI JSON 与 `summary.json` 会包含
|
package/dist/cli/src/index.js
CHANGED
|
@@ -125,6 +125,10 @@ device.command('start')
|
|
|
125
125
|
.option('--endpoint <url>', 'TiRTC endpoint;不传时读取 TIRTC_ENDPOINT')
|
|
126
126
|
.option('--source <path>', 'prepared asset root、manifest_path 或 encoded track;MP4 先运行 assets prepare')
|
|
127
127
|
.option('--video-codec <codec>', 'h264|h265|mjpeg', 'h264')
|
|
128
|
+
.option('--audio-codec <codec>', 'g711a|aac', 'g711a')
|
|
129
|
+
.option('--audio-sample-rate <hz>', '8000|16000', '8000')
|
|
130
|
+
.option('--audio-channels <count>', '1|2', '1')
|
|
131
|
+
.option('--exit-after-first-session', '首个 client 会话完成后主动正常退出并写出 summary')
|
|
128
132
|
.option('--duration-ms <ms>', '可选自动结束时长;默认持续运行直到用户结束进程')
|
|
129
133
|
.option('--connect-timeout-ms <ms>', 'service ready 最大等待')
|
|
130
134
|
.option('--first-packet-timeout-ms <ms>', '首包最大等待')
|
|
@@ -8,6 +8,10 @@ type DeviceCommandOptions = {
|
|
|
8
8
|
endpoint?: string;
|
|
9
9
|
source?: string;
|
|
10
10
|
videoCodec?: string;
|
|
11
|
+
audioCodec?: string;
|
|
12
|
+
audioSampleRate?: string;
|
|
13
|
+
audioChannels?: string;
|
|
14
|
+
exitAfterFirstSession?: boolean;
|
|
11
15
|
durationMs?: string;
|
|
12
16
|
connectTimeoutMs?: string;
|
|
13
17
|
firstPacketTimeoutMs?: string;
|
|
@@ -39,6 +39,9 @@ function rolePreflightError(reasonCode, detail) {
|
|
|
39
39
|
function roleUsageError(message) {
|
|
40
40
|
return new RoleCommandError('invalid_request', 'config', usageExitCode, message);
|
|
41
41
|
}
|
|
42
|
+
function roleUsageReasonError(reasonCode, message) {
|
|
43
|
+
return new RoleCommandError(reasonCode, 'config', usageExitCode, reasonCode + ': ' + message);
|
|
44
|
+
}
|
|
42
45
|
function pathExists(filePath) {
|
|
43
46
|
return fs_1.default.existsSync(filePath);
|
|
44
47
|
}
|
|
@@ -270,6 +273,27 @@ function codecOrDefault(raw) {
|
|
|
270
273
|
}
|
|
271
274
|
return codec;
|
|
272
275
|
}
|
|
276
|
+
function audioCodecOrDefault(raw) {
|
|
277
|
+
const codec = raw?.trim() || 'g711a';
|
|
278
|
+
if (codec !== 'g711a' && codec !== 'aac') {
|
|
279
|
+
throw roleUsageReasonError('audio_codec_unsupported', 'audio-codec must be g711a or aac');
|
|
280
|
+
}
|
|
281
|
+
return codec;
|
|
282
|
+
}
|
|
283
|
+
function audioSampleRateOrDefault(raw) {
|
|
284
|
+
const sampleRate = raw === undefined ? 8000 : Number(raw);
|
|
285
|
+
if (sampleRate !== 8000 && sampleRate !== 16000) {
|
|
286
|
+
throw roleUsageReasonError('audio_format_unsupported', 'audio-sample-rate must be 8000 or 16000');
|
|
287
|
+
}
|
|
288
|
+
return sampleRate;
|
|
289
|
+
}
|
|
290
|
+
function audioChannelsOrDefault(raw) {
|
|
291
|
+
const channels = raw === undefined ? 1 : Number(raw);
|
|
292
|
+
if (channels !== 1 && channels !== 2) {
|
|
293
|
+
throw roleUsageReasonError('audio_format_unsupported', 'audio-channels must be 1 or 2');
|
|
294
|
+
}
|
|
295
|
+
return channels;
|
|
296
|
+
}
|
|
273
297
|
function consumerOrDefault(raw) {
|
|
274
298
|
const consumer = raw?.trim() || 'frame_dump';
|
|
275
299
|
if (consumer !== 'frame_dump' && consumer !== 'packet_dump') {
|
|
@@ -302,6 +326,9 @@ function printEnvelope(options, code, message, data) {
|
|
|
302
326
|
}
|
|
303
327
|
function buildDeviceRequest(roots, artifactRoot, options) {
|
|
304
328
|
const codec = codecOrDefault(options.videoCodec);
|
|
329
|
+
const audioCodec = audioCodecOrDefault(options.audioCodec);
|
|
330
|
+
const audioSampleRateHz = audioSampleRateOrDefault(options.audioSampleRate);
|
|
331
|
+
const audioChannels = audioChannelsOrDefault(options.audioChannels);
|
|
305
332
|
const executionId = 'cli-device-' + codec + '-' + executionSuffix();
|
|
306
333
|
const caseId = 'devtools-cli-device.' + codec;
|
|
307
334
|
const deviceIdentity = resolveDeviceIdentity(options);
|
|
@@ -328,9 +355,15 @@ function buildDeviceRequest(roots, artifactRoot, options) {
|
|
|
328
355
|
media: {
|
|
329
356
|
source: { kind: 'encoded_asset', path: options.source ?? resolveAssetRoot(roots) },
|
|
330
357
|
video: { codec },
|
|
358
|
+
audio: {
|
|
359
|
+
codec: audioCodec,
|
|
360
|
+
sample_rate_hz: audioSampleRateHz,
|
|
361
|
+
channels: audioChannels,
|
|
362
|
+
},
|
|
331
363
|
},
|
|
332
364
|
output: { consumer: 'frame_dump', video: { frame_limit: defaultFrameLimit } },
|
|
333
365
|
run: {
|
|
366
|
+
exit_after_first_session: options.exitAfterFirstSession === true,
|
|
334
367
|
duration_ms: parseOptionalPositiveInt(options.durationMs, '--duration-ms'),
|
|
335
368
|
connect_timeout_ms: parsePositiveInt(options.connectTimeoutMs, defaultConnectTimeoutMs, '--connect-timeout-ms'),
|
|
336
369
|
first_packet_timeout_ms: parsePositiveInt(options.firstPacketTimeoutMs, defaultFirstPacketTimeoutMs, '--first-packet-timeout-ms'),
|
|
@@ -372,11 +405,15 @@ function buildClientRequest(roots, artifactRoot, options) {
|
|
|
372
405
|
const executionId = 'cli-client-' + executionSuffix();
|
|
373
406
|
const identityOverride = Boolean(bootstrap && (options.targetDeviceId || options.token));
|
|
374
407
|
const videoCodec = codecOrDefault(bootstrap?.video_codec);
|
|
408
|
+
const audioCodec = audioCodecOrDefault(bootstrap?.audio_codec);
|
|
409
|
+
const audioSampleRateHz = audioSampleRateOrDefault(bootstrap?.audio_sample_rate_hz ?? bootstrap?.sample_rate_hz);
|
|
410
|
+
const audioChannels = audioChannelsOrDefault(bootstrap?.audio_channels ?? bootstrap?.channels);
|
|
375
411
|
return {
|
|
376
412
|
schema_version: 1,
|
|
377
413
|
execution_id: executionId,
|
|
378
414
|
case_id: 'devtools-cli-client',
|
|
379
415
|
role: 'client',
|
|
416
|
+
require_audio: bootstrap?.require_audio ?? true,
|
|
380
417
|
endpoint,
|
|
381
418
|
identity: {
|
|
382
419
|
device_id: targetDeviceId,
|
|
@@ -392,6 +429,11 @@ function buildClientRequest(roots, artifactRoot, options) {
|
|
|
392
429
|
media: {
|
|
393
430
|
source: { kind: 'encoded_asset', path: resolveAssetRoot(roots) },
|
|
394
431
|
video: { codec: videoCodec },
|
|
432
|
+
audio: {
|
|
433
|
+
codec: audioCodec,
|
|
434
|
+
sample_rate_hz: audioSampleRateHz,
|
|
435
|
+
channels: audioChannels,
|
|
436
|
+
},
|
|
395
437
|
},
|
|
396
438
|
output: {
|
|
397
439
|
consumer: consumerOrDefault(options.consumer),
|
|
@@ -83,7 +83,7 @@ function startRoleLiveLog(options) {
|
|
|
83
83
|
let processedLineCount = 0;
|
|
84
84
|
let stopped = false;
|
|
85
85
|
const log = (message) => {
|
|
86
|
-
emit('[device] ' + message);
|
|
86
|
+
emit(new Date().toISOString() + ' [device] ' + message);
|
|
87
87
|
};
|
|
88
88
|
const media = nestedRecord(request, 'media');
|
|
89
89
|
const codec = payloadString(nestedRecord(media, 'video'), 'codec') ??
|
|
@@ -145,6 +145,15 @@ function startRoleLiveLog(options) {
|
|
|
145
145
|
log('client connected session=' + (session ?? 'unknown'));
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
|
+
case 'connection.state.changed': {
|
|
149
|
+
const parts = ['connection state changed'];
|
|
150
|
+
appendField(parts, 'session', sessionIndex(payload));
|
|
151
|
+
appendField(parts, 'state', payloadString(payload, 'state'));
|
|
152
|
+
appendField(parts, 'state_code', payloadNumber(payload, 'state_code'));
|
|
153
|
+
appendField(parts, 'error', payloadNumber(payload, 'error'));
|
|
154
|
+
log(parts.join(' '));
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
148
157
|
case 'connection.session.start': {
|
|
149
158
|
const session = sessionIndex(payload);
|
|
150
159
|
if (session !== undefined) {
|
|
@@ -157,7 +166,7 @@ function startRoleLiveLog(options) {
|
|
|
157
166
|
const parts = ['audio input started'];
|
|
158
167
|
appendField(parts, 'session', sessionIndex(payload));
|
|
159
168
|
appendField(parts, 'stream_id', payloadNumber(payload, 'stream_id'));
|
|
160
|
-
appendField(parts, 'codec', payloadString(payload, 'codec'));
|
|
169
|
+
appendField(parts, 'codec', payloadString(payload, 'audio_codec') ?? payloadString(payload, 'codec'));
|
|
161
170
|
appendField(parts, 'sample_rate_hz', payloadNumber(payload, 'sample_rate_hz'));
|
|
162
171
|
log(parts.join(' '));
|
|
163
172
|
break;
|
|
@@ -219,6 +228,9 @@ function startRoleLiveLog(options) {
|
|
|
219
228
|
appendField(parts, 'session', session);
|
|
220
229
|
appendField(parts, 'first_audio', payloadBoolean(payload, 'sent_first_audio'));
|
|
221
230
|
appendField(parts, 'first_video', payloadBoolean(payload, 'sent_first_video'));
|
|
231
|
+
appendField(parts, 'exit_reason', payloadString(payload, 'exit_reason'));
|
|
232
|
+
appendField(parts, 'submit_error_track', payloadString(payload, 'submit_error_track'));
|
|
233
|
+
appendField(parts, 'submit_error_status', payloadNumber(payload, 'submit_error_status'));
|
|
222
234
|
appendField(parts, 'elapsed', elapsed === undefined ? undefined : formatDurationMs(elapsed));
|
|
223
235
|
log(parts.join(' '));
|
|
224
236
|
break;
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -42,7 +42,11 @@ typedef enum TirtcAudioOutputState {
|
|
|
42
42
|
} TirtcAudioOutputState;
|
|
43
43
|
|
|
44
44
|
typedef struct TirtcAudioInputOptions {
|
|
45
|
-
|
|
45
|
+
TirtcMediaCodec codec;
|
|
46
|
+
|
|
47
|
+
uint32_t sample_rate_hz;
|
|
48
|
+
|
|
49
|
+
uint32_t channels;
|
|
46
50
|
|
|
47
51
|
TirtcAudioAecMode aec_mode;
|
|
48
52
|
|
|
@@ -61,9 +65,27 @@ typedef struct TirtcAudioInputOptions {
|
|
|
61
65
|
typedef struct TirtcAudioEncodedInputOptions {
|
|
62
66
|
TirtcMediaCodec codec;
|
|
63
67
|
|
|
64
|
-
|
|
68
|
+
uint32_t sample_rate_hz;
|
|
69
|
+
|
|
70
|
+
uint32_t channels;
|
|
65
71
|
} TirtcAudioEncodedInputOptions;
|
|
66
72
|
|
|
73
|
+
typedef struct TirtcAudioEncodedInputFrame {
|
|
74
|
+
TirtcMediaCodec codec;
|
|
75
|
+
|
|
76
|
+
uint32_t sample_rate_hz;
|
|
77
|
+
|
|
78
|
+
uint32_t channels;
|
|
79
|
+
|
|
80
|
+
uint32_t samples_per_channel;
|
|
81
|
+
|
|
82
|
+
int64_t pts_us;
|
|
83
|
+
|
|
84
|
+
const void* data;
|
|
85
|
+
|
|
86
|
+
size_t data_bytes;
|
|
87
|
+
} TirtcAudioEncodedInputFrame;
|
|
88
|
+
|
|
67
89
|
typedef struct TirtcAudioOutputOptions {
|
|
68
90
|
uint32_t volume_percent;
|
|
69
91
|
|
|
@@ -91,9 +113,30 @@ typedef struct TirtcPendingDurationMetrics {
|
|
|
91
113
|
uint64_t decoded_duration_ms;
|
|
92
114
|
} TirtcPendingDurationMetrics;
|
|
93
115
|
|
|
116
|
+
typedef struct TirtcOutputLatencyStageMetrics {
|
|
117
|
+
uint64_t latest_ms;
|
|
118
|
+
uint64_t average_ms;
|
|
119
|
+
uint64_t peak_ms;
|
|
120
|
+
uint64_t sample_count;
|
|
121
|
+
uint64_t unavailable_count;
|
|
122
|
+
} TirtcOutputLatencyStageMetrics;
|
|
123
|
+
|
|
124
|
+
typedef struct TirtcOutputLocalLatencyMetrics {
|
|
125
|
+
uint32_t window_duration_ms;
|
|
126
|
+
TirtcOutputLatencyStageMetrics total;
|
|
127
|
+
TirtcOutputLatencyStageMetrics buffer;
|
|
128
|
+
TirtcOutputLatencyStageMetrics decode_or_ready;
|
|
129
|
+
TirtcOutputLatencyStageMetrics output;
|
|
130
|
+
} TirtcOutputLocalLatencyMetrics;
|
|
131
|
+
|
|
94
132
|
typedef struct TirtcAudioOutputMetricsSnapshot {
|
|
95
133
|
TirtcOutputStutterMetrics stutter;
|
|
96
134
|
TirtcPendingDurationMetrics pending;
|
|
135
|
+
double input_bitrate_kbps;
|
|
136
|
+
double input_packet_rate;
|
|
137
|
+
double render_callback_rate;
|
|
138
|
+
uint32_t rate_window_duration_ms;
|
|
139
|
+
TirtcOutputLocalLatencyMetrics local_latency;
|
|
97
140
|
} TirtcAudioOutputMetricsSnapshot;
|
|
98
141
|
|
|
99
142
|
/**
|
|
@@ -105,6 +148,10 @@ typedef struct TirtcAudioOutputMetricsSnapshot {
|
|
|
105
148
|
*/
|
|
106
149
|
typedef struct TirtcAudioOutputDebugSnapshot {
|
|
107
150
|
TirtcMediaCodec codec;
|
|
151
|
+
|
|
152
|
+
uint32_t sample_rate_hz;
|
|
153
|
+
|
|
154
|
+
uint32_t channels;
|
|
108
155
|
} TirtcAudioOutputDebugSnapshot;
|
|
109
156
|
|
|
110
157
|
/**
|
|
@@ -191,7 +238,7 @@ TirtcError tirtc_audio_encoded_input_attach(TirtcAudioEncodedInput* input, Tirtc
|
|
|
191
238
|
TirtcError tirtc_audio_encoded_input_detach(TirtcAudioEncodedInput* input, TirtcConn* connection);
|
|
192
239
|
|
|
193
240
|
TirtcError tirtc_audio_encoded_input_submit_frame(TirtcAudioEncodedInput* input,
|
|
194
|
-
const
|
|
241
|
+
const TirtcAudioEncodedInputFrame* frame);
|
|
195
242
|
|
|
196
243
|
void tirtc_audio_encoded_input_destroy(TirtcAudioEncodedInput* input);
|
|
197
244
|
|
|
@@ -16,6 +16,12 @@ TirtcError tirtc_audio_g711a_encode(const TirtcAudioPcmFrame* pcm_frame, void* o
|
|
|
16
16
|
TirtcError tirtc_audio_g711a_decode(const TirtcAudioEncodedFrame* in_frame, void* out_buffer,
|
|
17
17
|
size_t out_buffer_capacity, TirtcAudioPcmFrame* out_frame);
|
|
18
18
|
|
|
19
|
+
TirtcError tirtc_audio_aac_encode(const TirtcAudioPcmFrame* pcm_frame, void* out_buffer,
|
|
20
|
+
size_t out_buffer_capacity, TirtcAudioEncodedFrame* out_frame);
|
|
21
|
+
|
|
22
|
+
TirtcError tirtc_audio_aac_decode(const TirtcAudioEncodedFrame* in_frame, void* out_buffer,
|
|
23
|
+
size_t out_buffer_capacity, TirtcAudioPcmFrame* out_frame);
|
|
24
|
+
|
|
19
25
|
#ifdef __cplusplus
|
|
20
26
|
}
|
|
21
27
|
#endif
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#ifndef TIRTC_MEDIA_CONTRACT_AUDIO_FORMAT_H_
|
|
2
|
+
#define TIRTC_MEDIA_CONTRACT_AUDIO_FORMAT_H_
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
typedef struct TirtcAudioFormat {
|
|
11
|
+
uint32_t sample_rate_hz;
|
|
12
|
+
uint32_t channels;
|
|
13
|
+
uint32_t bits_per_sample;
|
|
14
|
+
} TirtcAudioFormat;
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
}
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
#endif // TIRTC_MEDIA_CONTRACT_AUDIO_FORMAT_H_
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#include <stddef.h>
|
|
5
5
|
#include <stdint.h>
|
|
6
6
|
|
|
7
|
-
#include "tirtc/
|
|
7
|
+
#include "tirtc/audio_format.h"
|
|
8
8
|
#include "tirtc/media_codec.h"
|
|
9
9
|
|
|
10
10
|
#ifdef __cplusplus
|
|
@@ -12,17 +12,16 @@ extern "C" {
|
|
|
12
12
|
#endif
|
|
13
13
|
|
|
14
14
|
typedef struct TirtcAudioPcmFrame {
|
|
15
|
-
|
|
15
|
+
TirtcAudioFormat format;
|
|
16
16
|
uint32_t samples_per_channel;
|
|
17
17
|
int64_t pts_us;
|
|
18
|
-
/* Mutable PCM payload for capture, processing, and render-fill paths. */
|
|
19
18
|
void* data;
|
|
20
19
|
size_t data_bytes;
|
|
21
20
|
} TirtcAudioPcmFrame;
|
|
22
21
|
|
|
23
22
|
typedef struct TirtcAudioEncodedFrame {
|
|
24
23
|
TirtcMediaCodec codec;
|
|
25
|
-
|
|
24
|
+
TirtcAudioFormat format;
|
|
26
25
|
uint32_t samples_per_channel;
|
|
27
26
|
int64_t pts_us;
|
|
28
27
|
const void* data;
|
|
@@ -14,8 +14,7 @@ typedef struct TirtcAudioAin TirtcAudioAin;
|
|
|
14
14
|
typedef struct TirtcAudioAout TirtcAudioAout;
|
|
15
15
|
|
|
16
16
|
typedef struct TirtcAudioIoConfig {
|
|
17
|
-
|
|
18
|
-
/* AIN uses fixed 10 ms mono blocks; AOUT may use larger callback-sized multiples. */
|
|
17
|
+
TirtcAudioFormat format;
|
|
19
18
|
uint32_t samples_per_buffer;
|
|
20
19
|
} TirtcAudioIoConfig;
|
|
21
20
|
|
|
@@ -29,7 +28,7 @@ typedef void (*TirtcAudioAinOnFrameFn)(TirtcAudioAin* ain, const TirtcAudioPcmFr
|
|
|
29
28
|
void* user_data);
|
|
30
29
|
|
|
31
30
|
/*
|
|
32
|
-
* AOUT pre-fills
|
|
31
|
+
* AOUT pre-fills format, samples_per_channel, data, and data_bytes before
|
|
33
32
|
* calling render. The callback contract expects a non-negative rendered PCM
|
|
34
33
|
* byte count. Backends defensively clamp negative returns to zero and zero-fill
|
|
35
34
|
* any remaining buffer space.
|
|
@@ -46,6 +46,12 @@ typedef struct TirtcVideoOutputMetricsSnapshot {
|
|
|
46
46
|
TirtcVideoOutputStartupMetrics startup;
|
|
47
47
|
TirtcOutputStutterMetrics stutter;
|
|
48
48
|
TirtcPendingDurationMetrics pending;
|
|
49
|
+
double input_bitrate_kbps;
|
|
50
|
+
double input_fps;
|
|
51
|
+
double decoded_fps;
|
|
52
|
+
double render_fps;
|
|
53
|
+
uint32_t rate_window_duration_ms;
|
|
54
|
+
TirtcOutputLocalLatencyMetrics local_latency;
|
|
49
55
|
} TirtcVideoOutputMetricsSnapshot;
|
|
50
56
|
|
|
51
57
|
/**
|
|
@@ -53,8 +59,7 @@ typedef struct TirtcVideoOutputMetricsSnapshot {
|
|
|
53
59
|
*
|
|
54
60
|
* The snapshot is a caller-owned value copy. `resolved_decoder_backend` is the runtime route that
|
|
55
61
|
* has actually locked, so AUTO fallback reports the concrete backend family instead of the request.
|
|
56
|
-
* Zero values mean no current fact or only cached zero-state is available.
|
|
57
|
-
* a new V2 struct/function instead of extending this layout.
|
|
62
|
+
* Zero values mean no current fact or only cached zero-state is available.
|
|
58
63
|
*/
|
|
59
64
|
typedef struct TirtcVideoOutputDebugSnapshot {
|
|
60
65
|
TirtcMediaCodec codec;
|
|
@@ -8,6 +8,7 @@ extern "C" {
|
|
|
8
8
|
typedef enum TirtcMediaCodec {
|
|
9
9
|
TIRTC_MEDIA_CODEC_NONE = 0,
|
|
10
10
|
TIRTC_MEDIA_CODEC_AUDIO_G711A = 1,
|
|
11
|
+
TIRTC_MEDIA_CODEC_AUDIO_AAC = 2,
|
|
11
12
|
/* Reserved shared identifiers; concrete video implementations live outside media-contract. */
|
|
12
13
|
TIRTC_MEDIA_CODEC_VIDEO_H264 = 65,
|
|
13
14
|
TIRTC_MEDIA_CODEC_VIDEO_H265 = 66,
|
|
@@ -66,9 +66,30 @@ typedef struct TirtcMediaDownlinkPendingMetricsSnapshot {
|
|
|
66
66
|
uint64_t decoded_pending_duration_ms;
|
|
67
67
|
} TirtcMediaDownlinkPendingMetricsSnapshot;
|
|
68
68
|
|
|
69
|
+
typedef struct TirtcMediaDownlinkLatencyStageMetricsSnapshot {
|
|
70
|
+
uint64_t latest_ms;
|
|
71
|
+
uint64_t average_ms;
|
|
72
|
+
uint64_t peak_ms;
|
|
73
|
+
uint64_t sample_count;
|
|
74
|
+
uint64_t unavailable_count;
|
|
75
|
+
} TirtcMediaDownlinkLatencyStageMetricsSnapshot;
|
|
76
|
+
|
|
77
|
+
typedef struct TirtcMediaDownlinkLocalLatencyMetricsSnapshot {
|
|
78
|
+
uint32_t window_duration_ms;
|
|
79
|
+
TirtcMediaDownlinkLatencyStageMetricsSnapshot total;
|
|
80
|
+
TirtcMediaDownlinkLatencyStageMetricsSnapshot buffer;
|
|
81
|
+
TirtcMediaDownlinkLatencyStageMetricsSnapshot decode_or_ready;
|
|
82
|
+
TirtcMediaDownlinkLatencyStageMetricsSnapshot output;
|
|
83
|
+
} TirtcMediaDownlinkLocalLatencyMetricsSnapshot;
|
|
84
|
+
|
|
69
85
|
typedef struct TirtcMediaDownlinkAudioMetricsSnapshot {
|
|
70
86
|
TirtcMediaDownlinkStutterMetricsSnapshot stutter;
|
|
71
87
|
TirtcMediaDownlinkPendingMetricsSnapshot pending;
|
|
88
|
+
double input_bitrate_kbps;
|
|
89
|
+
double input_packet_rate;
|
|
90
|
+
double render_callback_rate;
|
|
91
|
+
uint32_t rate_window_duration_ms;
|
|
92
|
+
TirtcMediaDownlinkLocalLatencyMetricsSnapshot local_latency;
|
|
72
93
|
} TirtcMediaDownlinkAudioMetricsSnapshot;
|
|
73
94
|
|
|
74
95
|
typedef struct TirtcMediaDownlinkVideoStartupMetricsSnapshot {
|
|
@@ -84,6 +105,12 @@ typedef struct TirtcMediaDownlinkVideoMetricsSnapshot {
|
|
|
84
105
|
TirtcMediaDownlinkVideoStartupMetricsSnapshot startup;
|
|
85
106
|
TirtcMediaDownlinkStutterMetricsSnapshot stutter;
|
|
86
107
|
TirtcMediaDownlinkPendingMetricsSnapshot pending;
|
|
108
|
+
double input_bitrate_kbps;
|
|
109
|
+
double input_fps;
|
|
110
|
+
double decoded_fps;
|
|
111
|
+
double render_fps;
|
|
112
|
+
uint32_t rate_window_duration_ms;
|
|
113
|
+
TirtcMediaDownlinkLocalLatencyMetricsSnapshot local_latency;
|
|
87
114
|
} TirtcMediaDownlinkVideoMetricsSnapshot;
|
|
88
115
|
|
|
89
116
|
/**
|
|
@@ -94,6 +121,7 @@ typedef struct TirtcMediaDownlinkVideoMetricsSnapshot {
|
|
|
94
121
|
*/
|
|
95
122
|
typedef struct TirtcMediaDownlinkAudioDebugSnapshot {
|
|
96
123
|
TirtcMediaCodec codec;
|
|
124
|
+
TirtcAudioFormat format;
|
|
97
125
|
} TirtcMediaDownlinkAudioDebugSnapshot;
|
|
98
126
|
|
|
99
127
|
/**
|
|
@@ -29,7 +29,8 @@ typedef enum TirtcMediaUplinkState {
|
|
|
29
29
|
} TirtcMediaUplinkState;
|
|
30
30
|
|
|
31
31
|
typedef struct TirtcMediaUplinkAudioOptions {
|
|
32
|
-
|
|
32
|
+
TirtcMediaCodec codec;
|
|
33
|
+
TirtcAudioFormat format;
|
|
33
34
|
TirtcAudioAecMode aec_mode;
|
|
34
35
|
TirtcAudioAgcLevel agc_level;
|
|
35
36
|
TirtcAudioAnsLevel ans_level;
|
|
@@ -139,7 +139,7 @@ typedef struct TirtcTransportConnServiceOptions {
|
|
|
139
139
|
* This is a service-level capacity contract. It applies to the listener as a
|
|
140
140
|
* whole, not to any single connection and not to any individual stream.
|
|
141
141
|
*
|
|
142
|
-
*
|
|
142
|
+
* Set to 0 to leave the listener capacity to the active transport backend.
|
|
143
143
|
*/
|
|
144
144
|
uint32_t max_connections;
|
|
145
145
|
} TirtcTransportConnServiceOptions;
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
platform=linux-x64
|
|
2
2
|
profile=full
|
|
3
|
-
staged_at_utc=2026-05-
|
|
3
|
+
staged_at_utc=2026-05-13T16:35:31Z
|
|
4
4
|
source_sdk=/Users/allenfeng/Development/Repositories/tirtc-nexus/tirtc-matrix/.build/sdk/linux-x64
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
04c3139f26d53aa2fb0a586a21ffb481a001c01e0412cd3414a952c9a9d336ba include/tirtc/audio.h
|
|
7
|
+
ce7ccffa054250a2dab0e2128e4701a66c7168e50e8c470dcff3bf609ff0959c include/tirtc/audio_codec.h
|
|
8
|
+
0b463d8adfcf45acb3f95fe3e2d94b37a26aaf37d293eb2b18274ddcb161f767 include/tirtc/audio_format.h
|
|
9
|
+
7cac5b8c0cef28526ee00800fa8b0d1e60897ab971a0801899cb0333c9189fde include/tirtc/audio_frame.h
|
|
10
|
+
6daadba731521c01a3cf11c5d8b2ef797238737c939e2da3045fc83ad89af04a include/tirtc/audio_io.h
|
|
10
11
|
c2e1f31dcc75be461c577d18b1cebe32774f212d51cb4dd2a5b5a9bfe62b693e include/tirtc/audio_io_android.h
|
|
11
12
|
878bb18220ac62304ec95807f31e83e050c8dac14811f873454f9b045028694a include/tirtc/audio_io_apple.h
|
|
12
13
|
0569eb1d043ee7fa8d45ca43143eca1a22e4c4bf1507ca7e045e010a3ecbc288 include/tirtc/audio_io_harmony.h
|
|
13
14
|
51cbc911fe9f9834046f0e0a1a7cdd814a8e194a615894a8b4d11f9e5f095610 include/tirtc/audio_io_windows.h
|
|
14
|
-
|
|
15
|
+
5acfd19fdcd8c9d96e4aee7c6f1d33a9211c0a5b0c0ab56d96e1b4dee48f3aa9 include/tirtc/audio_processing.h
|
|
15
16
|
0ca7c3c630b1242f51a0fd8154097c0a332b4c816a5707090e4381719852998c include/tirtc/audio_sample_rate.h
|
|
16
|
-
|
|
17
|
+
07ca1b210a6e334c1474f25446477681472154568ecf74557cb3dc9b3a730662 include/tirtc/av.h
|
|
17
18
|
b3e110ce04057d3be696b120d1abeaf6141711a1c63ca7f9bdf65ed5ec6e16d7 include/tirtc/error.h
|
|
18
19
|
ae805545a9515edc9b94262e72ad2c7b7d649288166f4daeb450d8a55e82ae0b include/tirtc/foundation/build_info.h
|
|
19
20
|
7cf8b372a3d48d4de4a65a04c7f102281a7b42cebb9ec247853d3c53afb63b6a include/tirtc/http.h
|
|
20
21
|
70bbf93b84d9d1a85f376d9986de570c1f658319e1e5ab6d621f7a4d41033f5c include/tirtc/logging.h
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
1419ac3fb5237d1d820bd30a6845b98aab3553463eb64e73623b64c663665f16 include/tirtc/media_codec.h
|
|
23
|
+
df11627da9bfbb87cb32582701f638d2a0ff5b6b77b49a3a3bab7509c62f0613 include/tirtc/media_downlink.h
|
|
24
|
+
9376af63fde915753146969291f0fefe2da6df28f7aa6310f7787048165150dc include/tirtc/media_uplink.h
|
|
25
|
+
57be6941026e7dd173e8779b2bb868532d65e41f7917aad476a31ac25c1cd6c3 include/tirtc/transport.h
|
|
26
|
+
fba7954919606e507b6a074440440903665217959699da89ca9dd206772c0ef0 include/tirtc/trp.h
|
|
26
27
|
92b3db6e2cb02265ad5db01881edce9d4e095b1dadf449dce5d8bb5362957e33 include/tirtc/video_codec.h
|
|
27
28
|
e51379666c199588cc33279ccf52248035d1cae3d1d468b1615ebf29f0b39c9c include/tirtc/video_frame.h
|
|
28
29
|
2a02645d82c58d433c7306a9f0bcd31d0f3e560b63822f7e80919761b81a6284 include/tirtc/video_io.h
|
|
@@ -31,15 +32,18 @@ f22127424d5978ab0644209b6c25c24e19e320dd2fbda6634e6344597ff7e2be include/tirtc/
|
|
|
31
32
|
cae0bbeb884e5466a56da15182c78cc22baab6c743f349a58d3595f623333585 include/tirtc/video_io_harmony.h
|
|
32
33
|
65b5d24fe3a6bc2a299a2220148a153ba4eb0955a49c1c3baabf1fdfed8aabdd include/tirtc/video_io_windows.h
|
|
33
34
|
8cd6b66bea14890a665cc317f8572429b2c3e4463773f8b77c1e4dc30a4a8747 include/tirtc/video_processing.h
|
|
34
|
-
|
|
35
|
+
82653324cc9b6ea732ba8a4818175b8f99a5748ac0fa89f7e5c5e366a7f9e142 lib/libTiRTC.a
|
|
35
36
|
b1f4135025cb8e8520a14268d831b9998920a4239f84bb6b409d0e4909fd5bee lib/libcrypto.a
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
8a3b5da754707a9c6fbb73ab6176cdb12bc8af22d3a660249cb1812d501fb615 lib/libmatrix_runtime_audio.a
|
|
38
|
+
76a97c258a718c79846aadc91a389a5bf411de95bb43c0bd9b8a3ed3a2e8fa58 lib/libmatrix_runtime_facade.a
|
|
38
39
|
ec7bbf8e8744c6645a441a28e24e0645906152cc987d6fcca16af3c3badba940 lib/libmatrix_runtime_foundation_http.a
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
6403c37289c63d5f9d469fa5079972f464364ce1bd0ad602d26e0be54932e888 lib/libmatrix_runtime_foundation_logging.a
|
|
41
|
+
df52cb3856c179698761357ef40c063dcdb86fa67c0be186f64dcc9c634c36b4 lib/libmatrix_runtime_media.a
|
|
42
|
+
177e9ca89640bca3ae49a164e820b7e33c0d22d14dcd7458c358e74a47ffbd70 lib/libmatrix_runtime_transport.a
|
|
43
|
+
e00ea11ed72e1a2414251ec9f5b3dea46ed440a5fe30f8d45ae64e60b1d0ac19 lib/libmatrix_runtime_video.a
|
|
44
|
+
4b4b3170a775282fe2107f615539c985b4df43315572796faba23886aab62b1d lib/libmbedtls.a
|
|
43
45
|
511d521f7972df3993e5976d6e2dbcad7a6fbce9be15071274d0cbd9d51157f5 lib/libssl.a
|
|
46
|
+
c3adc781b817481c5546e4a9bdd863dd192d204b3502a0de44a730793d4f6e64 lib/libusrsctp.a
|
|
47
|
+
787f0d1f44f6f755305d1387172668a480c0ba9fdfdfb06af100351f957f6e38 lib/libwebrtc.a
|
|
44
48
|
a67ec9034848ef24a1b17671e444daa62a8f9e6b8319a1e932593908720ff2a1 lib/libwebrtc_apm.a
|
|
45
49
|
700e455255897e3cffab13ca593a6e4d9d11383ae609215cbbd6043a63d47161 lib/libxlog.a
|