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_AV_H_
|
|
2
2
|
#define TIRTC_FACADE_AV_H_
|
|
3
3
|
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
4
6
|
#include "tirtc/audio.h"
|
|
5
7
|
#include "tirtc/media_codec.h"
|
|
6
8
|
#include "tirtc/video_io.h"
|
|
@@ -13,37 +15,34 @@ extern "C" {
|
|
|
13
15
|
* @file tirtc/av.h
|
|
14
16
|
* @brief Audio-video facade layer built on top of `tirtc/audio.h`.
|
|
15
17
|
*
|
|
16
|
-
* This header adds
|
|
17
|
-
*
|
|
18
|
+
* This header adds media-object owned video producer, preview, view, and
|
|
19
|
+
* remote-consumer contracts to the transport-plus-audio facade.
|
|
18
20
|
*
|
|
19
21
|
* Typical uplink flow:
|
|
20
22
|
* 1. Create a ::TirtcVideoInput.
|
|
21
23
|
* 2. Bind a concrete capture backend with ::tirtc_video_input_set_vin.
|
|
22
24
|
* 3. Optionally configure encoding options and observers.
|
|
23
|
-
* 4. Optionally bind a preview output with
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* 6.
|
|
25
|
+
* 4. Optionally bind a preview output with ::tirtc_video_input_attach_preview.
|
|
26
|
+
* 5. Start or stop the local producer lifecycle with
|
|
27
|
+
* ::tirtc_video_input_start and ::tirtc_video_input_stop.
|
|
28
|
+
* 6. Attach or detach the input to individual connections with
|
|
29
|
+
* ::tirtc_video_input_attach and ::tirtc_video_input_detach.
|
|
30
|
+
* 7. Destroy the input when the object is no longer needed.
|
|
27
31
|
*
|
|
28
32
|
* Typical downlink flow:
|
|
29
33
|
* 1. Create a ::TirtcVideoOutput.
|
|
30
|
-
* 2. Bind a
|
|
34
|
+
* 2. Bind a local render backend with ::tirtc_video_output_attach_view.
|
|
31
35
|
* 3. Optionally install an observer.
|
|
32
|
-
* 4. Attach the output to
|
|
33
|
-
* 5.
|
|
34
|
-
*
|
|
35
|
-
* Important exclusivity rule:
|
|
36
|
-
* one ::TirtcVideoOutput can serve only one consumer at a time. It may be used
|
|
37
|
-
* either as a local preview target for one ::TirtcVideoInput or as a remote
|
|
38
|
-
* display target for one connection stream, but not both at once.
|
|
36
|
+
* 4. Attach or detach the output to select which remote stream it consumes.
|
|
37
|
+
* 5. Destroy the output when the object is no longer needed.
|
|
39
38
|
*
|
|
40
39
|
* Ownership model:
|
|
41
40
|
* - The caller owns all video input and output handles.
|
|
42
|
-
* -
|
|
43
|
-
* - Destroying a connection
|
|
44
|
-
* destroy
|
|
45
|
-
* - Destroying a
|
|
46
|
-
*
|
|
41
|
+
* - Remote attach relationships and preview/view relationships are non-owning.
|
|
42
|
+
* - Destroying a connection clears the binds that reference that connection but
|
|
43
|
+
* does not destroy media objects.
|
|
44
|
+
* - Destroying a media object is strong cleanup: it releases attach-state,
|
|
45
|
+
* preview-state, view-state, observer state, and internal pipeline state.
|
|
47
46
|
*/
|
|
48
47
|
|
|
49
48
|
/** @brief Opaque video uplink handle. */
|
|
@@ -56,31 +55,25 @@ typedef struct TirtcVideoOutput TirtcVideoOutput;
|
|
|
56
55
|
* @brief Video output state reported through ::TirtcVideoOutputObserver.
|
|
57
56
|
*/
|
|
58
57
|
typedef enum TirtcVideoOutputState {
|
|
59
|
-
/** Output is
|
|
58
|
+
/** Output currently is not consuming or rendering a remote route. */
|
|
60
59
|
TIRTC_VIDEO_OUTPUT_STATE_IDLE = 0,
|
|
61
60
|
|
|
62
|
-
/** Output is
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
/** Output is waiting for frames or recovering from a transient failure. */
|
|
66
|
-
TIRTC_VIDEO_OUTPUT_STATE_BUFFERING = 2,
|
|
67
|
-
|
|
68
|
-
/** Reserved paused state. */
|
|
69
|
-
TIRTC_VIDEO_OUTPUT_STATE_PAUSED = 3,
|
|
61
|
+
/** Output is waiting for frames or sink readiness. */
|
|
62
|
+
TIRTC_VIDEO_OUTPUT_STATE_BUFFERING = 1,
|
|
70
63
|
|
|
71
|
-
/**
|
|
72
|
-
|
|
64
|
+
/** Output is actively rendering frames. */
|
|
65
|
+
TIRTC_VIDEO_OUTPUT_STATE_RENDERING = 2,
|
|
73
66
|
|
|
74
67
|
/** Output encountered repeated rendering failures. */
|
|
75
|
-
TIRTC_VIDEO_OUTPUT_STATE_FAILED =
|
|
68
|
+
TIRTC_VIDEO_OUTPUT_STATE_FAILED = 3,
|
|
76
69
|
} TirtcVideoOutputState;
|
|
77
70
|
|
|
78
71
|
/**
|
|
79
72
|
* @brief Video input encoding options.
|
|
80
73
|
*
|
|
81
|
-
* These options are consumed when the internal video uplink pipeline is
|
|
82
|
-
* created. Configure them before the
|
|
83
|
-
* behavior.
|
|
74
|
+
* These options are consumed when the internal video uplink pipeline is
|
|
75
|
+
* created or restarted. Configure them before the next
|
|
76
|
+
* ::tirtc_video_input_start when predictable start behavior matters.
|
|
84
77
|
*/
|
|
85
78
|
typedef struct TirtcVideoInputOptions {
|
|
86
79
|
/**
|
|
@@ -125,32 +118,29 @@ typedef struct TirtcVideoInputOptions {
|
|
|
125
118
|
* @brief Optional observer for a video input object.
|
|
126
119
|
*
|
|
127
120
|
* The implementation stores a copy of this structure. Installing or replacing
|
|
128
|
-
* an observer does not replay prior state; callbacks describe subsequent
|
|
129
|
-
*
|
|
121
|
+
* an observer does not replay prior state; callbacks describe subsequent input
|
|
122
|
+
* lifecycle transitions, output-size changes, and failures.
|
|
130
123
|
*
|
|
131
|
-
* Callback delivery is not guaranteed to be on a fixed thread.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* Callers must therefore make callback logic safe for reentrant delivery.
|
|
124
|
+
* Callback delivery is not guaranteed to be on a fixed thread. Callers must
|
|
125
|
+
* therefore make callback logic safe for reentrant delivery and perform their
|
|
126
|
+
* own thread handoff when thread affinity is required.
|
|
135
127
|
*/
|
|
136
128
|
typedef struct TirtcVideoInputObserver {
|
|
137
129
|
/**
|
|
138
|
-
* @brief Called when the input
|
|
139
|
-
*
|
|
140
|
-
* In the current implementation, a start failure is reported as STOPPED with
|
|
141
|
-
* a non-OK ::error value.
|
|
130
|
+
* @brief Called when the input lifecycle state changes.
|
|
142
131
|
*/
|
|
143
|
-
void (*on_state_changed)(TirtcVideoInput* input, TirtcInputState state,
|
|
144
|
-
void* user_data);
|
|
132
|
+
void (*on_state_changed)(TirtcVideoInput* input, TirtcInputState state, void* user_data);
|
|
145
133
|
|
|
146
134
|
/**
|
|
147
|
-
* @brief
|
|
148
|
-
*
|
|
149
|
-
* The current facade implementation exposes this callback in the contract but
|
|
150
|
-
* does not currently emit it.
|
|
135
|
+
* @brief Called when the effective encoded output size changes.
|
|
151
136
|
*/
|
|
152
137
|
void (*on_output_size_changed)(TirtcVideoInput* input, uint32_t width, uint32_t height,
|
|
153
138
|
void* user_data);
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @brief Called when the input encounters an error.
|
|
142
|
+
*/
|
|
143
|
+
void (*on_error)(TirtcVideoInput* input, TirtcError error, const char* message, void* user_data);
|
|
154
144
|
} TirtcVideoInputObserver;
|
|
155
145
|
|
|
156
146
|
/**
|
|
@@ -159,30 +149,29 @@ typedef struct TirtcVideoInputObserver {
|
|
|
159
149
|
* The implementation stores a copy of this structure. Installing or replacing
|
|
160
150
|
* an observer does not replay the current output state.
|
|
161
151
|
*
|
|
162
|
-
* Callback delivery is not guaranteed to be on a fixed thread. State changes
|
|
163
|
-
* may be reported synchronously by
|
|
164
|
-
* asynchronously from the internal downlink pipeline. Callers must
|
|
165
|
-
* make callback logic safe for reentrant delivery and perform their
|
|
166
|
-
* handoff when thread affinity is required.
|
|
152
|
+
* Callback delivery is not guaranteed to be on a fixed thread. State changes,
|
|
153
|
+
* output-size changes, and failures may be reported synchronously by local API
|
|
154
|
+
* paths or asynchronously from the internal downlink pipeline. Callers must
|
|
155
|
+
* therefore make callback logic safe for reentrant delivery and perform their
|
|
156
|
+
* own thread handoff when thread affinity is required.
|
|
167
157
|
*/
|
|
168
158
|
typedef struct TirtcVideoOutputObserver {
|
|
169
159
|
/**
|
|
170
160
|
* @brief Called when the output state changes.
|
|
171
|
-
*
|
|
172
|
-
* A common sequence is IDLE after attach, then BUFFERING, then RENDERING,
|
|
173
|
-
* and IDLE again after detach or backend removal.
|
|
174
161
|
*/
|
|
175
|
-
void (*on_state_changed)(TirtcVideoOutput* output, TirtcVideoOutputState state,
|
|
176
|
-
void* user_data);
|
|
162
|
+
void (*on_state_changed)(TirtcVideoOutput* output, TirtcVideoOutputState state, void* user_data);
|
|
177
163
|
|
|
178
164
|
/**
|
|
179
|
-
* @brief
|
|
180
|
-
*
|
|
181
|
-
* The current facade implementation exposes this callback in the contract but
|
|
182
|
-
* does not currently emit it.
|
|
165
|
+
* @brief Called when the effective rendered output size changes.
|
|
183
166
|
*/
|
|
184
167
|
void (*on_output_size_changed)(TirtcVideoOutput* output, uint32_t width, uint32_t height,
|
|
185
168
|
void* user_data);
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @brief Called when the output encounters an error.
|
|
172
|
+
*/
|
|
173
|
+
void (*on_error)(TirtcVideoOutput* output, TirtcError error, const char* message,
|
|
174
|
+
void* user_data);
|
|
186
175
|
} TirtcVideoOutputObserver;
|
|
187
176
|
|
|
188
177
|
/**
|
|
@@ -204,73 +193,34 @@ TirtcError tirtc_set_media_trace_enabled(int enabled);
|
|
|
204
193
|
TirtcError tirtc_get_media_trace_enabled(int* out_enabled);
|
|
205
194
|
|
|
206
195
|
/**
|
|
207
|
-
* @brief Request
|
|
208
|
-
*
|
|
209
|
-
* This is typically used by a receiver after join, decoder recovery, or severe
|
|
210
|
-
* packet loss when waiting for the next natural key frame would be too slow.
|
|
211
|
-
*
|
|
212
|
-
* @param connection Target connection.
|
|
213
|
-
* @param stream_id Video stream identifier.
|
|
214
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
215
|
-
*/
|
|
216
|
-
TirtcError tirtc_conn_request_iframe(TirtcConn* connection, uint8_t stream_id);
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* @brief Attach a local video input to a connection stream.
|
|
220
|
-
*
|
|
221
|
-
* This bind is non-owning. The same input cannot be attached to more than one
|
|
222
|
-
* connection at a time. The selected ::stream_id must be unique across all
|
|
223
|
-
* currently attached input and output streams on the same connection.
|
|
224
|
-
*
|
|
225
|
-
* @param connection Target connection.
|
|
226
|
-
* @param stream_id Stream identifier that will carry this video route.
|
|
227
|
-
* @param input Video input to bind.
|
|
228
|
-
* @return ::TIRTC_ERROR_OK on success.
|
|
229
|
-
*/
|
|
230
|
-
TirtcError tirtc_conn_attach_video_input(TirtcConn* connection, uint8_t stream_id,
|
|
231
|
-
TirtcVideoInput* input);
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* @brief Attach a remote video output to a connection stream.
|
|
235
|
-
*
|
|
236
|
-
* The output must not currently be used as a preview target. A video output
|
|
237
|
-
* can be either a preview sink or a remote sink, but never both at the same
|
|
238
|
-
* time.
|
|
239
|
-
*
|
|
240
|
-
* If an observer is already installed, a successful attach typically reports an
|
|
241
|
-
* initial IDLE state before decoded frames begin to render.
|
|
242
|
-
* Attach is a local bind only; it does not send a remote request for this
|
|
243
|
-
* stream.
|
|
196
|
+
* @brief Request the remote sender to start sending a video stream.
|
|
244
197
|
*
|
|
245
198
|
* @param connection Target connection.
|
|
246
|
-
* @param stream_id Remote video stream identifier
|
|
247
|
-
* @param output Video output to bind.
|
|
199
|
+
* @param stream_id Remote video stream identifier.
|
|
248
200
|
* @return ::TIRTC_ERROR_OK on success.
|
|
249
201
|
*/
|
|
250
|
-
TirtcError
|
|
251
|
-
TirtcVideoOutput* output);
|
|
202
|
+
TirtcError tirtc_conn_subscribe_video(TirtcConn* connection, uint8_t stream_id);
|
|
252
203
|
|
|
253
204
|
/**
|
|
254
|
-
* @brief
|
|
255
|
-
*
|
|
256
|
-
* This call is idempotent.
|
|
205
|
+
* @brief Request the remote sender to stop sending a video stream.
|
|
257
206
|
*
|
|
258
207
|
* @param connection Target connection.
|
|
259
|
-
* @param stream_id
|
|
208
|
+
* @param stream_id Remote video stream identifier.
|
|
260
209
|
* @return ::TIRTC_ERROR_OK on success.
|
|
261
210
|
*/
|
|
262
|
-
TirtcError
|
|
211
|
+
TirtcError tirtc_conn_unsubscribe_video(TirtcConn* connection, uint8_t stream_id);
|
|
263
212
|
|
|
264
213
|
/**
|
|
265
|
-
* @brief
|
|
214
|
+
* @brief Request a key frame from the remote sender for a video stream.
|
|
266
215
|
*
|
|
267
|
-
* This
|
|
216
|
+
* This is typically used by a receiver after join, decoder recovery, or severe
|
|
217
|
+
* packet loss when waiting for the next natural key frame would be too slow.
|
|
268
218
|
*
|
|
269
219
|
* @param connection Target connection.
|
|
270
|
-
* @param stream_id
|
|
220
|
+
* @param stream_id Video stream identifier.
|
|
271
221
|
* @return ::TIRTC_ERROR_OK on success.
|
|
272
222
|
*/
|
|
273
|
-
TirtcError
|
|
223
|
+
TirtcError tirtc_conn_request_key_frame(TirtcConn* connection, uint8_t stream_id);
|
|
274
224
|
|
|
275
225
|
/**
|
|
276
226
|
* @brief Create a video input object.
|
|
@@ -282,22 +232,12 @@ TirtcError tirtc_conn_detach_video_output(TirtcConn* connection, uint8_t stream_
|
|
|
282
232
|
*/
|
|
283
233
|
TirtcError tirtc_video_input_create(TirtcVideoInput** out_input);
|
|
284
234
|
|
|
285
|
-
/**
|
|
286
|
-
* @brief Destroy a video input object.
|
|
287
|
-
*
|
|
288
|
-
* The input must already be detached from any connection. Any preview binding
|
|
289
|
-
* is cleared during destruction.
|
|
290
|
-
*
|
|
291
|
-
* @param input Input handle to destroy.
|
|
292
|
-
*/
|
|
293
|
-
void tirtc_video_input_destroy(TirtcVideoInput* input);
|
|
294
|
-
|
|
295
235
|
/**
|
|
296
236
|
* @brief Bind a concrete video capture backend to an input object.
|
|
297
237
|
*
|
|
298
|
-
* This must be done
|
|
299
|
-
*
|
|
300
|
-
*
|
|
238
|
+
* This must be done before the backend is needed by the producer pipeline. The
|
|
239
|
+
* backend pointer is non-owning and should remain valid while the input may
|
|
240
|
+
* still use it.
|
|
301
241
|
*
|
|
302
242
|
* @param input Target video input.
|
|
303
243
|
* @param vin Capture backend to bind.
|
|
@@ -308,9 +248,9 @@ TirtcError tirtc_video_input_set_vin(TirtcVideoInput* input, TirtcVideoVin* vin)
|
|
|
308
248
|
/**
|
|
309
249
|
* @brief Store video encoding options.
|
|
310
250
|
*
|
|
311
|
-
* Best practice is to call this before the
|
|
312
|
-
* options after the internal uplink pipeline has already been created
|
|
313
|
-
* retroactively rebuild that running pipeline.
|
|
251
|
+
* Best practice is to call this before the next ::tirtc_video_input_start.
|
|
252
|
+
* Updating options after the internal uplink pipeline has already been created
|
|
253
|
+
* does not retroactively rebuild that running pipeline.
|
|
314
254
|
*
|
|
315
255
|
* @param input Target video input.
|
|
316
256
|
* @param options Options to copy into the facade object.
|
|
@@ -335,101 +275,114 @@ TirtcError tirtc_video_input_set_observer(TirtcVideoInput* input,
|
|
|
335
275
|
const TirtcVideoInputObserver* observer, void* user_data);
|
|
336
276
|
|
|
337
277
|
/**
|
|
338
|
-
* @brief
|
|
278
|
+
* @brief Start the local video producer lifecycle.
|
|
339
279
|
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
280
|
+
* This only manages the producer pipeline. It does not create, remove, or
|
|
281
|
+
* replace any connection binding relationship.
|
|
342
282
|
*
|
|
343
|
-
*
|
|
344
|
-
* by ::tirtc_video_output_set_vout, and it must not currently be attached to a
|
|
345
|
-
* remote connection stream or owned by another preview input.
|
|
346
|
-
*
|
|
347
|
-
* This preview relationship is non-owning and may be established before or
|
|
348
|
-
* after ::tirtc_video_input_start. Rebinding to a different output
|
|
349
|
-
* automatically releases the previous preview relationship held by this input.
|
|
350
|
-
* When the input is already running, the new preview sink is applied to the
|
|
351
|
-
* live uplink immediately.
|
|
283
|
+
* Calling start on an already-running input is idempotent.
|
|
352
284
|
*
|
|
353
285
|
* @param input Target video input.
|
|
354
|
-
* @param output Video output to use for preview.
|
|
355
286
|
* @return ::TIRTC_ERROR_OK on success.
|
|
356
287
|
*/
|
|
357
|
-
TirtcError
|
|
288
|
+
TirtcError tirtc_video_input_start(TirtcVideoInput* input);
|
|
358
289
|
|
|
359
290
|
/**
|
|
360
|
-
* @brief
|
|
291
|
+
* @brief Stop the local video producer lifecycle.
|
|
292
|
+
*
|
|
293
|
+
* This stops capture, processing, and encoding for the input but keeps all
|
|
294
|
+
* existing attach relationships intact. Future ::tirtc_video_input_start calls
|
|
295
|
+
* may resume the same attach set.
|
|
361
296
|
*
|
|
362
|
-
*
|
|
363
|
-
* ::tirtc_video_input_set_preview_output when a preview surface is being
|
|
364
|
-
* released or repurposed for remote display. Clearing the preview relationship
|
|
365
|
-
* does not destroy the output object.
|
|
297
|
+
* Calling stop on an already-stopped input is idempotent.
|
|
366
298
|
*
|
|
367
299
|
* @param input Target video input.
|
|
368
300
|
* @return ::TIRTC_ERROR_OK on success.
|
|
369
301
|
*/
|
|
370
|
-
TirtcError
|
|
302
|
+
TirtcError tirtc_video_input_stop(TirtcVideoInput* input);
|
|
371
303
|
|
|
372
304
|
/**
|
|
373
|
-
* @brief
|
|
305
|
+
* @brief Attach a video input to a connection stream.
|
|
374
306
|
*
|
|
375
|
-
*
|
|
307
|
+
* This bind is non-owning. The same input may be attached to multiple
|
|
308
|
+
* connections at the same time, but only one stream id per connection is kept.
|
|
309
|
+
* Re-attaching the same input to the same connection replaces the prior stream
|
|
310
|
+
* id without requiring an explicit detach first.
|
|
376
311
|
*
|
|
377
|
-
*
|
|
312
|
+
* Attach only manages the binding relationship. It does not implicitly start
|
|
313
|
+
* the producer lifecycle.
|
|
314
|
+
*
|
|
315
|
+
* @param input Video input to bind.
|
|
316
|
+
* @param connection Target connection.
|
|
317
|
+
* @param stream_id Stream identifier that will carry this video route.
|
|
378
318
|
* @return ::TIRTC_ERROR_OK on success.
|
|
379
319
|
*/
|
|
380
|
-
TirtcError
|
|
320
|
+
TirtcError tirtc_video_input_attach(TirtcVideoInput* input, TirtcConn* connection,
|
|
321
|
+
uint8_t stream_id);
|
|
381
322
|
|
|
382
323
|
/**
|
|
383
|
-
* @brief
|
|
324
|
+
* @brief Detach a video input from one connection.
|
|
384
325
|
*
|
|
385
|
-
* This is
|
|
386
|
-
*
|
|
326
|
+
* This call is idempotent. It only removes the binding for the specified
|
|
327
|
+
* connection and does not implicitly stop the input lifecycle.
|
|
387
328
|
*
|
|
388
|
-
* @param input
|
|
329
|
+
* @param input Video input to unbind.
|
|
330
|
+
* @param connection Connection whose video route should be removed.
|
|
389
331
|
* @return ::TIRTC_ERROR_OK on success.
|
|
390
332
|
*/
|
|
391
|
-
TirtcError
|
|
333
|
+
TirtcError tirtc_video_input_detach(TirtcVideoInput* input, TirtcConn* connection);
|
|
392
334
|
|
|
393
335
|
/**
|
|
394
|
-
* @brief
|
|
336
|
+
* @brief Bind a preview output to a video input.
|
|
395
337
|
*
|
|
396
|
-
*
|
|
338
|
+
* Use this when local camera frames should also be rendered locally, for
|
|
339
|
+
* example in a self-preview view.
|
|
397
340
|
*
|
|
398
|
-
*
|
|
341
|
+
* The supplied output must not currently be attached to a remote connection
|
|
342
|
+
* stream or owned by another preview input. This preview relationship is
|
|
343
|
+
* non-owning and may be established before or after ::tirtc_video_input_start.
|
|
344
|
+
* Rebinding to a different output automatically releases the previous preview
|
|
345
|
+
* relationship held by this input.
|
|
346
|
+
*
|
|
347
|
+
* @param input Target video input.
|
|
348
|
+
* @param preview_output Video output to use for preview.
|
|
399
349
|
* @return ::TIRTC_ERROR_OK on success.
|
|
400
350
|
*/
|
|
401
|
-
TirtcError
|
|
351
|
+
TirtcError tirtc_video_input_attach_preview(TirtcVideoInput* input,
|
|
352
|
+
TirtcVideoOutput* preview_output);
|
|
402
353
|
|
|
403
354
|
/**
|
|
404
|
-
* @brief
|
|
355
|
+
* @brief Clear the preview output currently associated with a video input.
|
|
405
356
|
*
|
|
406
|
-
*
|
|
407
|
-
*
|
|
408
|
-
*
|
|
357
|
+
* This call is idempotent. Clearing the preview relationship does not destroy
|
|
358
|
+
* the output object and does not affect remote connection binds owned by the
|
|
359
|
+
* input.
|
|
409
360
|
*
|
|
410
|
-
* @param
|
|
361
|
+
* @param input Target video input.
|
|
362
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
411
363
|
*/
|
|
412
|
-
|
|
364
|
+
TirtcError tirtc_video_input_detach_preview(TirtcVideoInput* input);
|
|
413
365
|
|
|
414
366
|
/**
|
|
415
|
-
* @brief
|
|
367
|
+
* @brief Destroy a video input object.
|
|
416
368
|
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
*
|
|
369
|
+
* Destroy is strong cleanup. The runtime stops the input lifecycle, clears
|
|
370
|
+
* every connection bind and preview relationship owned by this input, and then
|
|
371
|
+
* releases the object.
|
|
420
372
|
*
|
|
421
|
-
*
|
|
422
|
-
|
|
423
|
-
*
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
*
|
|
373
|
+
* @param input Input handle to destroy.
|
|
374
|
+
*/
|
|
375
|
+
void tirtc_video_input_destroy(TirtcVideoInput* input);
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* @brief Create a video output object.
|
|
427
379
|
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
380
|
+
* The runtime must already be initialized.
|
|
381
|
+
*
|
|
382
|
+
* @param out_output Receives the created output handle on success.
|
|
430
383
|
* @return ::TIRTC_ERROR_OK on success.
|
|
431
384
|
*/
|
|
432
|
-
TirtcError
|
|
385
|
+
TirtcError tirtc_video_output_create(TirtcVideoOutput** out_output);
|
|
433
386
|
|
|
434
387
|
/**
|
|
435
388
|
* @brief Install, replace, or clear the video output observer.
|
|
@@ -447,6 +400,94 @@ TirtcError tirtc_video_output_set_observer(TirtcVideoOutput* output,
|
|
|
447
400
|
const TirtcVideoOutputObserver* observer,
|
|
448
401
|
void* user_data);
|
|
449
402
|
|
|
403
|
+
/**
|
|
404
|
+
* @brief Attach a local render backend to a video output.
|
|
405
|
+
*
|
|
406
|
+
* This establishes the local view/render sink relationship. It is independent
|
|
407
|
+
* from the remote route relationship managed by ::tirtc_video_output_attach.
|
|
408
|
+
* Re-attaching replaces the current local view relationship.
|
|
409
|
+
*
|
|
410
|
+
* @param output Target video output.
|
|
411
|
+
* @param view_sink Render backend to bind.
|
|
412
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
413
|
+
*/
|
|
414
|
+
TirtcError tirtc_video_output_attach_view(TirtcVideoOutput* output, TirtcVideoVout* view_sink);
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* @brief Detach the local render backend from a video output.
|
|
418
|
+
*
|
|
419
|
+
* This call is idempotent and does not implicitly detach the current remote
|
|
420
|
+
* route.
|
|
421
|
+
*
|
|
422
|
+
* @param output Target video output.
|
|
423
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
424
|
+
*/
|
|
425
|
+
TirtcError tirtc_video_output_detach_view(TirtcVideoOutput* output);
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* @brief Attach a video output to a remote connection stream.
|
|
429
|
+
*
|
|
430
|
+
* This bind is non-owning. The same output can consume only one remote route at
|
|
431
|
+
* a time. Re-attaching replaces the prior route without requiring an explicit
|
|
432
|
+
* detach first.
|
|
433
|
+
*
|
|
434
|
+
* Attach only manages the remote consume route. It does not change local view
|
|
435
|
+
* ownership.
|
|
436
|
+
*
|
|
437
|
+
* @param output Video output to bind.
|
|
438
|
+
* @param connection Target connection.
|
|
439
|
+
* @param stream_id Remote video stream identifier to render.
|
|
440
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
441
|
+
*/
|
|
442
|
+
TirtcError tirtc_video_output_attach(TirtcVideoOutput* output, TirtcConn* connection,
|
|
443
|
+
uint8_t stream_id);
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @brief Detach the current remote route from a video output.
|
|
447
|
+
*
|
|
448
|
+
* This call is idempotent. Detach only stops consuming the current remote
|
|
449
|
+
* route. It does not clear the current local view relationship.
|
|
450
|
+
*
|
|
451
|
+
* @param output Target video output.
|
|
452
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
453
|
+
*/
|
|
454
|
+
TirtcError tirtc_video_output_detach(TirtcVideoOutput* output);
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* @brief Destroy a video output object.
|
|
458
|
+
*
|
|
459
|
+
* Destroy is strong cleanup. The runtime detaches the current remote route,
|
|
460
|
+
* clears the local view relationship, clears observer state, and releases
|
|
461
|
+
* internal render pipeline state before the object is destroyed.
|
|
462
|
+
*
|
|
463
|
+
* @param output Output handle to destroy.
|
|
464
|
+
*/
|
|
465
|
+
void tirtc_video_output_destroy(TirtcVideoOutput* output);
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* @brief Start encoded raw dump for the media downlink currently owned by this output.
|
|
469
|
+
*
|
|
470
|
+
* The output must already be attached to a connection stream and have an active
|
|
471
|
+
* media downlink. The runtime records received encoded payload into the fixed
|
|
472
|
+
* logging-owned media raw dump directory and derives the dump prefix from the
|
|
473
|
+
* bound route as `<peer_id>-<stream_id>`.
|
|
474
|
+
*
|
|
475
|
+
* @param output Target video output.
|
|
476
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
477
|
+
*/
|
|
478
|
+
TirtcError tirtc_video_output_start_raw_dump(TirtcVideoOutput* output);
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* @brief Stop encoded raw dump for the media downlink currently owned by this output.
|
|
482
|
+
*
|
|
483
|
+
* This call is idempotent. Stopping seals the current dump directory and keeps
|
|
484
|
+
* collected raw data on disk.
|
|
485
|
+
*
|
|
486
|
+
* @param output Target video output.
|
|
487
|
+
* @return ::TIRTC_ERROR_OK on success.
|
|
488
|
+
*/
|
|
489
|
+
TirtcError tirtc_video_output_stop_raw_dump(TirtcVideoOutput* output);
|
|
490
|
+
|
|
450
491
|
#ifdef __cplusplus
|
|
451
492
|
}
|
|
452
493
|
#endif
|
|
@@ -22,6 +22,8 @@ typedef enum TirtcError {
|
|
|
22
22
|
TIRTC_ERROR_TRANSPORT_REMOTE_CLOSED = 13,
|
|
23
23
|
TIRTC_ERROR_TRANSPORT_CONNECTION_OTHER_ERROR = 14,
|
|
24
24
|
TIRTC_ERROR_TRANSPORT_TOKEN_EXPIRED = 15,
|
|
25
|
+
TIRTC_ERROR_DUMP_ROOT_UNAVAILABLE = 16,
|
|
26
|
+
TIRTC_ERROR_DUMP_ALREADY_ACTIVE = 17,
|
|
25
27
|
} TirtcError;
|
|
26
28
|
|
|
27
29
|
#ifdef __cplusplus
|
|
@@ -62,6 +62,9 @@ TirtcError tirtc_media_downlink_audio_get_current_pts(TirtcMediaDownlinkAudio* d
|
|
|
62
62
|
int64_t* out_pts_us);
|
|
63
63
|
TirtcError tirtc_media_downlink_audio_start(TirtcMediaDownlinkAudio* downlink);
|
|
64
64
|
TirtcError tirtc_media_downlink_audio_stop(TirtcMediaDownlinkAudio* downlink);
|
|
65
|
+
TirtcError tirtc_media_downlink_audio_start_raw_dump(TirtcMediaDownlinkAudio* downlink,
|
|
66
|
+
const char* prefix);
|
|
67
|
+
TirtcError tirtc_media_downlink_audio_stop_raw_dump(TirtcMediaDownlinkAudio* downlink);
|
|
65
68
|
|
|
66
69
|
TirtcError tirtc_media_downlink_video_create(TirtcMediaDownlinkVideo** out_downlink);
|
|
67
70
|
void tirtc_media_downlink_video_retain(TirtcMediaDownlinkVideo* downlink);
|
|
@@ -87,6 +90,9 @@ TirtcError tirtc_media_downlink_video_follow_video(TirtcMediaDownlinkVideo* foll
|
|
|
87
90
|
TirtcError tirtc_media_downlink_video_use_self_timing(TirtcMediaDownlinkVideo* downlink);
|
|
88
91
|
TirtcError tirtc_media_downlink_video_start(TirtcMediaDownlinkVideo* downlink);
|
|
89
92
|
TirtcError tirtc_media_downlink_video_stop(TirtcMediaDownlinkVideo* downlink);
|
|
93
|
+
TirtcError tirtc_media_downlink_video_start_raw_dump(TirtcMediaDownlinkVideo* downlink,
|
|
94
|
+
const char* prefix);
|
|
95
|
+
TirtcError tirtc_media_downlink_video_stop_raw_dump(TirtcMediaDownlinkVideo* downlink);
|
|
90
96
|
|
|
91
97
|
#ifdef __cplusplus
|
|
92
98
|
}
|