tirtc-devtools-cli 0.0.11 → 0.0.13
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 +1 -1
- package/USAGE.md +85 -13
- package/dist/cli/src/guide.js +4 -3
- package/dist/cli/src/index.js +13 -13
- package/dist/cli/src/token_command.js +39 -31
- package/dist/cli/src/token_tool.d.ts +10 -17
- package/dist/cli/src/token_tool.js +84 -31
- package/package.json +1 -1
- package/vendor/app-server/bin/native/linux-x64/credential_napi.node +0 -0
- package/vendor/app-server/bin/native/macos-arm64/credential_napi.node +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/error.h +36 -17
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_credential.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/manifest.txt +1 -1
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio.h +39 -316
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/av.h +33 -372
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/error.h +36 -17
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_downlink.h +47 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/trp.h +57 -325
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_credential.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/manifest.txt +14 -14
- package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.d.ts +2 -5
- package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.js +2 -5
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** @file trp.h
|
|
2
|
+
* @brief Facade transport-facing public C API.
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
#ifndef TIRTC_FACADE_TRP_H_
|
|
2
6
|
#define TIRTC_FACADE_TRP_H_
|
|
3
7
|
|
|
@@ -10,444 +14,172 @@
|
|
|
10
14
|
extern "C" {
|
|
11
15
|
#endif
|
|
12
16
|
|
|
13
|
-
/**
|
|
14
|
-
* @file tirtc/trp.h
|
|
15
|
-
* @brief Base transport-facing facade API for TiRTC.
|
|
16
|
-
*
|
|
17
|
-
* This header defines the public control-plane contract that every higher
|
|
18
|
-
* facade layer builds on.
|
|
19
|
-
*
|
|
20
|
-
* Typical usage:
|
|
21
|
-
* 1. Call ::tirtc_init once for the process.
|
|
22
|
-
* 2. Either start a service with ::tirtc_conn_service_start, or create a
|
|
23
|
-
* standalone connection with ::tirtc_conn_create and then connect it with
|
|
24
|
-
* ::tirtc_conn_connect.
|
|
25
|
-
* 3. Install callbacks if the caller needs connection, command, or stream
|
|
26
|
-
* events.
|
|
27
|
-
* 4. Exchange stream messages and commands while the connection is alive.
|
|
28
|
-
* 5. Explicitly close resources with the matching stop, disconnect, destroy,
|
|
29
|
-
* and uninit calls.
|
|
30
|
-
*
|
|
31
|
-
* Higher-level headers extend this contract rather than replace it:
|
|
32
|
-
* - `tirtc/audio.h` adds audio input and audio output objects.
|
|
33
|
-
* - `tirtc/av.h` adds video input and video output objects.
|
|
34
|
-
*
|
|
35
|
-
* Ownership model:
|
|
36
|
-
* - The caller owns every public handle returned by this facade.
|
|
37
|
-
* - The runtime owns internal transport and media pipelines.
|
|
38
|
-
* - Public handles must be released with their documented matching API.
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* @brief Global runtime options passed to ::tirtc_init.
|
|
43
|
-
*
|
|
44
|
-
* The runtime resolves the effective endpoint during initialization and copies
|
|
45
|
-
* the values it needs. String pointers only need to remain valid for the
|
|
46
|
-
* duration of the ::tirtc_init call.
|
|
47
|
-
*/
|
|
48
17
|
typedef struct TirtcOptions {
|
|
49
|
-
/**
|
|
50
|
-
* @brief Optional explicit service endpoint.
|
|
51
|
-
*
|
|
52
|
-
* When non-NULL and not empty, this value overrides the built-in endpoint
|
|
53
|
-
* selected by ::environment.
|
|
54
|
-
*/
|
|
55
18
|
const char* endpoint;
|
|
56
19
|
|
|
57
|
-
/**
|
|
58
|
-
* @brief Optional directory used to initialize file logging.
|
|
59
|
-
*
|
|
60
|
-
* Pass NULL or an empty string to disable file logging.
|
|
61
|
-
*/
|
|
62
20
|
const char* log_root_dir;
|
|
63
21
|
|
|
64
|
-
/**
|
|
65
|
-
* @brief Non-zero to enable console logging; zero to disable it.
|
|
66
|
-
*/
|
|
67
22
|
int enable_console_log;
|
|
68
23
|
|
|
69
|
-
/**
|
|
70
|
-
* @brief Built-in environment selector used when ::endpoint is not supplied.
|
|
71
|
-
*
|
|
72
|
-
* The current implementation recognizes these values:
|
|
73
|
-
* - `0`: test
|
|
74
|
-
* - `1`: pre-production
|
|
75
|
-
* - `2`: production
|
|
76
|
-
*
|
|
77
|
-
* Any other value currently falls back to the production endpoint.
|
|
78
|
-
*/
|
|
79
|
-
int environment;
|
|
80
24
|
} TirtcOptions;
|
|
81
25
|
|
|
82
|
-
/**
|
|
83
|
-
* @brief Default media send policy applied by the facade.
|
|
84
|
-
*
|
|
85
|
-
* The effective send gate still uses `connection + stream_id + media_kind` as
|
|
86
|
-
* the smallest scope. The policy only decides how those gates become open.
|
|
87
|
-
*/
|
|
88
26
|
typedef enum TirtcMediaSendPolicy {
|
|
89
|
-
|
|
90
|
-
* @brief Keep send gates closed until the consumer explicitly opens them.
|
|
91
|
-
*/
|
|
27
|
+
|
|
92
28
|
TIRTC_MEDIA_SEND_POLICY_ON_REQUEST = 0,
|
|
93
29
|
|
|
94
|
-
/**
|
|
95
|
-
* @brief Open send gates automatically once the accepted connection exists.
|
|
96
|
-
*
|
|
97
|
-
* When the bound input is ready, the facade may start sending without first
|
|
98
|
-
* waiting for an explicit remote request.
|
|
99
|
-
*/
|
|
100
30
|
TIRTC_MEDIA_SEND_POLICY_AUTO_ON_CONNECTED = 1,
|
|
101
31
|
} TirtcMediaSendPolicy;
|
|
102
32
|
|
|
103
|
-
/**
|
|
104
|
-
* @brief Options for starting a service-side connection listener.
|
|
105
|
-
*
|
|
106
|
-
* A service accepts inbound transport connections and exposes them through
|
|
107
|
-
* ::TirtcConnServiceCallbacks.on_connected.
|
|
108
|
-
*/
|
|
109
33
|
typedef struct TirtcConnServiceStartOptions {
|
|
110
|
-
/**
|
|
111
|
-
* @brief Non-empty service license string.
|
|
112
|
-
*
|
|
113
|
-
* This field is required.
|
|
114
|
-
*/
|
|
115
34
|
const char* license;
|
|
116
35
|
|
|
117
|
-
/**
|
|
118
|
-
* @brief Maximum number of concurrently accepted connections.
|
|
119
|
-
*
|
|
120
|
-
* This is a service-level capacity contract. It applies to the listener as a
|
|
121
|
-
* whole, not to any single connection and not to any individual stream.
|
|
122
|
-
*
|
|
123
|
-
* This field is required and must be non-zero.
|
|
124
|
-
*/
|
|
125
36
|
uint32_t max_connections;
|
|
126
37
|
|
|
127
|
-
/**
|
|
128
|
-
* @brief Service-level media send policy applied to accepted connections.
|
|
129
|
-
*
|
|
130
|
-
* This policy controls how the facade opens per-connection send gates after
|
|
131
|
-
* a connection becomes available. It does not change the underlying
|
|
132
|
-
* transport request/release primitives.
|
|
133
|
-
*/
|
|
134
38
|
TirtcMediaSendPolicy media_send_policy;
|
|
135
39
|
} TirtcConnServiceStartOptions;
|
|
136
40
|
|
|
137
|
-
/**
|
|
138
|
-
* @brief Options for connecting an outbound connection object.
|
|
139
|
-
*/
|
|
140
41
|
typedef struct TirtcConnConnectOptions {
|
|
141
|
-
/**
|
|
142
|
-
* @brief Remote peer identifier.
|
|
143
|
-
*
|
|
144
|
-
* This field is required and must be non-empty.
|
|
145
|
-
*/
|
|
146
42
|
const char* peer_id;
|
|
147
43
|
|
|
148
|
-
/**
|
|
149
|
-
* @brief Authentication or session token embedded into the transport
|
|
150
|
-
* descriptor.
|
|
151
|
-
*
|
|
152
|
-
* This field is required and must be non-empty.
|
|
153
|
-
*/
|
|
154
44
|
const char* token;
|
|
155
45
|
} TirtcConnConnectOptions;
|
|
156
46
|
|
|
157
|
-
/**
|
|
158
|
-
* @brief Optional callbacks bound when a connection object is created.
|
|
159
|
-
*
|
|
160
|
-
* The implementation copies the callback table and stores the supplied
|
|
161
|
-
* user_data pointer with the created connection handle.
|
|
162
|
-
*/
|
|
163
47
|
typedef struct TirtcConnCreateOptions {
|
|
164
|
-
/** @brief Optional callbacks copied into the new connection object. */
|
|
165
48
|
const struct TirtcConnCallbacks* callbacks;
|
|
166
49
|
|
|
167
|
-
/** @brief Opaque pointer returned to connection callbacks. */
|
|
168
50
|
void* user_data;
|
|
169
51
|
} TirtcConnCreateOptions;
|
|
170
52
|
|
|
171
|
-
/** @brief Opaque handle returned by ::tirtc_conn_service_start. */
|
|
172
53
|
typedef struct TirtcConnService TirtcConnService;
|
|
173
54
|
|
|
174
|
-
/**
|
|
175
|
-
* @brief Opaque connection handle.
|
|
176
|
-
*
|
|
177
|
-
* A handle may come from either ::tirtc_conn_create or a service callback's
|
|
178
|
-
* ::TirtcConnServiceCallbacks.on_connected callback.
|
|
179
|
-
*/
|
|
180
55
|
typedef struct TirtcConn TirtcConn;
|
|
181
56
|
|
|
182
|
-
/**
|
|
183
|
-
* @brief High-level connection state reported through ::TirtcConnCallbacks.
|
|
184
|
-
*/
|
|
185
57
|
typedef enum TirtcConnState {
|
|
186
|
-
|
|
58
|
+
|
|
187
59
|
TIRTC_CONN_STATE_IDLE = 0,
|
|
188
60
|
|
|
189
|
-
/** Connection establishment is in progress. */
|
|
190
61
|
TIRTC_CONN_STATE_CONNECTING = 1,
|
|
191
62
|
|
|
192
|
-
/** Transport is connected and ready for control or media attachment. */
|
|
193
63
|
TIRTC_CONN_STATE_CONNECTED = 2,
|
|
194
64
|
|
|
195
|
-
/** Connection has entered its terminal disconnected state. */
|
|
196
65
|
TIRTC_CONN_STATE_DISCONNECTED = 3,
|
|
197
66
|
} TirtcConnState;
|
|
198
67
|
|
|
199
|
-
/**
|
|
200
|
-
* @brief Binary stream-message payload.
|
|
201
|
-
*
|
|
202
|
-
* Stream messages are intended for lightweight application-defined payloads on
|
|
203
|
-
* stream identifiers that are not currently reserved by attached audio or video
|
|
204
|
-
* routes.
|
|
205
|
-
*/
|
|
206
68
|
typedef struct TirtcStreamMessage {
|
|
207
|
-
/** @brief Sender-defined timestamp in milliseconds. */
|
|
208
69
|
uint32_t timestamp_ms;
|
|
209
70
|
|
|
210
|
-
/**
|
|
211
|
-
* @brief Pointer to payload bytes.
|
|
212
|
-
*
|
|
213
|
-
* The pointer may be NULL only when ::length is zero.
|
|
214
|
-
*/
|
|
215
71
|
const void* data;
|
|
216
72
|
|
|
217
|
-
/** @brief Payload size in bytes. */
|
|
218
73
|
size_t length;
|
|
219
74
|
} TirtcStreamMessage;
|
|
220
75
|
|
|
221
|
-
/**
|
|
222
|
-
* @brief Application-defined command payload.
|
|
223
|
-
*
|
|
224
|
-
* command is an opaque raw 32-bit value. The facade forwards it unchanged to
|
|
225
|
-
* and from the underlying transport backend.
|
|
226
|
-
*/
|
|
227
76
|
typedef struct TirtcConnCommand {
|
|
228
|
-
/** @brief Opaque raw 32-bit command word agreed with the remote peer. */
|
|
229
77
|
uint32_t command;
|
|
230
78
|
|
|
231
|
-
/** @brief Payload bytes, or NULL when ::length is zero. */
|
|
232
79
|
const void* data;
|
|
233
80
|
|
|
234
|
-
/** @brief Payload size in bytes. */
|
|
235
81
|
size_t length;
|
|
236
82
|
} TirtcConnCommand;
|
|
237
83
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
84
|
+
typedef struct TirtcConnMetricsSnapshot {
|
|
85
|
+
int has_connect_start;
|
|
86
|
+
int has_connected;
|
|
87
|
+
uint64_t connect_start_monotonic_ms;
|
|
88
|
+
uint64_t connected_monotonic_ms;
|
|
89
|
+
} TirtcConnMetricsSnapshot;
|
|
90
|
+
|
|
91
|
+
/** Heap-owned byte payload allocated by facade callback dispatch. */
|
|
92
|
+
typedef struct TirtcOwnedBytes {
|
|
93
|
+
/** Payload buffer allocated by facade, or `NULL` for zero-length payloads. */
|
|
94
|
+
void* data;
|
|
95
|
+
|
|
96
|
+
/** Number of bytes stored in `data`. */
|
|
97
|
+
size_t length;
|
|
98
|
+
} TirtcOwnedBytes;
|
|
99
|
+
|
|
100
|
+
/** Heap-owned UTF-8 string allocated by facade callback dispatch. */
|
|
101
|
+
typedef struct TirtcOwnedString {
|
|
102
|
+
/** Null-terminated UTF-8 buffer allocated by facade, or `NULL` when no message is available. */
|
|
103
|
+
char* data;
|
|
104
|
+
} TirtcOwnedString;
|
|
105
|
+
|
|
245
106
|
typedef struct TirtcConnServiceCallbacks {
|
|
246
|
-
/** @brief Called after the service has started successfully. */
|
|
247
107
|
void (*on_started)(TirtcConnService* service, void* user_data);
|
|
248
108
|
|
|
249
|
-
/** @brief Called after the service has stopped successfully. */
|
|
250
109
|
void (*on_stopped)(TirtcConnService* service, void* user_data);
|
|
251
110
|
|
|
252
|
-
/**
|
|
253
|
-
* @brief Called for each inbound connection accepted by the service.
|
|
254
|
-
*
|
|
255
|
-
* Ownership of the returned ::TirtcConn handle belongs to the caller. The
|
|
256
|
-
* caller must eventually disconnect and destroy that connection.
|
|
257
|
-
*
|
|
258
|
-
* The runtime will not dispatch other user-facing callbacks for that
|
|
259
|
-
* accepted connection until this callback returns. Callers that need full
|
|
260
|
-
* callback coverage should install the connection callbacks synchronously
|
|
261
|
-
* inside this callback before returning.
|
|
262
|
-
*/
|
|
263
111
|
void (*on_connected)(TirtcConnService* service, TirtcConn* connection, void* user_data);
|
|
264
112
|
|
|
265
|
-
/**
|
|
266
|
-
* @brief Called when the service reports an error or a promoted system event.
|
|
267
|
-
*/
|
|
268
113
|
void (*on_error)(TirtcConnService* service, TirtcError error, const char* message,
|
|
269
114
|
void* user_data);
|
|
270
115
|
} TirtcConnServiceCallbacks;
|
|
271
116
|
|
|
272
117
|
/**
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
* The implementation stores a copy of this structure inside the owning
|
|
276
|
-
* connection object.
|
|
118
|
+
* Connection observer installed through `tirtc_conn_create()` or `tirtc_conn_set_callbacks()`.
|
|
277
119
|
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
120
|
+
* For `on_command()` and `on_stream_message()`, facade copies the variable-length payload to heap
|
|
121
|
+
* memory before dispatch. The callback receives ownership of that payload and must release it with
|
|
122
|
+
* `tirtc_owned_bytes_release()` after converting or copying the bytes it needs. The release API is
|
|
123
|
+
* NULL-safe. If facade cannot allocate an owned copy for a non-empty payload, it drops that
|
|
124
|
+
* callback delivery rather than dispatching a borrowed pointer.
|
|
282
125
|
*/
|
|
283
126
|
typedef struct TirtcConnCallbacks {
|
|
284
|
-
/** @brief Called when the connection state changes or is replayed. */
|
|
285
127
|
void (*on_state_changed)(TirtcConn* connection, TirtcConnState state, TirtcError error,
|
|
286
128
|
void* user_data);
|
|
287
129
|
|
|
288
|
-
|
|
289
|
-
|
|
130
|
+
void (*on_command)(TirtcConn* connection, uint32_t command, TirtcOwnedBytes* owned_payload,
|
|
131
|
+
void* user_data);
|
|
290
132
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
*/
|
|
294
|
-
void (*on_stream_message)(TirtcConn* connection, uint8_t stream_id,
|
|
295
|
-
const TirtcStreamMessage* message, void* user_data);
|
|
133
|
+
void (*on_stream_message)(TirtcConn* connection, uint8_t stream_id, uint32_t timestamp_ms,
|
|
134
|
+
TirtcOwnedBytes* owned_payload, void* user_data);
|
|
296
135
|
} TirtcConnCallbacks;
|
|
297
136
|
|
|
298
|
-
/**
|
|
299
|
-
* @brief Initialize the global runtime.
|
|
300
|
-
*
|
|
301
|
-
* Call this exactly once before creating services, connections, audio objects,
|
|
302
|
-
* or video objects.
|
|
303
|
-
*
|
|
304
|
-
* @param options Non-NULL runtime options.
|
|
305
|
-
* @return ::TIRTC_ERROR_OK on success, or an error code when initialization
|
|
306
|
-
* fails or the runtime is already initialized.
|
|
307
|
-
*/
|
|
308
137
|
TirtcError tirtc_init(const TirtcOptions* options);
|
|
309
138
|
|
|
310
|
-
/**
|
|
311
|
-
* @brief Shut down the global runtime.
|
|
312
|
-
*
|
|
313
|
-
* This function is intentionally conservative. If any public handles are still
|
|
314
|
-
* alive, the current implementation leaves the runtime initialized and returns
|
|
315
|
-
* without tearing it down. Destroy every connection, stop every service, and
|
|
316
|
-
* destroy every media object before calling this function.
|
|
317
|
-
*/
|
|
318
139
|
void tirtc_uninit(void);
|
|
319
140
|
|
|
320
|
-
/**
|
|
321
|
-
* @brief Start a service-side listener.
|
|
322
|
-
*
|
|
323
|
-
* Only one live service is supported at a time.
|
|
324
|
-
*
|
|
325
|
-
* @param options Non-NULL start options with a non-empty license and a non-zero
|
|
326
|
-
* max_connections.
|
|
327
|
-
* @param observer Optional callback table copied by value.
|
|
328
|
-
* @param user_data Opaque pointer returned to service callbacks.
|
|
329
|
-
* @param out_service Receives the created service handle on success.
|
|
330
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
331
|
-
*/
|
|
332
141
|
TirtcError tirtc_conn_service_start(const TirtcConnServiceStartOptions* options,
|
|
333
142
|
const TirtcConnServiceCallbacks* observer, void* user_data,
|
|
334
143
|
TirtcConnService** out_service);
|
|
335
144
|
|
|
336
|
-
/**
|
|
337
|
-
* @brief Stop a service handle.
|
|
338
|
-
*
|
|
339
|
-
* Accepted connections are separate resources and are not destroyed by stopping
|
|
340
|
-
* the service. Each accepted ::TirtcConn remains the caller's responsibility.
|
|
341
|
-
* On success, the service handle is released and must not be used again.
|
|
342
|
-
*
|
|
343
|
-
* @param service Service handle to stop.
|
|
344
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
345
|
-
*/
|
|
346
145
|
TirtcError tirtc_conn_service_stop(TirtcConnService* service);
|
|
347
146
|
|
|
348
|
-
/**
|
|
349
|
-
* @brief Allocate a standalone connection handle.
|
|
350
|
-
*
|
|
351
|
-
* The runtime must already be initialized. The returned handle starts in
|
|
352
|
-
* ::TIRTC_CONN_STATE_IDLE and must be released with ::tirtc_conn_destroy.
|
|
353
|
-
*
|
|
354
|
-
* The callbacks, when provided, become part of the connection object's stable
|
|
355
|
-
* lifecycle contract. After creation succeeds, reconnects on the same handle
|
|
356
|
-
* keep using that callback table.
|
|
357
|
-
*
|
|
358
|
-
* @param options Optional creation options. Pass NULL to create a connection
|
|
359
|
-
* without callbacks.
|
|
360
|
-
* @param out_connection Receives the created connection handle on success.
|
|
361
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
362
|
-
*/
|
|
363
147
|
TirtcError tirtc_conn_create(const TirtcConnCreateOptions* options, TirtcConn** out_connection);
|
|
364
148
|
|
|
365
|
-
/**
|
|
366
|
-
* @brief Install, replace, or clear the connection callbacks.
|
|
367
|
-
*
|
|
368
|
-
* This API remains available for accepted service connections and existing
|
|
369
|
-
* consumers that still bind callbacks after handle creation. New
|
|
370
|
-
* standalone-connection callers should prefer binding callbacks through
|
|
371
|
-
* ::TirtcConnCreateOptions.
|
|
372
|
-
*
|
|
373
|
-
* Passing NULL for ::callbacks clears the current callbacks and their user
|
|
374
|
-
* data. After non-NULL callbacks are installed, the implementation
|
|
375
|
-
* immediately replays the current state through ::on_state_changed. When the
|
|
376
|
-
* current state is ::TIRTC_CONN_STATE_DISCONNECTED, the replayed callback also
|
|
377
|
-
* carries the final disconnect error.
|
|
378
|
-
*/
|
|
379
149
|
TirtcError tirtc_conn_set_callbacks(TirtcConn* connection, const TirtcConnCallbacks* callbacks,
|
|
380
150
|
void* user_data);
|
|
381
151
|
|
|
382
|
-
/**
|
|
383
|
-
* @brief Connect a standalone connection handle to a remote peer.
|
|
384
|
-
*
|
|
385
|
-
* This function is valid only for handles created by ::tirtc_conn_create.
|
|
386
|
-
* Connections accepted from a service are already transport-owned and cannot be
|
|
387
|
-
* manually connected again.
|
|
388
|
-
*
|
|
389
|
-
* After a disconnect, the same handle may be connected again.
|
|
390
|
-
*
|
|
391
|
-
* @param connection Target connection created by ::tirtc_conn_create.
|
|
392
|
-
* @param options Non-NULL connect options with non-empty peer and token values.
|
|
393
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
394
|
-
*/
|
|
395
152
|
TirtcError tirtc_conn_connect(TirtcConn* connection, const TirtcConnConnectOptions* options);
|
|
396
153
|
|
|
397
|
-
/**
|
|
398
|
-
* @brief Disconnect a connection.
|
|
399
|
-
*
|
|
400
|
-
* This call is idempotent once the connection is already idle or disconnected.
|
|
401
|
-
* Disconnecting does not destroy the handle.
|
|
402
|
-
*
|
|
403
|
-
* @param connection Target connection.
|
|
404
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
405
|
-
*/
|
|
406
154
|
TirtcError tirtc_conn_disconnect(TirtcConn* connection);
|
|
407
155
|
|
|
408
|
-
/**
|
|
409
|
-
* @brief Destroy a connection handle and release its internal transport state.
|
|
410
|
-
*
|
|
411
|
-
* Destroying a connection also detaches any currently attached audio or video
|
|
412
|
-
* objects. Those media objects are not destroyed; they return to an unbound
|
|
413
|
-
* state and remain owned by the caller.
|
|
414
|
-
*
|
|
415
|
-
* After this call returns, the connection handle is invalid and must not be
|
|
416
|
-
* reused.
|
|
417
|
-
*
|
|
418
|
-
* @param connection Connection handle to destroy.
|
|
419
|
-
*/
|
|
420
156
|
void tirtc_conn_destroy(TirtcConn* connection);
|
|
421
157
|
|
|
422
|
-
/**
|
|
423
|
-
* @brief Send an application-defined stream message.
|
|
424
|
-
*
|
|
425
|
-
* Use a stream identifier that is not currently occupied by an attached audio
|
|
426
|
-
* input, video input, or video output on the same connection.
|
|
427
|
-
*
|
|
428
|
-
* @param connection Target connection.
|
|
429
|
-
* @param stream_id Application-defined stream identifier for this message.
|
|
430
|
-
* @param message Non-NULL payload descriptor.
|
|
431
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
432
|
-
*/
|
|
433
158
|
TirtcError tirtc_conn_send_stream_message(TirtcConn* connection, uint8_t stream_id,
|
|
434
159
|
const TirtcStreamMessage* message);
|
|
435
160
|
|
|
436
|
-
/**
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
161
|
+
/** Copies a stream-message payload into a releasable owned buffer. */
|
|
162
|
+
TirtcOwnedBytes* tirtc_stream_message_copy_payload(const TirtcStreamMessage* message);
|
|
163
|
+
|
|
164
|
+
/** Copies a command payload into a releasable owned buffer. */
|
|
165
|
+
TirtcOwnedBytes* tirtc_conn_command_copy_payload(const TirtcConnCommand* command);
|
|
166
|
+
|
|
167
|
+
/** Copies a UTF-8 string into a releasable owned buffer. */
|
|
168
|
+
TirtcOwnedString* tirtc_string_copy_owned(const char* message);
|
|
169
|
+
|
|
170
|
+
/** Releases a payload received from facade owned-memory callback APIs. Safe to call with `NULL`. */
|
|
171
|
+
void tirtc_owned_bytes_release(TirtcOwnedBytes* owned);
|
|
172
|
+
|
|
173
|
+
/** Releases a string received from facade owned-memory callback APIs. Safe to call with `NULL`. */
|
|
174
|
+
void tirtc_owned_string_release(TirtcOwnedString* owned);
|
|
175
|
+
|
|
447
176
|
TirtcError tirtc_conn_send_command(TirtcConn* connection, const TirtcConnCommand* command);
|
|
448
177
|
|
|
178
|
+
TirtcError tirtc_metrics_conn_get_snapshot(TirtcConn* connection,
|
|
179
|
+
TirtcConnMetricsSnapshot* out_snapshot);
|
|
180
|
+
|
|
449
181
|
#ifdef __cplusplus
|
|
450
182
|
}
|
|
451
183
|
#endif
|
|
452
184
|
|
|
453
|
-
#endif
|
|
185
|
+
#endif
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/vendor/app-server/bin/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
platform=macos-arm64
|
|
2
2
|
profile=credential
|
|
3
|
-
staged_at_utc=2026-04-
|
|
3
|
+
staged_at_utc=2026-04-23T07:09:53Z
|
|
4
4
|
source_sdk=/Users/allenfeng/Development/Repositories/tirtc-nexus/tirtc-matrix/.build/sdk/macos-arm64
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
959ad21722979cf6a26ab90aaa32102d2496cc4bf7eed33c29da5c752d0c9893 include/tirtc/audio.h
|
|
7
7
|
6d972ccfe150a3b4f2d7f18fa92b3ade9210c1c8bb754d061ac6b7997b59e2cb include/tirtc/audio_codec.h
|
|
8
8
|
7bacbdb2d8bb10d6444036a8fef42f2a8e3ea34dfc38e165ee678d61f189db41 include/tirtc/audio_frame.h
|
|
9
9
|
84f1bbe67efa15ab3b2d995d661025aac43e2fe547a14a012a24d89cfe3cb859 include/tirtc/audio_io.h
|
|
@@ -13,20 +13,20 @@ c2e1f31dcc75be461c577d18b1cebe32774f212d51cb4dd2a5b5a9bfe62b693e include/tirtc/
|
|
|
13
13
|
51cbc911fe9f9834046f0e0a1a7cdd814a8e194a615894a8b4d11f9e5f095610 include/tirtc/audio_io_windows.h
|
|
14
14
|
21f60729117260a44af22c1af986ef17d22673b102b7b7a035f492d0665cce16 include/tirtc/audio_processing.h
|
|
15
15
|
0ca7c3c630b1242f51a0fd8154097c0a332b4c816a5707090e4381719852998c include/tirtc/audio_sample_rate.h
|
|
16
|
-
|
|
16
|
+
42a84eb93594b9e30d98ebd2eaf829b023a0f45433cd487a523c171f0dd4ced1 include/tirtc/av.h
|
|
17
17
|
4198c95c48ae579d1c782635b00fa5c9009d0c56ba466e6e3873e8298faae029 include/tirtc/credential.h
|
|
18
|
-
|
|
18
|
+
fbab0b33a735aedd07284a4f1f839bd3a6613707830a18487cad5596dd47d529 include/tirtc/error.h
|
|
19
19
|
ae805545a9515edc9b94262e72ad2c7b7d649288166f4daeb450d8a55e82ae0b include/tirtc/foundation/build_info.h
|
|
20
20
|
7cf8b372a3d48d4de4a65a04c7f102281a7b42cebb9ec247853d3c53afb63b6a include/tirtc/http.h
|
|
21
21
|
70bbf93b84d9d1a85f376d9986de570c1f658319e1e5ab6d621f7a4d41033f5c include/tirtc/logging.h
|
|
22
22
|
7e2f7f81afe37e22f5414d9db32438edd948ff775230c3a0a17ff9ac1a0b560e include/tirtc/media_codec.h
|
|
23
|
-
|
|
23
|
+
b541637a57758af98f87700ec3e929edcaa064ca7604ab45dd292ea5ad48f647 include/tirtc/media_downlink.h
|
|
24
24
|
21ef53b4d120aab600168c4082e7622c791ab4929fb20b3fb31f73ed01eee02a include/tirtc/media_fixture_av_sync.h
|
|
25
25
|
037d9a581cef71afe9233456b1f4ef866c3739150532f3c30a67d361e8af9eef include/tirtc/media_fixture_source.h
|
|
26
26
|
a4f8ab44c1a20ad37f250363a403a9d4d007e61ddb2426c7966dbc05f6a04b4f include/tirtc/media_live_source.h
|
|
27
27
|
1b3be6954e547f91a047866438bff1820c8406afaf91cef68ddee29a6ac70234 include/tirtc/media_uplink.h
|
|
28
28
|
26b831c7b8bd69b7699017427f3243cd22393c90c9518a820f5eb87eb3792483 include/tirtc/transport.h
|
|
29
|
-
|
|
29
|
+
f664c51d7df17b50f27f64d489c74d0647624b5cce1493b3df90bb6b508bf0ca include/tirtc/trp.h
|
|
30
30
|
dff5b0a0ac4a40ad17c93e1e56b3c416371c81ab365e287ea8cd6ce37ccbed3b include/tirtc/video_codec.h
|
|
31
31
|
e51379666c199588cc33279ccf52248035d1cae3d1d468b1615ebf29f0b39c9c include/tirtc/video_frame.h
|
|
32
32
|
d920afad955b9f206b02b19ca152315190fa84ab6f24e895a5b24c3ab9ffd701 include/tirtc/video_io.h
|
|
@@ -39,14 +39,14 @@ cae0bbeb884e5466a56da15182c78cc22baab6c743f349a58d3595f623333585 include/tirtc/
|
|
|
39
39
|
8db86d6714264047e8fd4086ddd7315722d675749719e6175f89eb5a636b48a1 lib/libTiRTC.a
|
|
40
40
|
b39daee6a3d39bf0ca20c45084601133c4198de8dca848dcff6dd9c70ae99016 lib/libcrypto.a
|
|
41
41
|
c052857ef315e3d61db9c862cad10709a3a6b2487dc41799cbe4d74a805de875 lib/libcrypto.dylib
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
797a8b58938be816650925cbec1a947e5765464625326a1a57ac66c9328b64f4 lib/libmatrix_runtime_audio.a
|
|
43
|
+
b822f5666456bbc62d17dfc3585a75c9bbfda07f3f768c74e3fed457f945422e lib/libmatrix_runtime_credential.a
|
|
44
|
+
d42e207ee2f1ab2233a30cfd0294ef8bb467c1d9c7c21a01f74d4422aab32c1d lib/libmatrix_runtime_facade.a
|
|
45
|
+
8c4f3e214392b4542cee913221ab27f75618da4e4caecb22874cb7cc06659ace lib/libmatrix_runtime_foundation_http.a
|
|
46
|
+
0672955c878a537a94d9ffd7089add8fe226bcecb2fd192929a28f69a8915f0e lib/libmatrix_runtime_foundation_logging.a
|
|
47
|
+
fea63056a3c41fa9055cd537dc9e7b0203d8411a3084f63d9b6623349eff1ec6 lib/libmatrix_runtime_media.a
|
|
48
|
+
d5fffd76c16881c68d984284c8bb6872d5df71ec7e3f2c345ee8cf7dd7aa5d35 lib/libmatrix_runtime_transport.a
|
|
49
|
+
f2b3fcca7d07c10fec6bd01ba18adabedd3e68489a7ef5786bf8d2bb85148d25 lib/libmatrix_runtime_video.a
|
|
50
50
|
c11c65d373a127028350c41fa58cd2d1223f2b5d70a84e13b115d90daaba25ca lib/libssl.a
|
|
51
51
|
ef1c1104bbdd2528ed7b958fb7252bd6249875f92300b0c9577d6c4bd6c0d88a lib/libssl.dylib
|
|
52
52
|
e14e846e43d64e240fa0e5745bf4e702b79d0f2442e7f768beb990610735c71b lib/libtgrtc.dylib
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export type AutoTokenIssueOptions = {
|
|
2
|
-
|
|
2
|
+
openapiEndpoint?: string;
|
|
3
3
|
accessId: string;
|
|
4
4
|
secretKey: string;
|
|
5
|
-
|
|
6
|
-
peerId: string;
|
|
7
|
-
userTtlSeconds?: number;
|
|
8
|
-
channelTtlSeconds?: number;
|
|
5
|
+
remoteId: string;
|
|
9
6
|
};
|
|
10
7
|
type RuntimeCredentialTokenIssuerOptions = {
|
|
11
8
|
repoRoot: string;
|
|
@@ -95,13 +95,10 @@ class RuntimeCredentialTokenIssuer {
|
|
|
95
95
|
let token;
|
|
96
96
|
try {
|
|
97
97
|
token = binding.issueToken({
|
|
98
|
-
|
|
98
|
+
openapiEndpoint: options.openapiEndpoint,
|
|
99
99
|
accessId: options.accessId,
|
|
100
100
|
secretKey: options.secretKey,
|
|
101
|
-
|
|
102
|
-
peerId: options.peerId,
|
|
103
|
-
userTtlSeconds: options.userTtlSeconds,
|
|
104
|
-
channelTtlSeconds: options.channelTtlSeconds,
|
|
101
|
+
remoteId: options.remoteId,
|
|
105
102
|
});
|
|
106
103
|
}
|
|
107
104
|
catch (error) {
|