tirtc-devtools-cli 0.0.9 → 0.0.11
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 +17 -11
- package/USAGE.md +72 -33
- package/bin/tirtc-devtools-cli.js +1 -1
- package/dist/cli/src/bootstrap_flows.d.ts +46 -0
- package/dist/cli/src/bootstrap_flows.js +249 -0
- package/dist/{devtools/cli → cli}/src/config.d.ts +4 -15
- package/dist/{devtools/cli → cli}/src/config.js +7 -31
- package/dist/cli/src/default_paths.d.ts +3 -0
- package/dist/cli/src/default_paths.js +23 -0
- package/dist/{devtools/cli → cli}/src/embedded_paths.d.ts +1 -0
- package/dist/{devtools/cli → cli}/src/embedded_paths.js +18 -1
- package/dist/{devtools/cli → cli}/src/facade.d.ts +41 -235
- package/dist/{devtools/cli → cli}/src/facade.js +8 -27
- package/dist/cli/src/guide.js +47 -0
- package/dist/{devtools/cli → cli}/src/index.js +55 -141
- package/dist/{devtools/cli → cli}/src/session_manager.js +9 -11
- package/dist/{devtools/cli → cli}/src/token_command.js +69 -0
- package/dist/{devtools/cli → cli}/src/token_tool.d.ts +26 -0
- package/dist/{devtools/cli → cli}/src/token_tool.js +123 -22
- package/dist/{devtools/cli → cli}/src/transport.d.ts +1 -1
- package/package.json +6 -2
- package/script/ensure_ffmpeg.sh +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/credential.h +34 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/error.h +13 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/foundation/build_info.h +27 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/http.h +57 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/logging.h +3 -1
- package/vendor/app-server/bin/runtime/linux-x64/lib/libcrypto.a +0 -0
- 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/lib/libssl.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/manifest.txt +2 -32
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/audio.h +176 -133
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/av.h +223 -182
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/error.h +2 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/media_downlink.h +6 -0
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/transport.h +58 -133
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/trp.h +47 -224
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libTGTRP.a +0 -0
- package/vendor/app-server/bin/runtime/macos-arm64/lib/libTiRTC.a +0 -0
- 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 +19 -15
- package/vendor/app-server/dist/host/HostCommandCoordinator.d.ts +19 -0
- package/vendor/app-server/dist/host/HostCommandCoordinator.js +196 -0
- package/vendor/app-server/dist/host/HostProtocol.d.ts +1 -11
- package/vendor/app-server/dist/host/HostProtocol.js +3 -37
- package/vendor/app-server/dist/host/HostServer.d.ts +1 -4
- package/vendor/app-server/dist/host/HostServer.js +16 -152
- package/vendor/app-server/dist/host/RuntimeAdapter.js +2 -2
- package/vendor/app-server/dist/host/native/RuntimeCredentialTokenIssuer.js +3 -3
- package/vendor/app-server/dist/host/native/RuntimeHostBridge.js +4 -4
- package/vendor/app-server/dist/host/runtime_backed_preflight.js +2 -2
- package/vendor/app-server/dist/host/tests/helpers/runtime_e2e_local_config.js +1 -1
- package/vendor/app-server/dist/protocol/contract.d.ts +5 -64
- package/vendor/app-server/dist/protocol/contract.js +3 -12
- package/dist/devtools/cli/src/guide.js +0 -50
- package/dist/dummy.d.ts +0 -0
- package/dist/dummy.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -48
- package/vendor/app-server/bin/native/macos-arm64/libcrypto.dylib +0 -0
- package/vendor/app-server/bin/native/macos-arm64/libssl.dylib +0 -0
- package/vendor/app-server/bin/native/macos-arm64/runtime_host_napi.node +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_codec.h +0 -23
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_frame.h +0 -36
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io.h +0 -56
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_android.h +0 -19
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_apple.h +0 -19
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_harmony.h +0 -19
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_io_windows.h +0 -19
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_processing.h +0 -56
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/audio_sample_rate.h +0 -18
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_codec.h +0 -21
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_downlink.h +0 -89
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/media_uplink.h +0 -115
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/runtime.h +0 -236
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_codec.h +0 -57
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_frame.h +0 -55
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io.h +0 -46
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_android.h +0 -32
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_apple.h +0 -34
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_harmony.h +0 -32
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_io_windows.h +0 -26
- package/vendor/app-server/bin/runtime/linux-x64/include/tirtc/video_processing.h +0 -34
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/app-server/bin/runtime/linux-x64/lib/libwebrtc_apm.a +0 -0
- package/vendor/app-server/dist/host/RuntimeCredentialTokenIssuer.d.ts +0 -30
- package/vendor/app-server/dist/host/RuntimeCredentialTokenIssuer.js +0 -224
- /package/dist/{devtools/cli → cli}/src/dummy.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/dummy.js +0 -0
- /package/dist/{devtools/cli → cli}/src/ffmpeg_tool.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/ffmpeg_tool.js +0 -0
- /package/dist/{devtools/cli → cli}/src/guide.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/index.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/media_assets.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/media_assets.js +0 -0
- /package/dist/{devtools/cli → cli}/src/progress.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/progress.js +0 -0
- /package/dist/{devtools/cli → cli}/src/session_manager.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/token_command.d.ts +0 -0
- /package/dist/{devtools/cli → cli}/src/transport.js +0 -0
- /package/vendor/app-server/bin/{native/macos-arm64 → runtime/macos-arm64/lib}/libtgrtc.dylib +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#ifndef TIRTC_FACADE_AUDIO_H_
|
|
2
2
|
#define TIRTC_FACADE_AUDIO_H_
|
|
3
3
|
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
4
6
|
#include "tirtc/audio_io.h"
|
|
5
7
|
#include "tirtc/audio_processing.h"
|
|
6
8
|
#include "tirtc/trp.h"
|
|
@@ -13,28 +15,33 @@ extern "C" {
|
|
|
13
15
|
* @file tirtc/audio.h
|
|
14
16
|
* @brief Audio facade layer built on top of `tirtc/trp.h`.
|
|
15
17
|
*
|
|
16
|
-
* This header adds
|
|
17
|
-
* transport
|
|
18
|
+
* This header adds media-object owned audio producer and consumer contracts to
|
|
19
|
+
* the base transport facade.
|
|
18
20
|
*
|
|
19
21
|
* Typical uplink flow:
|
|
20
22
|
* 1. Create a ::TirtcAudioInput.
|
|
21
23
|
* 2. Bind a concrete capture backend with ::tirtc_audio_input_set_ain.
|
|
22
24
|
* 3. Optionally configure processing options and an observer.
|
|
23
|
-
* 4. Start
|
|
24
|
-
*
|
|
25
|
+
* 4. Start or stop the local producer lifecycle with
|
|
26
|
+
* ::tirtc_audio_input_start and ::tirtc_audio_input_stop.
|
|
27
|
+
* 5. Attach or detach the input to individual connections with
|
|
28
|
+
* ::tirtc_audio_input_attach and ::tirtc_audio_input_detach.
|
|
29
|
+
* 6. Destroy the input when the object is no longer needed.
|
|
25
30
|
*
|
|
26
31
|
* Typical downlink flow:
|
|
27
32
|
* 1. Create a ::TirtcAudioOutput.
|
|
28
33
|
* 2. Bind a concrete playback backend with ::tirtc_audio_output_set_aout.
|
|
29
34
|
* 3. Optionally configure playback options and an observer.
|
|
30
|
-
* 4. Attach the output to
|
|
31
|
-
* 5.
|
|
35
|
+
* 4. Attach or detach the output to select which remote stream it consumes.
|
|
36
|
+
* 5. Destroy the output when the object is no longer needed.
|
|
32
37
|
*
|
|
33
38
|
* Ownership model:
|
|
34
39
|
* - The caller owns all audio input and output handles.
|
|
35
|
-
* -
|
|
36
|
-
* - Destroying a connection
|
|
37
|
-
*
|
|
40
|
+
* - Input and output attach relationships are non-owning binds.
|
|
41
|
+
* - Destroying a connection clears the binds that reference that connection but
|
|
42
|
+
* does not destroy media objects.
|
|
43
|
+
* - Destroying a media object is strong cleanup: it releases its own
|
|
44
|
+
* attach-state, observer state, and internal pipeline state.
|
|
38
45
|
*/
|
|
39
46
|
|
|
40
47
|
/** @brief Opaque audio uplink handle. */
|
|
@@ -44,10 +51,7 @@ typedef struct TirtcAudioInput TirtcAudioInput;
|
|
|
44
51
|
typedef struct TirtcAudioOutput TirtcAudioOutput;
|
|
45
52
|
|
|
46
53
|
/**
|
|
47
|
-
* @brief Generic input state used by audio and video
|
|
48
|
-
*
|
|
49
|
-
* The current facade implementation primarily reports RUNNING and STOPPED.
|
|
50
|
-
* Callers should still handle the full enum for forward compatibility.
|
|
54
|
+
* @brief Generic input lifecycle state used by audio and video inputs.
|
|
51
55
|
*/
|
|
52
56
|
typedef enum TirtcInputState {
|
|
53
57
|
/** Input exists but has not started running yet. */
|
|
@@ -56,50 +60,42 @@ typedef enum TirtcInputState {
|
|
|
56
60
|
/** Input is actively capturing or producing data. */
|
|
57
61
|
TIRTC_INPUT_STATE_RUNNING = 1,
|
|
58
62
|
|
|
59
|
-
/**
|
|
60
|
-
|
|
63
|
+
/** Input has been explicitly stopped. */
|
|
64
|
+
TIRTC_INPUT_STATE_STOPPED = 2,
|
|
61
65
|
|
|
62
|
-
/** Input
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/** Reserved terminal failure state. */
|
|
66
|
-
TIRTC_INPUT_STATE_FAILED = 4,
|
|
66
|
+
/** Input encountered a producer-side failure. */
|
|
67
|
+
TIRTC_INPUT_STATE_FAILED = 3,
|
|
67
68
|
} TirtcInputState;
|
|
68
69
|
|
|
69
70
|
/**
|
|
70
71
|
* @brief Audio output state reported through ::TirtcAudioOutputObserver.
|
|
71
72
|
*/
|
|
72
73
|
typedef enum TirtcAudioOutputState {
|
|
73
|
-
/** Output is
|
|
74
|
+
/** Output currently is not consuming or rendering a remote route. */
|
|
74
75
|
TIRTC_AUDIO_OUTPUT_STATE_IDLE = 0,
|
|
75
76
|
|
|
76
|
-
/** Output is actively playing remote audio. */
|
|
77
|
-
TIRTC_AUDIO_OUTPUT_STATE_PLAYING = 1,
|
|
78
|
-
|
|
79
77
|
/** Output is waiting for enough decoded audio to continue playback. */
|
|
80
|
-
TIRTC_AUDIO_OUTPUT_STATE_BUFFERING =
|
|
81
|
-
|
|
82
|
-
/** Reserved paused state. */
|
|
83
|
-
TIRTC_AUDIO_OUTPUT_STATE_PAUSED = 3,
|
|
78
|
+
TIRTC_AUDIO_OUTPUT_STATE_BUFFERING = 1,
|
|
84
79
|
|
|
85
|
-
/**
|
|
86
|
-
|
|
80
|
+
/** Output is actively playing remote audio. */
|
|
81
|
+
TIRTC_AUDIO_OUTPUT_STATE_PLAYING = 2,
|
|
87
82
|
|
|
88
83
|
/** Output encountered repeated playback failures. */
|
|
89
|
-
TIRTC_AUDIO_OUTPUT_STATE_FAILED =
|
|
84
|
+
TIRTC_AUDIO_OUTPUT_STATE_FAILED = 3,
|
|
90
85
|
} TirtcAudioOutputState;
|
|
91
86
|
|
|
92
87
|
/**
|
|
93
88
|
* @brief Audio input processing options.
|
|
94
89
|
*
|
|
95
|
-
* These options are consumed when the internal uplink pipeline is created
|
|
96
|
-
* Configure them before the
|
|
90
|
+
* These options are consumed when the internal uplink pipeline is created or
|
|
91
|
+
* restarted. Configure them before the next ::tirtc_audio_input_start when
|
|
92
|
+
* predictable start behavior matters.
|
|
97
93
|
*/
|
|
98
94
|
typedef struct TirtcAudioInputOptions {
|
|
99
95
|
/**
|
|
100
96
|
* @brief Capture sample rate.
|
|
101
97
|
*
|
|
102
|
-
* The current implementation defaults to 16 kHz when this field is
|
|
98
|
+
* The current implementation defaults to 16 kHz when this field is
|
|
103
99
|
* ::TIRTC_AUDIO_SAMPLE_RATE_NONE.
|
|
104
100
|
*/
|
|
105
101
|
TirtcAudioSampleRate sample_rate;
|
|
@@ -139,23 +135,23 @@ typedef struct TirtcAudioOutputOptions {
|
|
|
139
135
|
* @brief Optional observer for an audio input object.
|
|
140
136
|
*
|
|
141
137
|
* The implementation stores a copy of this structure. Installing or replacing
|
|
142
|
-
* an observer does not replay prior state; callbacks describe subsequent
|
|
143
|
-
*
|
|
138
|
+
* an observer does not replay prior state; callbacks describe subsequent input
|
|
139
|
+
* lifecycle transitions and failures.
|
|
144
140
|
*
|
|
145
|
-
* Callback delivery is not guaranteed to be on a fixed thread.
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* Callers must therefore make callback logic safe for reentrant delivery.
|
|
141
|
+
* Callback delivery is not guaranteed to be on a fixed thread. Callers must
|
|
142
|
+
* therefore make callback logic safe for reentrant delivery and perform their
|
|
143
|
+
* own thread handoff when thread affinity is required.
|
|
149
144
|
*/
|
|
150
145
|
typedef struct TirtcAudioInputObserver {
|
|
151
146
|
/**
|
|
152
|
-
* @brief Called when the input
|
|
153
|
-
*
|
|
154
|
-
* In the current implementation, a start failure is reported as STOPPED with
|
|
155
|
-
* a non-OK ::error value.
|
|
147
|
+
* @brief Called when the input lifecycle state changes.
|
|
156
148
|
*/
|
|
157
|
-
void (*on_state_changed)(TirtcAudioInput* input, TirtcInputState state,
|
|
158
|
-
|
|
149
|
+
void (*on_state_changed)(TirtcAudioInput* input, TirtcInputState state, void* user_data);
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @brief Called when the input encounters an error.
|
|
153
|
+
*/
|
|
154
|
+
void (*on_error)(TirtcAudioInput* input, TirtcError error, const char* message, void* user_data);
|
|
159
155
|
} TirtcAudioInputObserver;
|
|
160
156
|
|
|
161
157
|
/**
|
|
@@ -173,74 +169,33 @@ typedef struct TirtcAudioInputObserver {
|
|
|
173
169
|
typedef struct TirtcAudioOutputObserver {
|
|
174
170
|
/**
|
|
175
171
|
* @brief Called when the output state changes.
|
|
176
|
-
*
|
|
177
|
-
* A common sequence is IDLE after attach, then BUFFERING, then PLAYING, and
|
|
178
|
-
* IDLE again after detach.
|
|
179
|
-
* Repeated downlink failures may eventually promote the output to FAILED.
|
|
180
172
|
*/
|
|
181
|
-
void (*on_state_changed)(TirtcAudioOutput* output, TirtcAudioOutputState state,
|
|
182
|
-
void* user_data);
|
|
183
|
-
} TirtcAudioOutputObserver;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* @brief Attach an audio input to a connection stream.
|
|
187
|
-
*
|
|
188
|
-
* This bind is non-owning. The same input cannot be attached to more than one
|
|
189
|
-
* connection at a time. The selected ::stream_id must be unique across all
|
|
190
|
-
* audio inputs, video inputs, and video outputs currently attached to the same
|
|
191
|
-
* connection.
|
|
192
|
-
*
|
|
193
|
-
* The input may be attached before or after ::tirtc_audio_input_start. Audio
|
|
194
|
-
* is actually sent only while the input is both attached and running.
|
|
195
|
-
*
|
|
196
|
-
* @param connection Target connection.
|
|
197
|
-
* @param stream_id Stream identifier that will carry this audio route.
|
|
198
|
-
* @param input Audio input to bind.
|
|
199
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
200
|
-
*/
|
|
201
|
-
TirtcError tirtc_conn_attach_audio_input(TirtcConn* connection, uint8_t stream_id,
|
|
202
|
-
TirtcAudioInput* input);
|
|
173
|
+
void (*on_state_changed)(TirtcAudioOutput* output, TirtcAudioOutputState state, void* user_data);
|
|
203
174
|
|
|
204
|
-
/**
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
*
|
|
211
|
-
* If an observer is already installed, a successful attach typically reports an
|
|
212
|
-
* initial IDLE state before playback begins.
|
|
213
|
-
*
|
|
214
|
-
* @param connection Target connection.
|
|
215
|
-
* @param stream_id Remote audio stream identifier to render.
|
|
216
|
-
* @param output Audio output to bind.
|
|
217
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
218
|
-
*/
|
|
219
|
-
TirtcError tirtc_conn_attach_audio_output(TirtcConn* connection, uint8_t stream_id,
|
|
220
|
-
TirtcAudioOutput* output);
|
|
175
|
+
/**
|
|
176
|
+
* @brief Called when the output encounters an error.
|
|
177
|
+
*/
|
|
178
|
+
void (*on_error)(TirtcAudioOutput* output, TirtcError error, const char* message,
|
|
179
|
+
void* user_data);
|
|
180
|
+
} TirtcAudioOutputObserver;
|
|
221
181
|
|
|
222
182
|
/**
|
|
223
|
-
* @brief
|
|
224
|
-
*
|
|
225
|
-
* This call is idempotent. If the stream is attached, the internal uplink path
|
|
226
|
-
* for that bind is stopped and the input returns to an unbound state.
|
|
183
|
+
* @brief Request the remote sender to start sending an audio stream.
|
|
227
184
|
*
|
|
228
185
|
* @param connection Target connection.
|
|
229
|
-
* @param stream_id
|
|
186
|
+
* @param stream_id Remote audio stream identifier.
|
|
230
187
|
* @return ::TIRTC_ERROR_OK on success.
|
|
231
188
|
*/
|
|
232
|
-
TirtcError
|
|
189
|
+
TirtcError tirtc_conn_subscribe_audio(TirtcConn* connection, uint8_t stream_id);
|
|
233
190
|
|
|
234
191
|
/**
|
|
235
|
-
* @brief
|
|
236
|
-
*
|
|
237
|
-
* This call is idempotent.
|
|
192
|
+
* @brief Request the remote sender to stop sending an audio stream.
|
|
238
193
|
*
|
|
239
194
|
* @param connection Target connection.
|
|
240
|
-
* @param stream_id
|
|
195
|
+
* @param stream_id Remote audio stream identifier.
|
|
241
196
|
* @return ::TIRTC_ERROR_OK on success.
|
|
242
197
|
*/
|
|
243
|
-
TirtcError
|
|
198
|
+
TirtcError tirtc_conn_unsubscribe_audio(TirtcConn* connection, uint8_t stream_id);
|
|
244
199
|
|
|
245
200
|
/**
|
|
246
201
|
* @brief Create an audio input object.
|
|
@@ -252,23 +207,12 @@ TirtcError tirtc_conn_detach_audio_output(TirtcConn* connection, uint8_t stream_
|
|
|
252
207
|
*/
|
|
253
208
|
TirtcError tirtc_audio_input_create(TirtcAudioInput** out_input);
|
|
254
209
|
|
|
255
|
-
/**
|
|
256
|
-
* @brief Destroy an audio input object.
|
|
257
|
-
*
|
|
258
|
-
* The input must already be detached from any connection. If the input is
|
|
259
|
-
* still bound, the current implementation keeps it alive and ignores the
|
|
260
|
-
* destroy request.
|
|
261
|
-
*
|
|
262
|
-
* @param input Input handle to destroy.
|
|
263
|
-
*/
|
|
264
|
-
void tirtc_audio_input_destroy(TirtcAudioInput* input);
|
|
265
|
-
|
|
266
210
|
/**
|
|
267
211
|
* @brief Bind a concrete audio capture backend to an input object.
|
|
268
212
|
*
|
|
269
|
-
* This must be done
|
|
270
|
-
*
|
|
271
|
-
*
|
|
213
|
+
* This must be done before the backend is needed by the producer pipeline. The
|
|
214
|
+
* backend pointer is non-owning and must remain valid while the input may still
|
|
215
|
+
* use it.
|
|
272
216
|
*
|
|
273
217
|
* @param input Target audio input.
|
|
274
218
|
* @param ain Capture backend to bind.
|
|
@@ -279,9 +223,9 @@ TirtcError tirtc_audio_input_set_ain(TirtcAudioInput* input, TirtcAudioAin* ain)
|
|
|
279
223
|
/**
|
|
280
224
|
* @brief Store audio input processing options.
|
|
281
225
|
*
|
|
282
|
-
* Best practice is to call this before the
|
|
283
|
-
* options after the internal uplink pipeline has already been created
|
|
284
|
-
* retroactively rebuild that running pipeline.
|
|
226
|
+
* Best practice is to call this before the next ::tirtc_audio_input_start.
|
|
227
|
+
* Updating options after the internal uplink pipeline has already been created
|
|
228
|
+
* does not retroactively rebuild that running pipeline.
|
|
285
229
|
*
|
|
286
230
|
* @param input Target audio input.
|
|
287
231
|
* @param options Options to copy into the facade object.
|
|
@@ -306,10 +250,12 @@ TirtcError tirtc_audio_input_set_observer(TirtcAudioInput* input,
|
|
|
306
250
|
const TirtcAudioInputObserver* observer, void* user_data);
|
|
307
251
|
|
|
308
252
|
/**
|
|
309
|
-
* @brief Start local audio
|
|
253
|
+
* @brief Start the local audio producer lifecycle.
|
|
254
|
+
*
|
|
255
|
+
* This only manages the producer pipeline. It does not create, remove, or
|
|
256
|
+
* replace any connection binding relationship.
|
|
310
257
|
*
|
|
311
|
-
*
|
|
312
|
-
* Starting twice without an intervening stop is rejected.
|
|
258
|
+
* Calling start on an already-running input is idempotent.
|
|
313
259
|
*
|
|
314
260
|
* @param input Target audio input.
|
|
315
261
|
* @return ::TIRTC_ERROR_OK on success.
|
|
@@ -317,10 +263,13 @@ TirtcError tirtc_audio_input_set_observer(TirtcAudioInput* input,
|
|
|
317
263
|
TirtcError tirtc_audio_input_start(TirtcAudioInput* input);
|
|
318
264
|
|
|
319
265
|
/**
|
|
320
|
-
* @brief Stop local audio
|
|
266
|
+
* @brief Stop the local audio producer lifecycle.
|
|
321
267
|
*
|
|
322
|
-
* This
|
|
323
|
-
*
|
|
268
|
+
* This stops capture, processing, and encoding for the input but keeps all
|
|
269
|
+
* existing attach relationships intact. Future ::tirtc_audio_input_start calls
|
|
270
|
+
* may resume the same attach set.
|
|
271
|
+
*
|
|
272
|
+
* Calling stop on an already-stopped input is idempotent.
|
|
324
273
|
*
|
|
325
274
|
* @param input Target audio input.
|
|
326
275
|
* @return ::TIRTC_ERROR_OK on success.
|
|
@@ -328,25 +277,55 @@ TirtcError tirtc_audio_input_start(TirtcAudioInput* input);
|
|
|
328
277
|
TirtcError tirtc_audio_input_stop(TirtcAudioInput* input);
|
|
329
278
|
|
|
330
279
|
/**
|
|
331
|
-
* @brief
|
|
280
|
+
* @brief Attach an audio input to a connection stream.
|
|
332
281
|
*
|
|
333
|
-
* The
|
|
282
|
+
* This bind is non-owning. The same input may be attached to multiple
|
|
283
|
+
* connections at the same time, but only one stream id per connection is kept.
|
|
284
|
+
* Re-attaching the same input to the same connection replaces the prior stream
|
|
285
|
+
* id without requiring an explicit detach first.
|
|
334
286
|
*
|
|
335
|
-
*
|
|
287
|
+
* Attach only manages the binding relationship. It does not implicitly start
|
|
288
|
+
* the producer lifecycle.
|
|
289
|
+
*
|
|
290
|
+
* @param input Audio input to bind.
|
|
291
|
+
* @param connection Target connection.
|
|
292
|
+
* @param stream_id Stream identifier that will carry this audio route.
|
|
336
293
|
* @return ::TIRTC_ERROR_OK on success.
|
|
337
294
|
*/
|
|
338
|
-
TirtcError
|
|
295
|
+
TirtcError tirtc_audio_input_attach(TirtcAudioInput* input, TirtcConn* connection,
|
|
296
|
+
uint8_t stream_id);
|
|
339
297
|
|
|
340
298
|
/**
|
|
341
|
-
* @brief
|
|
299
|
+
* @brief Detach an audio input from one connection.
|
|
342
300
|
*
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* request.
|
|
301
|
+
* This call is idempotent. It only removes the binding for the specified
|
|
302
|
+
* connection and does not implicitly stop the input lifecycle.
|
|
346
303
|
*
|
|
347
|
-
* @param
|
|
304
|
+
* @param input Audio input to unbind.
|
|
305
|
+
* @param connection Connection whose audio route should be removed.
|
|
306
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
348
307
|
*/
|
|
349
|
-
|
|
308
|
+
TirtcError tirtc_audio_input_detach(TirtcAudioInput* input, TirtcConn* connection);
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* @brief Destroy an audio input object.
|
|
312
|
+
*
|
|
313
|
+
* Destroy is strong cleanup. The runtime stops the input lifecycle and clears
|
|
314
|
+
* every attach relationship owned by this input before releasing the object.
|
|
315
|
+
*
|
|
316
|
+
* @param input Input handle to destroy.
|
|
317
|
+
*/
|
|
318
|
+
void tirtc_audio_input_destroy(TirtcAudioInput* input);
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* @brief Create an audio output object.
|
|
322
|
+
*
|
|
323
|
+
* The runtime must already be initialized.
|
|
324
|
+
*
|
|
325
|
+
* @param out_output Receives the created output handle on success.
|
|
326
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
327
|
+
*/
|
|
328
|
+
TirtcError tirtc_audio_output_create(TirtcAudioOutput** out_output);
|
|
350
329
|
|
|
351
330
|
/**
|
|
352
331
|
* @brief Bind a concrete audio playback backend to an output object.
|
|
@@ -389,6 +368,70 @@ TirtcError tirtc_audio_output_set_observer(TirtcAudioOutput* output,
|
|
|
389
368
|
const TirtcAudioOutputObserver* observer,
|
|
390
369
|
void* user_data);
|
|
391
370
|
|
|
371
|
+
/**
|
|
372
|
+
* @brief Attach an audio output to a remote connection stream.
|
|
373
|
+
*
|
|
374
|
+
* This bind is non-owning. The same output can consume only one remote route at
|
|
375
|
+
* a time. Re-attaching replaces the prior route without requiring an explicit
|
|
376
|
+
* detach first.
|
|
377
|
+
*
|
|
378
|
+
* Attach only manages the remote consume route. It does not change connection
|
|
379
|
+
* lifecycle or local sink ownership.
|
|
380
|
+
*
|
|
381
|
+
* @param output Audio output to bind.
|
|
382
|
+
* @param connection Target connection.
|
|
383
|
+
* @param stream_id Remote audio stream identifier to render.
|
|
384
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
385
|
+
*/
|
|
386
|
+
TirtcError tirtc_audio_output_attach(TirtcAudioOutput* output, TirtcConn* connection,
|
|
387
|
+
uint8_t stream_id);
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* @brief Detach the current remote route from an audio output.
|
|
391
|
+
*
|
|
392
|
+
* This call is idempotent. Detach only stops consuming the current remote
|
|
393
|
+
* route. It does not destroy the output object or its local sink.
|
|
394
|
+
*
|
|
395
|
+
* @param output Target audio output.
|
|
396
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
397
|
+
*/
|
|
398
|
+
TirtcError tirtc_audio_output_detach(TirtcAudioOutput* output);
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* @brief Destroy an audio output object.
|
|
402
|
+
*
|
|
403
|
+
* Destroy is strong cleanup. The runtime detaches the current route, clears
|
|
404
|
+
* observer state, and releases internal playback pipeline state before the
|
|
405
|
+
* object is destroyed.
|
|
406
|
+
*
|
|
407
|
+
* @param output Output handle to destroy.
|
|
408
|
+
*/
|
|
409
|
+
void tirtc_audio_output_destroy(TirtcAudioOutput* output);
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* @brief Start encoded raw dump for the media downlink currently owned by this output.
|
|
413
|
+
*
|
|
414
|
+
* The output must already be attached to a connection stream and have an active
|
|
415
|
+
* media downlink. The runtime records received encoded payload into the fixed
|
|
416
|
+
* logging-owned media raw dump directory and derives the dump prefix from the
|
|
417
|
+
* bound route as `<peer_id>-<stream_id>`.
|
|
418
|
+
*
|
|
419
|
+
* @param output Target audio output.
|
|
420
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
421
|
+
*/
|
|
422
|
+
TirtcError tirtc_audio_output_start_raw_dump(TirtcAudioOutput* output);
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* @brief Stop encoded raw dump for the media downlink currently owned by this output.
|
|
426
|
+
*
|
|
427
|
+
* This call is idempotent. Stopping seals the current dump directory and keeps
|
|
428
|
+
* collected raw data on disk.
|
|
429
|
+
*
|
|
430
|
+
* @param output Target audio output.
|
|
431
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
432
|
+
*/
|
|
433
|
+
TirtcError tirtc_audio_output_stop_raw_dump(TirtcAudioOutput* output);
|
|
434
|
+
|
|
392
435
|
#ifdef __cplusplus
|
|
393
436
|
}
|
|
394
437
|
#endif
|