tirtc-devtools-cli 0.0.10 → 0.0.12
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 +148 -41
- 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 +8 -8
- 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 +67 -153
- package/dist/{devtools/cli → cli}/src/session_manager.js +9 -11
- package/dist/{devtools/cli → cli}/src/token_command.js +80 -16
- package/dist/cli/src/token_tool.d.ts +55 -0
- package/dist/{devtools/cli → cli}/src/token_tool.js +143 -47
- 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 +44 -305
- package/vendor/app-server/bin/runtime/macos-arm64/include/tirtc/av.h +52 -372
- 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 +56 -511
- 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/devtools/cli/src/token_tool.d.ts +0 -38
- 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"
|
|
@@ -9,388 +11,125 @@
|
|
|
9
11
|
extern "C" {
|
|
10
12
|
#endif
|
|
11
13
|
|
|
12
|
-
/**
|
|
13
|
-
* @file tirtc/audio.h
|
|
14
|
-
* @brief Audio facade layer built on top of `tirtc/trp.h`.
|
|
15
|
-
*
|
|
16
|
-
* This header adds local audio capture and remote audio playback objects to the
|
|
17
|
-
* transport-facing facade.
|
|
18
|
-
*
|
|
19
|
-
* Typical uplink flow:
|
|
20
|
-
* 1. Create a ::TirtcAudioInput.
|
|
21
|
-
* 2. Bind a concrete capture backend with ::tirtc_audio_input_set_ain.
|
|
22
|
-
* 3. Optionally configure processing options and an observer.
|
|
23
|
-
* 4. Start the input and attach it to a connection stream.
|
|
24
|
-
* 5. Detach, stop, and destroy the input during shutdown.
|
|
25
|
-
*
|
|
26
|
-
* Typical downlink flow:
|
|
27
|
-
* 1. Create a ::TirtcAudioOutput.
|
|
28
|
-
* 2. Bind a concrete playback backend with ::tirtc_audio_output_set_aout.
|
|
29
|
-
* 3. Optionally configure playback options and an observer.
|
|
30
|
-
* 4. Attach the output to a connected ::TirtcConn.
|
|
31
|
-
* 5. Detach and destroy the output during shutdown.
|
|
32
|
-
*
|
|
33
|
-
* Ownership model:
|
|
34
|
-
* - The caller owns all audio input and output handles.
|
|
35
|
-
* - Attaching an object to a connection is a non-owning bind.
|
|
36
|
-
* - Destroying a connection detaches bound audio objects but does not destroy
|
|
37
|
-
* them.
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/** @brief Opaque audio uplink handle. */
|
|
41
14
|
typedef struct TirtcAudioInput TirtcAudioInput;
|
|
42
15
|
|
|
43
|
-
/** @brief Opaque audio downlink handle. */
|
|
44
16
|
typedef struct TirtcAudioOutput TirtcAudioOutput;
|
|
45
17
|
|
|
46
|
-
/**
|
|
47
|
-
* @brief Generic input state used by audio and video input observers.
|
|
48
|
-
*
|
|
49
|
-
* The current facade implementation primarily reports RUNNING and STOPPED.
|
|
50
|
-
* Callers should still handle the full enum for forward compatibility.
|
|
51
|
-
*/
|
|
52
18
|
typedef enum TirtcInputState {
|
|
53
|
-
|
|
19
|
+
|
|
54
20
|
TIRTC_INPUT_STATE_IDLE = 0,
|
|
55
21
|
|
|
56
|
-
/** Input is actively capturing or producing data. */
|
|
57
22
|
TIRTC_INPUT_STATE_RUNNING = 1,
|
|
58
23
|
|
|
59
|
-
|
|
60
|
-
TIRTC_INPUT_STATE_PAUSED = 2,
|
|
61
|
-
|
|
62
|
-
/** Input is stopped. */
|
|
63
|
-
TIRTC_INPUT_STATE_STOPPED = 3,
|
|
24
|
+
TIRTC_INPUT_STATE_STOPPED = 2,
|
|
64
25
|
|
|
65
|
-
|
|
66
|
-
TIRTC_INPUT_STATE_FAILED = 4,
|
|
26
|
+
TIRTC_INPUT_STATE_FAILED = 3,
|
|
67
27
|
} TirtcInputState;
|
|
68
28
|
|
|
69
|
-
/**
|
|
70
|
-
* @brief Audio output state reported through ::TirtcAudioOutputObserver.
|
|
71
|
-
*/
|
|
72
29
|
typedef enum TirtcAudioOutputState {
|
|
73
|
-
/** Output is attached but not currently rendering audio. */
|
|
74
|
-
TIRTC_AUDIO_OUTPUT_STATE_IDLE = 0,
|
|
75
30
|
|
|
76
|
-
|
|
77
|
-
TIRTC_AUDIO_OUTPUT_STATE_PLAYING = 1,
|
|
78
|
-
|
|
79
|
-
/** Output is waiting for enough decoded audio to continue playback. */
|
|
80
|
-
TIRTC_AUDIO_OUTPUT_STATE_BUFFERING = 2,
|
|
31
|
+
TIRTC_AUDIO_OUTPUT_STATE_IDLE = 0,
|
|
81
32
|
|
|
82
|
-
|
|
83
|
-
TIRTC_AUDIO_OUTPUT_STATE_PAUSED = 3,
|
|
33
|
+
TIRTC_AUDIO_OUTPUT_STATE_BUFFERING = 1,
|
|
84
34
|
|
|
85
|
-
|
|
86
|
-
TIRTC_AUDIO_OUTPUT_STATE_COMPLETED = 4,
|
|
35
|
+
TIRTC_AUDIO_OUTPUT_STATE_PLAYING = 2,
|
|
87
36
|
|
|
88
|
-
|
|
89
|
-
TIRTC_AUDIO_OUTPUT_STATE_FAILED = 5,
|
|
37
|
+
TIRTC_AUDIO_OUTPUT_STATE_FAILED = 3,
|
|
90
38
|
} TirtcAudioOutputState;
|
|
91
39
|
|
|
92
|
-
/**
|
|
93
|
-
* @brief Audio input processing options.
|
|
94
|
-
*
|
|
95
|
-
* These options are consumed when the internal uplink pipeline is created.
|
|
96
|
-
* Configure them before the first successful start for predictable behavior.
|
|
97
|
-
*/
|
|
98
40
|
typedef struct TirtcAudioInputOptions {
|
|
99
|
-
/**
|
|
100
|
-
* @brief Capture sample rate.
|
|
101
|
-
*
|
|
102
|
-
* The current implementation defaults to 16 kHz when this field is set to
|
|
103
|
-
* ::TIRTC_AUDIO_SAMPLE_RATE_NONE.
|
|
104
|
-
*/
|
|
105
41
|
TirtcAudioSampleRate sample_rate;
|
|
106
42
|
|
|
107
|
-
/** @brief Acoustic echo cancellation mode. */
|
|
108
43
|
TirtcAudioAecMode aec_mode;
|
|
109
44
|
|
|
110
|
-
/** @brief Automatic gain control level. */
|
|
111
45
|
TirtcAudioAgcLevel agc_level;
|
|
112
46
|
|
|
113
|
-
/** @brief Acoustic noise suppression level. */
|
|
114
47
|
TirtcAudioAnsLevel ans_level;
|
|
115
48
|
} TirtcAudioInputOptions;
|
|
116
49
|
|
|
117
|
-
/**
|
|
118
|
-
* @brief Audio output playback options.
|
|
119
|
-
*
|
|
120
|
-
* Configure these options before attaching the output to a connection. The
|
|
121
|
-
* current API does not support updating them while the output remains bound.
|
|
122
|
-
*/
|
|
123
50
|
typedef struct TirtcAudioOutputOptions {
|
|
124
|
-
/**
|
|
125
|
-
* @brief Playback volume in percent.
|
|
126
|
-
*
|
|
127
|
-
* The current implementation treats `0` as the default `100` percent.
|
|
128
|
-
*/
|
|
129
51
|
uint32_t volume_percent;
|
|
130
52
|
|
|
131
|
-
/** @brief Additional gain level forwarded to the downlink pipeline. */
|
|
132
53
|
int gain_level;
|
|
133
54
|
|
|
134
|
-
/** @brief Additional noise-reduction level forwarded to the downlink pipeline. */
|
|
135
55
|
int noise_reduction_level;
|
|
136
56
|
} TirtcAudioOutputOptions;
|
|
137
57
|
|
|
138
58
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* The implementation stores a copy of this structure. Installing or replacing
|
|
142
|
-
* an observer does not replay prior state; callbacks describe subsequent local
|
|
143
|
-
* start and stop transitions.
|
|
59
|
+
* Audio input observer.
|
|
144
60
|
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
* API calls such as ::tirtc_audio_input_start and ::tirtc_audio_input_stop.
|
|
148
|
-
* Callers must therefore make callback logic safe for reentrant delivery.
|
|
61
|
+
* `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
|
|
62
|
+
* with `tirtc_owned_string_release()` after copying or converting the string they need.
|
|
149
63
|
*/
|
|
150
64
|
typedef struct TirtcAudioInputObserver {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
* a non-OK ::error value.
|
|
156
|
-
*/
|
|
157
|
-
void (*on_state_changed)(TirtcAudioInput* input, TirtcInputState state, TirtcError error,
|
|
158
|
-
void* user_data);
|
|
65
|
+
void (*on_state_changed)(TirtcAudioInput* input, TirtcInputState state, void* user_data);
|
|
66
|
+
|
|
67
|
+
void (*on_error)(TirtcAudioInput* input, TirtcError error, TirtcOwnedString* owned_message,
|
|
68
|
+
void* user_data);
|
|
159
69
|
} TirtcAudioInputObserver;
|
|
160
70
|
|
|
161
71
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
* The implementation stores a copy of this structure. Installing or replacing
|
|
165
|
-
* an observer does not replay the current output state.
|
|
72
|
+
* Audio output observer.
|
|
166
73
|
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
* from the internal downlink pipeline. Callers must therefore make callback
|
|
170
|
-
* logic safe for reentrant delivery and perform their own thread handoff when
|
|
171
|
-
* thread affinity is required.
|
|
74
|
+
* `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
|
|
75
|
+
* with `tirtc_owned_string_release()` after copying or converting the string they need.
|
|
172
76
|
*/
|
|
173
77
|
typedef struct TirtcAudioOutputObserver {
|
|
174
|
-
|
|
175
|
-
* @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
|
-
*/
|
|
181
|
-
void (*on_state_changed)(TirtcAudioOutput* output, TirtcAudioOutputState state, TirtcError error,
|
|
182
|
-
void* user_data);
|
|
183
|
-
} TirtcAudioOutputObserver;
|
|
78
|
+
void (*on_state_changed)(TirtcAudioOutput* output, TirtcAudioOutputState state, void* user_data);
|
|
184
79
|
|
|
185
|
-
|
|
186
|
-
|
|
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);
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* @brief Attach a remote audio output to a connection stream.
|
|
206
|
-
*
|
|
207
|
-
* This bind is non-owning. The same output cannot be attached to more than
|
|
208
|
-
* one connection stream at a time. Configure the output with
|
|
209
|
-
* ::tirtc_audio_output_set_aout and any desired options before attaching it.
|
|
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);
|
|
80
|
+
void (*on_error)(TirtcAudioOutput* output, TirtcError error, TirtcOwnedString* owned_message,
|
|
81
|
+
void* user_data);
|
|
82
|
+
} TirtcAudioOutputObserver;
|
|
221
83
|
|
|
222
|
-
|
|
223
|
-
* @brief Detach an audio input from a connection stream.
|
|
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.
|
|
227
|
-
*
|
|
228
|
-
* @param connection Target connection.
|
|
229
|
-
* @param stream_id Stream identifier to detach.
|
|
230
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
231
|
-
*/
|
|
232
|
-
TirtcError tirtc_conn_detach_audio_input(TirtcConn* connection, uint8_t stream_id);
|
|
84
|
+
TirtcError tirtc_conn_subscribe_audio(TirtcConn* connection, uint8_t stream_id);
|
|
233
85
|
|
|
234
|
-
|
|
235
|
-
* @brief Detach an audio output from a connection stream.
|
|
236
|
-
*
|
|
237
|
-
* This call is idempotent.
|
|
238
|
-
*
|
|
239
|
-
* @param connection Target connection.
|
|
240
|
-
* @param stream_id Stream identifier to detach.
|
|
241
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
242
|
-
*/
|
|
243
|
-
TirtcError tirtc_conn_detach_audio_output(TirtcConn* connection, uint8_t stream_id);
|
|
86
|
+
TirtcError tirtc_conn_unsubscribe_audio(TirtcConn* connection, uint8_t stream_id);
|
|
244
87
|
|
|
245
|
-
/**
|
|
246
|
-
* @brief Create an audio input object.
|
|
247
|
-
*
|
|
248
|
-
* The runtime must already be initialized.
|
|
249
|
-
*
|
|
250
|
-
* @param out_input Receives the created input handle on success.
|
|
251
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
252
|
-
*/
|
|
253
88
|
TirtcError tirtc_audio_input_create(TirtcAudioInput** out_input);
|
|
254
89
|
|
|
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
|
-
/**
|
|
267
|
-
* @brief Bind a concrete audio capture backend to an input object.
|
|
268
|
-
*
|
|
269
|
-
* This must be done while the input is stopped and detached, before the next
|
|
270
|
-
* successful start. The backend pointer is non-owning and must remain valid
|
|
271
|
-
* while the input may still use it.
|
|
272
|
-
*
|
|
273
|
-
* @param input Target audio input.
|
|
274
|
-
* @param ain Capture backend to bind.
|
|
275
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
276
|
-
*/
|
|
277
90
|
TirtcError tirtc_audio_input_set_ain(TirtcAudioInput* input, TirtcAudioAin* ain);
|
|
278
91
|
|
|
279
|
-
/**
|
|
280
|
-
* @brief Store audio input processing options.
|
|
281
|
-
*
|
|
282
|
-
* Best practice is to call this before the first successful start. Updating
|
|
283
|
-
* options after the internal uplink pipeline has already been created does not
|
|
284
|
-
* retroactively rebuild that running pipeline.
|
|
285
|
-
*
|
|
286
|
-
* @param input Target audio input.
|
|
287
|
-
* @param options Options to copy into the facade object.
|
|
288
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
289
|
-
*/
|
|
290
92
|
TirtcError tirtc_audio_input_set_options(TirtcAudioInput* input,
|
|
291
93
|
const TirtcAudioInputOptions* options);
|
|
292
94
|
|
|
293
|
-
/**
|
|
294
|
-
* @brief Install, replace, or clear the audio input observer.
|
|
295
|
-
*
|
|
296
|
-
* Passing NULL for ::observer clears the current observer. The implementation
|
|
297
|
-
* stores a copy of the observer structure and does not require it to outlive
|
|
298
|
-
* this call.
|
|
299
|
-
*
|
|
300
|
-
* @param input Target audio input.
|
|
301
|
-
* @param observer Observer to install, or NULL to clear.
|
|
302
|
-
* @param user_data Opaque pointer returned to observer callbacks.
|
|
303
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
304
|
-
*/
|
|
305
95
|
TirtcError tirtc_audio_input_set_observer(TirtcAudioInput* input,
|
|
306
96
|
const TirtcAudioInputObserver* observer, void* user_data);
|
|
307
97
|
|
|
308
|
-
/**
|
|
309
|
-
* @brief Start local audio capture for an input object.
|
|
310
|
-
*
|
|
311
|
-
* A capture backend must already be bound with ::tirtc_audio_input_set_ain.
|
|
312
|
-
* Starting twice without an intervening stop is rejected.
|
|
313
|
-
*
|
|
314
|
-
* @param input Target audio input.
|
|
315
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
316
|
-
*/
|
|
317
98
|
TirtcError tirtc_audio_input_start(TirtcAudioInput* input);
|
|
318
99
|
|
|
319
|
-
/**
|
|
320
|
-
* @brief Stop local audio capture for an input object.
|
|
321
|
-
*
|
|
322
|
-
* This is the normal pairing call for ::tirtc_audio_input_start. The current
|
|
323
|
-
* implementation also tolerates stopping an already stopped input.
|
|
324
|
-
*
|
|
325
|
-
* @param input Target audio input.
|
|
326
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
327
|
-
*/
|
|
328
100
|
TirtcError tirtc_audio_input_stop(TirtcAudioInput* input);
|
|
329
101
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
*
|
|
333
|
-
* The runtime must already be initialized.
|
|
334
|
-
*
|
|
335
|
-
* @param out_output Receives the created output handle on success.
|
|
336
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
337
|
-
*/
|
|
338
|
-
TirtcError tirtc_audio_output_create(TirtcAudioOutput** out_output);
|
|
102
|
+
TirtcError tirtc_audio_input_attach(TirtcAudioInput* input, TirtcConn* connection,
|
|
103
|
+
uint8_t stream_id);
|
|
339
104
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
*
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
* request.
|
|
346
|
-
*
|
|
347
|
-
* @param output Output handle to destroy.
|
|
348
|
-
*/
|
|
349
|
-
void tirtc_audio_output_destroy(TirtcAudioOutput* output);
|
|
105
|
+
TirtcError tirtc_audio_input_detach(TirtcAudioInput* input, TirtcConn* connection);
|
|
106
|
+
|
|
107
|
+
void tirtc_audio_input_destroy(TirtcAudioInput* input);
|
|
108
|
+
|
|
109
|
+
TirtcError tirtc_audio_output_create(TirtcAudioOutput** out_output);
|
|
350
110
|
|
|
351
|
-
/**
|
|
352
|
-
* @brief Bind a concrete audio playback backend to an output object.
|
|
353
|
-
*
|
|
354
|
-
* The backend pointer is non-owning and should remain valid until the output
|
|
355
|
-
* has been detached and destroyed. Passing NULL is not supported by this API.
|
|
356
|
-
*
|
|
357
|
-
* @param output Target audio output.
|
|
358
|
-
* @param aout Playback backend to bind.
|
|
359
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
360
|
-
*/
|
|
361
111
|
TirtcError tirtc_audio_output_set_aout(TirtcAudioOutput* output, TirtcAudioAout* aout);
|
|
362
112
|
|
|
363
|
-
/**
|
|
364
|
-
* @brief Store audio output playback options.
|
|
365
|
-
*
|
|
366
|
-
* This call is intended for the pre-attach configuration phase. The current
|
|
367
|
-
* implementation rejects option changes while the output is attached.
|
|
368
|
-
*
|
|
369
|
-
* @param output Target audio output.
|
|
370
|
-
* @param options Options to copy into the facade object.
|
|
371
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
372
|
-
*/
|
|
373
113
|
TirtcError tirtc_audio_output_set_options(TirtcAudioOutput* output,
|
|
374
114
|
const TirtcAudioOutputOptions* options);
|
|
375
115
|
|
|
376
|
-
/**
|
|
377
|
-
* @brief Install, replace, or clear the audio output observer.
|
|
378
|
-
*
|
|
379
|
-
* Passing NULL for ::observer clears the current observer. The implementation
|
|
380
|
-
* stores a copy of the observer structure and does not require it to outlive
|
|
381
|
-
* this call.
|
|
382
|
-
*
|
|
383
|
-
* @param output Target audio output.
|
|
384
|
-
* @param observer Observer to install, or NULL to clear.
|
|
385
|
-
* @param user_data Opaque pointer returned to observer callbacks.
|
|
386
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
387
|
-
*/
|
|
388
116
|
TirtcError tirtc_audio_output_set_observer(TirtcAudioOutput* output,
|
|
389
117
|
const TirtcAudioOutputObserver* observer,
|
|
390
118
|
void* user_data);
|
|
391
119
|
|
|
120
|
+
TirtcError tirtc_audio_output_attach(TirtcAudioOutput* output, TirtcConn* connection,
|
|
121
|
+
uint8_t stream_id);
|
|
122
|
+
|
|
123
|
+
TirtcError tirtc_audio_output_detach(TirtcAudioOutput* output);
|
|
124
|
+
|
|
125
|
+
void tirtc_audio_output_destroy(TirtcAudioOutput* output);
|
|
126
|
+
|
|
127
|
+
TirtcError tirtc_audio_output_start_raw_dump(TirtcAudioOutput* output);
|
|
128
|
+
|
|
129
|
+
TirtcError tirtc_audio_output_stop_raw_dump(TirtcAudioOutput* output);
|
|
130
|
+
|
|
392
131
|
#ifdef __cplusplus
|
|
393
132
|
}
|
|
394
133
|
#endif
|
|
395
134
|
|
|
396
|
-
#endif
|
|
135
|
+
#endif
|