tirtc-devtools-cli 0.0.15 → 0.1.1
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 +5 -1
- package/USAGE.md +6 -3
- package/dist/cli/src/index.js +19 -3
- package/dist/cli/src/media_assets.js +27 -6
- package/dist/cli/src/role_driver.js +8 -3
- package/package.json +1 -1
- package/vendor/devtools/driver/linux-x64/devtools_driver_probe +0 -0
- package/vendor/devtools/driver/macos-arm64/devtools_driver_probe +0 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio.h +237 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_codec.h +23 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_frame.h +36 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_io.h +65 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_io_android.h +19 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_io_apple.h +19 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_io_harmony.h +19 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_io_windows.h +19 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_processing.h +56 -0
- package/vendor/runtime/linux-x64/include/tirtc/audio_sample_rate.h +18 -0
- package/vendor/runtime/linux-x64/include/tirtc/av.h +236 -0
- package/vendor/runtime/linux-x64/include/tirtc/error.h +102 -0
- package/vendor/runtime/linux-x64/include/tirtc/foundation/build_info.h +27 -0
- package/vendor/runtime/linux-x64/include/tirtc/http.h +57 -0
- package/vendor/runtime/linux-x64/include/tirtc/logging.h +55 -0
- package/vendor/runtime/linux-x64/include/tirtc/media_codec.h +21 -0
- package/vendor/runtime/linux-x64/include/tirtc/media_downlink.h +199 -0
- package/vendor/runtime/linux-x64/include/tirtc/media_uplink.h +120 -0
- package/vendor/runtime/linux-x64/include/tirtc/transport.h +445 -0
- package/vendor/runtime/linux-x64/include/tirtc/trp.h +187 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_codec.h +112 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_frame.h +55 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_io.h +53 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_io_android.h +34 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_io_apple.h +47 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_io_harmony.h +32 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_io_windows.h +26 -0
- package/vendor/runtime/linux-x64/include/tirtc/video_processing.h +34 -0
- package/vendor/runtime/linux-x64/lib/libTiRTC.a +0 -0
- package/vendor/runtime/linux-x64/lib/libcrypto.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/runtime/linux-x64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/runtime/linux-x64/lib/libssl.a +0 -0
- package/vendor/runtime/linux-x64/lib/libwebrtc_apm.a +0 -0
- package/vendor/runtime/linux-x64/lib/libxlog.a +0 -0
- package/vendor/runtime/linux-x64/manifest.txt +45 -0
- package/vendor/runtime/macos-arm64/include/tirtc/audio.h +21 -0
- package/vendor/runtime/macos-arm64/include/tirtc/av.h +28 -0
- package/vendor/runtime/macos-arm64/include/tirtc/error.h +41 -2
- package/vendor/runtime/macos-arm64/include/tirtc/media_downlink.h +45 -0
- package/vendor/runtime/macos-arm64/include/tirtc/video_codec.h +13 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_audio.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_facade.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_http.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_foundation_logging.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_media.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_transport.a +0 -0
- package/vendor/runtime/macos-arm64/lib/libmatrix_runtime_video.a +0 -0
- package/vendor/runtime/macos-arm64/manifest.txt +13 -13
- package/vendor/runtime/script/prepare_runtime_media_dataset.sh +15 -0
- package/vendor/devtools/driver/macos-arm64/runtime_validation_client_bin +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#ifndef TIRTC_AUDIO_PROCESSING_H_
|
|
2
|
+
#define TIRTC_AUDIO_PROCESSING_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/audio_frame.h"
|
|
5
|
+
#include "tirtc/error.h"
|
|
6
|
+
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
typedef struct TirtcAudioProcessor TirtcAudioProcessor;
|
|
12
|
+
|
|
13
|
+
typedef enum TirtcAudioAecMode {
|
|
14
|
+
TIRTC_AUDIO_AEC_MODE_DISABLED = 0,
|
|
15
|
+
TIRTC_AUDIO_AEC_MODE_ENABLED = 1,
|
|
16
|
+
} TirtcAudioAecMode;
|
|
17
|
+
|
|
18
|
+
typedef enum TirtcAudioAnsLevel {
|
|
19
|
+
TIRTC_AUDIO_ANS_LEVEL_DISABLED = 0,
|
|
20
|
+
TIRTC_AUDIO_ANS_LEVEL_LOW = 1,
|
|
21
|
+
TIRTC_AUDIO_ANS_LEVEL_MEDIUM = 2,
|
|
22
|
+
TIRTC_AUDIO_ANS_LEVEL_HIGH = 3,
|
|
23
|
+
} TirtcAudioAnsLevel;
|
|
24
|
+
|
|
25
|
+
typedef enum TirtcAudioAgcLevel {
|
|
26
|
+
TIRTC_AUDIO_AGC_LEVEL_DISABLED = 0,
|
|
27
|
+
TIRTC_AUDIO_AGC_LEVEL_LOW = 1,
|
|
28
|
+
TIRTC_AUDIO_AGC_LEVEL_MEDIUM = 2,
|
|
29
|
+
TIRTC_AUDIO_AGC_LEVEL_HIGH = 3,
|
|
30
|
+
} TirtcAudioAgcLevel;
|
|
31
|
+
|
|
32
|
+
typedef struct TirtcAudioProcessorConfig {
|
|
33
|
+
TirtcAudioSampleRate sample_rate;
|
|
34
|
+
TirtcAudioAecMode aec_mode;
|
|
35
|
+
TirtcAudioAnsLevel ans_level;
|
|
36
|
+
TirtcAudioAgcLevel agc_level;
|
|
37
|
+
} TirtcAudioProcessorConfig;
|
|
38
|
+
|
|
39
|
+
TirtcError tirtc_audio_processor_create(const TirtcAudioProcessorConfig* config,
|
|
40
|
+
TirtcAudioProcessor** out_processor);
|
|
41
|
+
void tirtc_audio_processor_destroy(TirtcAudioProcessor* processor);
|
|
42
|
+
|
|
43
|
+
TirtcError tirtc_audio_processor_set_config(TirtcAudioProcessor* processor,
|
|
44
|
+
const TirtcAudioProcessorConfig* config);
|
|
45
|
+
|
|
46
|
+
TirtcError tirtc_audio_processor_process(TirtcAudioProcessor* processor,
|
|
47
|
+
const TirtcAudioPcmFrame* in_frame,
|
|
48
|
+
TirtcAudioPcmFrame* out_frame);
|
|
49
|
+
|
|
50
|
+
TirtcError tirtc_audio_processor_reset(TirtcAudioProcessor* processor);
|
|
51
|
+
|
|
52
|
+
#ifdef __cplusplus
|
|
53
|
+
}
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
#endif // TIRTC_AUDIO_PROCESSING_H_
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#ifndef TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_
|
|
2
|
+
#define TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
typedef enum TirtcAudioSampleRate {
|
|
9
|
+
TIRTC_AUDIO_SAMPLE_RATE_NONE = 0,
|
|
10
|
+
TIRTC_AUDIO_SAMPLE_RATE_8K = 8000,
|
|
11
|
+
TIRTC_AUDIO_SAMPLE_RATE_16K = 16000,
|
|
12
|
+
} TirtcAudioSampleRate;
|
|
13
|
+
|
|
14
|
+
#ifdef __cplusplus
|
|
15
|
+
}
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#endif // TIRTC_MEDIA_CONTRACT_AUDIO_SAMPLE_RATE_H_
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#ifndef TIRTC_FACADE_AV_H_
|
|
2
|
+
#define TIRTC_FACADE_AV_H_
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
6
|
+
#include "tirtc/audio.h"
|
|
7
|
+
#include "tirtc/media_codec.h"
|
|
8
|
+
#include "tirtc/video_codec.h"
|
|
9
|
+
#include "tirtc/video_io.h"
|
|
10
|
+
|
|
11
|
+
#ifdef __cplusplus
|
|
12
|
+
extern "C" {
|
|
13
|
+
#endif
|
|
14
|
+
|
|
15
|
+
typedef struct TirtcVideoInput TirtcVideoInput;
|
|
16
|
+
|
|
17
|
+
typedef struct TirtcVideoEncodedInput TirtcVideoEncodedInput;
|
|
18
|
+
|
|
19
|
+
typedef struct TirtcVideoOutput TirtcVideoOutput;
|
|
20
|
+
|
|
21
|
+
typedef enum TirtcVideoOutputState {
|
|
22
|
+
|
|
23
|
+
TIRTC_VIDEO_OUTPUT_STATE_IDLE = 0,
|
|
24
|
+
|
|
25
|
+
TIRTC_VIDEO_OUTPUT_STATE_BUFFERING = 1,
|
|
26
|
+
|
|
27
|
+
TIRTC_VIDEO_OUTPUT_STATE_RENDERING = 2,
|
|
28
|
+
|
|
29
|
+
TIRTC_VIDEO_OUTPUT_STATE_FAILED = 3,
|
|
30
|
+
} TirtcVideoOutputState;
|
|
31
|
+
|
|
32
|
+
typedef struct TirtcVideoOutputStartupMetrics {
|
|
33
|
+
int has_connect_start;
|
|
34
|
+
int has_connected;
|
|
35
|
+
int has_first_video_input;
|
|
36
|
+
int has_first_video_decoded;
|
|
37
|
+
int has_first_video_rendered;
|
|
38
|
+
uint64_t connect_start_monotonic_ms;
|
|
39
|
+
uint64_t connected_monotonic_ms;
|
|
40
|
+
uint64_t first_video_input_monotonic_ms;
|
|
41
|
+
uint64_t first_video_decoded_monotonic_ms;
|
|
42
|
+
uint64_t first_video_rendered_monotonic_ms;
|
|
43
|
+
} TirtcVideoOutputStartupMetrics;
|
|
44
|
+
|
|
45
|
+
typedef struct TirtcVideoOutputMetricsSnapshot {
|
|
46
|
+
TirtcVideoOutputStartupMetrics startup;
|
|
47
|
+
TirtcOutputStutterMetrics stutter;
|
|
48
|
+
TirtcPendingDurationMetrics pending;
|
|
49
|
+
} TirtcVideoOutputMetricsSnapshot;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Diagnostic facts currently known for a video output.
|
|
53
|
+
*
|
|
54
|
+
* The snapshot is a caller-owned value copy. `resolved_decoder_backend` is the runtime route that
|
|
55
|
+
* has actually locked, so AUTO fallback reports the concrete backend family instead of the request.
|
|
56
|
+
* Zero values mean no current fact or only cached zero-state is available. Additive changes require
|
|
57
|
+
* a new V2 struct/function instead of extending this layout.
|
|
58
|
+
*/
|
|
59
|
+
typedef struct TirtcVideoOutputDebugSnapshot {
|
|
60
|
+
TirtcMediaCodec codec;
|
|
61
|
+
TirtcVideoBitstreamFormat bitstream_format;
|
|
62
|
+
uint32_t width;
|
|
63
|
+
uint32_t height;
|
|
64
|
+
TirtcVideoDecoderPreference requested_decoder_preference;
|
|
65
|
+
TirtcVideoDecoderBackendKind resolved_decoder_backend;
|
|
66
|
+
} TirtcVideoOutputDebugSnapshot;
|
|
67
|
+
|
|
68
|
+
typedef struct TirtcVideoOutputOptions {
|
|
69
|
+
TirtcVideoDecoderPreference decoder_preference;
|
|
70
|
+
} TirtcVideoOutputOptions;
|
|
71
|
+
|
|
72
|
+
typedef struct TirtcVideoInputOptions {
|
|
73
|
+
TirtcMediaCodec codec;
|
|
74
|
+
|
|
75
|
+
uint32_t width;
|
|
76
|
+
|
|
77
|
+
uint32_t height;
|
|
78
|
+
|
|
79
|
+
uint32_t fps;
|
|
80
|
+
|
|
81
|
+
uint32_t bitrate_kbps;
|
|
82
|
+
|
|
83
|
+
TirtcVideoEncoderPreference encoder_preference;
|
|
84
|
+
} TirtcVideoInputOptions;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Video input observer.
|
|
88
|
+
*
|
|
89
|
+
* `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
|
|
90
|
+
* with `tirtc_owned_string_release()` after copying or converting the string they need.
|
|
91
|
+
*/
|
|
92
|
+
typedef struct TirtcVideoInputObserver {
|
|
93
|
+
void (*on_state_changed)(TirtcVideoInput* input, TirtcInputState state, void* user_data);
|
|
94
|
+
|
|
95
|
+
void (*on_output_size_changed)(TirtcVideoInput* input, uint32_t width, uint32_t height,
|
|
96
|
+
void* user_data);
|
|
97
|
+
|
|
98
|
+
void (*on_error)(TirtcVideoInput* input, TirtcError error, TirtcOwnedString* owned_message,
|
|
99
|
+
void* user_data);
|
|
100
|
+
} TirtcVideoInputObserver;
|
|
101
|
+
|
|
102
|
+
typedef struct TirtcVideoEncodedInputOptions {
|
|
103
|
+
TirtcMediaCodec codec;
|
|
104
|
+
TirtcVideoBitstreamFormat bitstream_format;
|
|
105
|
+
} TirtcVideoEncodedInputOptions;
|
|
106
|
+
|
|
107
|
+
typedef struct TirtcVideoEncodedInputObserver {
|
|
108
|
+
void (*on_state_changed)(TirtcVideoEncodedInput* input, TirtcInputState state, void* user_data);
|
|
109
|
+
|
|
110
|
+
void (*on_output_size_changed)(TirtcVideoEncodedInput* input, uint32_t width, uint32_t height,
|
|
111
|
+
void* user_data);
|
|
112
|
+
|
|
113
|
+
void (*on_error)(TirtcVideoEncodedInput* input, TirtcError error, TirtcOwnedString* owned_message,
|
|
114
|
+
void* user_data);
|
|
115
|
+
|
|
116
|
+
void (*on_key_frame_requested)(TirtcVideoEncodedInput* input, void* user_data);
|
|
117
|
+
} TirtcVideoEncodedInputObserver;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Video output observer.
|
|
121
|
+
*
|
|
122
|
+
* `owned_message` is allocated by facade for this callback dispatch. Consumers must release it
|
|
123
|
+
* with `tirtc_owned_string_release()` after copying or converting the string they need.
|
|
124
|
+
*/
|
|
125
|
+
typedef struct TirtcVideoOutputObserver {
|
|
126
|
+
void (*on_state_changed)(TirtcVideoOutput* output, TirtcVideoOutputState state, void* user_data);
|
|
127
|
+
|
|
128
|
+
void (*on_output_size_changed)(TirtcVideoOutput* output, uint32_t width, uint32_t height,
|
|
129
|
+
void* user_data);
|
|
130
|
+
|
|
131
|
+
void (*on_error)(TirtcVideoOutput* output, TirtcError error, TirtcOwnedString* owned_message,
|
|
132
|
+
void* user_data);
|
|
133
|
+
} TirtcVideoOutputObserver;
|
|
134
|
+
|
|
135
|
+
TirtcError tirtc_set_media_trace_enabled(int enabled);
|
|
136
|
+
|
|
137
|
+
TirtcError tirtc_get_media_trace_enabled(int* out_enabled);
|
|
138
|
+
|
|
139
|
+
TirtcError tirtc_conn_subscribe_video(TirtcConn* connection, uint8_t stream_id);
|
|
140
|
+
|
|
141
|
+
TirtcError tirtc_conn_unsubscribe_video(TirtcConn* connection, uint8_t stream_id);
|
|
142
|
+
|
|
143
|
+
TirtcError tirtc_conn_request_key_frame(TirtcConn* connection, uint8_t stream_id);
|
|
144
|
+
|
|
145
|
+
TirtcError tirtc_video_input_create(TirtcVideoInput** out_input);
|
|
146
|
+
|
|
147
|
+
TirtcError tirtc_video_input_set_vin(TirtcVideoInput* input, TirtcVideoVin* vin);
|
|
148
|
+
|
|
149
|
+
TirtcError tirtc_video_input_set_options(TirtcVideoInput* input,
|
|
150
|
+
const TirtcVideoInputOptions* options);
|
|
151
|
+
|
|
152
|
+
TirtcError tirtc_video_input_set_observer(TirtcVideoInput* input,
|
|
153
|
+
const TirtcVideoInputObserver* observer, void* user_data);
|
|
154
|
+
|
|
155
|
+
TirtcError tirtc_video_input_start(TirtcVideoInput* input);
|
|
156
|
+
|
|
157
|
+
TirtcError tirtc_video_input_stop(TirtcVideoInput* input);
|
|
158
|
+
|
|
159
|
+
TirtcError tirtc_video_input_attach(TirtcVideoInput* input, TirtcConn* connection,
|
|
160
|
+
uint8_t stream_id);
|
|
161
|
+
|
|
162
|
+
TirtcError tirtc_video_input_detach(TirtcVideoInput* input, TirtcConn* connection);
|
|
163
|
+
|
|
164
|
+
TirtcError tirtc_video_input_attach_preview(TirtcVideoInput* input,
|
|
165
|
+
TirtcVideoOutput* preview_output);
|
|
166
|
+
|
|
167
|
+
TirtcError tirtc_video_input_detach_preview(TirtcVideoInput* input);
|
|
168
|
+
|
|
169
|
+
void tirtc_video_input_destroy(TirtcVideoInput* input);
|
|
170
|
+
|
|
171
|
+
TirtcError tirtc_video_encoded_input_create(TirtcVideoEncodedInput** out_input);
|
|
172
|
+
|
|
173
|
+
TirtcError tirtc_video_encoded_input_set_options(TirtcVideoEncodedInput* input,
|
|
174
|
+
const TirtcVideoEncodedInputOptions* options);
|
|
175
|
+
|
|
176
|
+
TirtcError tirtc_video_encoded_input_set_observer(TirtcVideoEncodedInput* input,
|
|
177
|
+
const TirtcVideoEncodedInputObserver* observer,
|
|
178
|
+
void* user_data);
|
|
179
|
+
|
|
180
|
+
TirtcError tirtc_video_encoded_input_start(TirtcVideoEncodedInput* input);
|
|
181
|
+
|
|
182
|
+
TirtcError tirtc_video_encoded_input_stop(TirtcVideoEncodedInput* input);
|
|
183
|
+
|
|
184
|
+
TirtcError tirtc_video_encoded_input_attach(TirtcVideoEncodedInput* input, TirtcConn* connection,
|
|
185
|
+
uint8_t stream_id);
|
|
186
|
+
|
|
187
|
+
TirtcError tirtc_video_encoded_input_detach(TirtcVideoEncodedInput* input, TirtcConn* connection);
|
|
188
|
+
|
|
189
|
+
TirtcError tirtc_video_encoded_input_submit_frame(TirtcVideoEncodedInput* input,
|
|
190
|
+
const TirtcVideoEncodedFrame* frame);
|
|
191
|
+
|
|
192
|
+
void tirtc_video_encoded_input_destroy(TirtcVideoEncodedInput* input);
|
|
193
|
+
|
|
194
|
+
TirtcError tirtc_video_output_create(TirtcVideoOutput** out_output);
|
|
195
|
+
|
|
196
|
+
TirtcError tirtc_video_output_set_options(TirtcVideoOutput* output,
|
|
197
|
+
const TirtcVideoOutputOptions* options);
|
|
198
|
+
|
|
199
|
+
TirtcError tirtc_video_output_set_observer(TirtcVideoOutput* output,
|
|
200
|
+
const TirtcVideoOutputObserver* observer,
|
|
201
|
+
void* user_data);
|
|
202
|
+
|
|
203
|
+
TirtcError tirtc_video_output_attach_view(TirtcVideoOutput* output, TirtcVideoVout* view_sink);
|
|
204
|
+
|
|
205
|
+
TirtcError tirtc_video_output_detach_view(TirtcVideoOutput* output);
|
|
206
|
+
|
|
207
|
+
TirtcError tirtc_video_output_attach(TirtcVideoOutput* output, TirtcConn* connection,
|
|
208
|
+
uint8_t stream_id);
|
|
209
|
+
|
|
210
|
+
TirtcError tirtc_video_output_detach(TirtcVideoOutput* output);
|
|
211
|
+
|
|
212
|
+
void tirtc_video_output_destroy(TirtcVideoOutput* output);
|
|
213
|
+
|
|
214
|
+
TirtcError tirtc_video_output_start_raw_dump(TirtcVideoOutput* output);
|
|
215
|
+
|
|
216
|
+
TirtcError tirtc_video_output_stop_raw_dump(TirtcVideoOutput* output);
|
|
217
|
+
|
|
218
|
+
TirtcError tirtc_metrics_video_output_get_snapshot(TirtcVideoOutput* output,
|
|
219
|
+
TirtcVideoOutputMetricsSnapshot* out_snapshot);
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Copies the current or cached video output diagnostic snapshot.
|
|
223
|
+
*
|
|
224
|
+
* The output owns the underlying media downlink and the returned data is only a value copy. Use
|
|
225
|
+
* this for diagnostics and UI visibility, not to drive decoder selection. The function returns
|
|
226
|
+
* `TIRTC_ERROR_INVALID_ARGUMENT` for null arguments and does not emit output callbacks or change
|
|
227
|
+
* output state.
|
|
228
|
+
*/
|
|
229
|
+
TirtcError tirtc_video_output_get_debug_snapshot(TirtcVideoOutput* output,
|
|
230
|
+
TirtcVideoOutputDebugSnapshot* out_snapshot);
|
|
231
|
+
|
|
232
|
+
#ifdef __cplusplus
|
|
233
|
+
}
|
|
234
|
+
#endif
|
|
235
|
+
|
|
236
|
+
#endif
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
#ifndef TIRTC_FOUNDATION_ERROR_H_
|
|
2
|
+
#define TIRTC_FOUNDATION_ERROR_H_
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
typedef enum TirtcError {
|
|
9
|
+
TIRTC_ERROR_OK = 0,
|
|
10
|
+
TIRTC_ERROR_INVALID_ARGUMENT = 6000,
|
|
11
|
+
TIRTC_ERROR_NOT_INITIALIZED = 6001,
|
|
12
|
+
TIRTC_ERROR_UNSUPPORTED_LOOP_POLICY = 6004,
|
|
13
|
+
TIRTC_ERROR_SOURCE_HASH_MISMATCH = 6005,
|
|
14
|
+
TIRTC_ERROR_ALREADY_STOPPED = 6006,
|
|
15
|
+
TIRTC_ERROR_STOPPED = TIRTC_ERROR_ALREADY_STOPPED,
|
|
16
|
+
TIRTC_ERROR_ALREADY_DESTROYED = 6007,
|
|
17
|
+
TIRTC_ERROR_DESTROYED = TIRTC_ERROR_ALREADY_DESTROYED,
|
|
18
|
+
TIRTC_ERROR_TRANSPORT_INVALID_LICENSE = 6008,
|
|
19
|
+
TIRTC_ERROR_TRANSPORT_TIMEOUT = 6009,
|
|
20
|
+
TIRTC_ERROR_TRANSPORT_BUSY = 6010,
|
|
21
|
+
TIRTC_ERROR_TRANSPORT_CONNECTION_TIMEOUT_CLOSED = 6011,
|
|
22
|
+
TIRTC_ERROR_TRANSPORT_REMOTE_CLOSED = 6012,
|
|
23
|
+
TIRTC_ERROR_TRANSPORT_CONNECTION_OTHER_ERROR = 6013,
|
|
24
|
+
TIRTC_ERROR_TRANSPORT_TOKEN_EXPIRED = 6014,
|
|
25
|
+
TIRTC_ERROR_DUMP_ROOT_UNAVAILABLE = 6015,
|
|
26
|
+
TIRTC_ERROR_DUMP_ALREADY_ACTIVE = 6016,
|
|
27
|
+
TIRTC_ERROR_TRANSPORT_RESOURCE_EXHAUSTED = 6017,
|
|
28
|
+
TIRTC_ERROR_TRANSPORT_SERVER_ERROR = 6018,
|
|
29
|
+
TIRTC_ERROR_TRANSPORT_BACKEND_INTERNAL_ERROR = 6019,
|
|
30
|
+
TIRTC_ERROR_TRANSPORT_NO_SECRET_KEY = 6020,
|
|
31
|
+
TIRTC_ERROR_TRANSPORT_UNEXPECTED_RESPONSE = 6021,
|
|
32
|
+
TIRTC_ERROR_ALREADY_INITIALIZED = 6022,
|
|
33
|
+
TIRTC_ERROR_INVALID_THREAD = 6023,
|
|
34
|
+
TIRTC_ERROR_PERMISSION_DENIED = 6024,
|
|
35
|
+
TIRTC_ERROR_ALREADY_BOUND = 6025,
|
|
36
|
+
TIRTC_ERROR_IN_USE = 6026,
|
|
37
|
+
TIRTC_ERROR_NOT_STARTED = 6027,
|
|
38
|
+
TIRTC_ERROR_NOT_CONNECTED = 6028,
|
|
39
|
+
TIRTC_ERROR_NOT_BOUND = 6029,
|
|
40
|
+
TIRTC_ERROR_NOT_CONFIGURED = 6030,
|
|
41
|
+
TIRTC_ERROR_NOT_OPEN = 6031,
|
|
42
|
+
TIRTC_ERROR_APP_ID_REQUIRED = 6032,
|
|
43
|
+
TIRTC_ERROR_VIDEO_ENCODER_BACKEND_UNAVAILABLE = 6033,
|
|
44
|
+
TIRTC_ERROR_VIDEO_ENCODER_CODEC_UNSUPPORTED = 6034,
|
|
45
|
+
TIRTC_ERROR_VIDEO_ENCODER_INITIALIZATION_FAILED = 6035,
|
|
46
|
+
TIRTC_ERROR_VIDEO_DECODER_CODEC_UNSUPPORTED = 6036,
|
|
47
|
+
TIRTC_ERROR_VIDEO_DECODER_BACKEND_UNAVAILABLE = 6037,
|
|
48
|
+
TIRTC_ERROR_VIDEO_DECODER_INITIALIZATION_FAILED = 6038,
|
|
49
|
+
TIRTC_ERROR_VIDEO_DECODER_CONFIGURATION_FAILED = 6039,
|
|
50
|
+
TIRTC_ERROR_VIDEO_DECODER_RUNTIME_FAILED = 6040,
|
|
51
|
+
TIRTC_ERROR_VIDEO_OUTPUT_TARGET_UNAVAILABLE = 6041,
|
|
52
|
+
TIRTC_ERROR_VIDEO_OUTPUT_RENDER_FAILED = 6042,
|
|
53
|
+
TIRTC_ERROR_RESOURCE_EXHAUSTED = 6043,
|
|
54
|
+
TIRTC_ERROR_FILE_OPEN_FAILED = 6044,
|
|
55
|
+
TIRTC_ERROR_FILE_READ_FAILED = 6045,
|
|
56
|
+
TIRTC_ERROR_FILE_WRITE_FAILED = 6046,
|
|
57
|
+
TIRTC_ERROR_HTTP_REQUEST_FAILED = 6047,
|
|
58
|
+
TIRTC_ERROR_LOG_EXPORT_FAILED = 6048,
|
|
59
|
+
TIRTC_ERROR_LOG_UPLOAD_FAILED = 6049,
|
|
60
|
+
TIRTC_ERROR_S3_UPLOAD_FAILED = 6050,
|
|
61
|
+
TIRTC_ERROR_AUDIO_INPUT_OPEN_FAILED = 6051,
|
|
62
|
+
TIRTC_ERROR_AUDIO_INPUT_RUNTIME_FAILED = 6052,
|
|
63
|
+
TIRTC_ERROR_AUDIO_OUTPUT_OPEN_FAILED = 6053,
|
|
64
|
+
TIRTC_ERROR_AUDIO_OUTPUT_RUNTIME_FAILED = 6054,
|
|
65
|
+
TIRTC_ERROR_AUDIO_PROCESSING_INITIALIZATION_FAILED = 6055,
|
|
66
|
+
TIRTC_ERROR_AUDIO_PROCESSING_RUNTIME_FAILED = 6056,
|
|
67
|
+
TIRTC_ERROR_VIDEO_ENCODER_RUNTIME_FAILED = 6057,
|
|
68
|
+
TIRTC_ERROR_VIDEO_PROCESSING_RUNTIME_FAILED = 6058,
|
|
69
|
+
TIRTC_ERROR_VIDEO_INPUT_OPEN_FAILED = 6059,
|
|
70
|
+
TIRTC_ERROR_VIDEO_INPUT_RUNTIME_FAILED = 6060,
|
|
71
|
+
TIRTC_ERROR_VIDEO_OUTPUT_OPEN_FAILED = 6061,
|
|
72
|
+
TIRTC_ERROR_MEDIA_UPLINK_CREATE_FAILED = 6062,
|
|
73
|
+
TIRTC_ERROR_MEDIA_UPLINK_START_FAILED = 6063,
|
|
74
|
+
TIRTC_ERROR_MEDIA_DOWNLINK_DECODE_FAILED = 6064,
|
|
75
|
+
TIRTC_ERROR_MEDIA_RAW_DUMP_FAILED = 6065,
|
|
76
|
+
TIRTC_ERROR_FACADE_RUNTIME_FAILED = 6066,
|
|
77
|
+
TIRTC_ERROR_LOG_WRITE_FAILED = 6067,
|
|
78
|
+
TIRTC_ERROR_AUDIO_ENCODER_RUNTIME_FAILED = 6068,
|
|
79
|
+
TIRTC_ERROR_AUDIO_DECODER_RUNTIME_FAILED = 6069,
|
|
80
|
+
TIRTC_ERROR_HTTP_CLIENT_UNAVAILABLE = 6070,
|
|
81
|
+
TIRTC_ERROR_HTTP_TLS_UNSUPPORTED = 6071,
|
|
82
|
+
TIRTC_ERROR_UPLOAD_TOKEN_EXPIRED = 6072,
|
|
83
|
+
TIRTC_ERROR_STREAM_ID_IN_USE = 6073,
|
|
84
|
+
TIRTC_ERROR_VIDEO_PREVIEW_IN_USE = 6074,
|
|
85
|
+
TIRTC_ERROR_FACADE_PEER_ID_UNAVAILABLE = 6075,
|
|
86
|
+
TIRTC_ERROR_MEDIA_DOWNLINK_QUEUE_FULL = 6076,
|
|
87
|
+
TIRTC_ERROR_MEDIA_DOWNLINK_OUTPUT_PENDING = 6077,
|
|
88
|
+
TIRTC_ERROR_TRANSPORT_INVALID_HANDLE = 6078,
|
|
89
|
+
TIRTC_ERROR_VIDEO_ENCODER_INPUT_PENDING = 6079,
|
|
90
|
+
TIRTC_ERROR_VIDEO_ENCODER_OUTPUT_PENDING = 6080,
|
|
91
|
+
TIRTC_ERROR_VIDEO_DECODER_INPUT_PENDING = 6081,
|
|
92
|
+
TIRTC_ERROR_VIDEO_DECODER_OUTPUT_PENDING = 6082,
|
|
93
|
+
TIRTC_ERROR_MEDIA_UPLINK_INPUT_MODE_MISMATCH = 6083,
|
|
94
|
+
} TirtcError;
|
|
95
|
+
|
|
96
|
+
const char* tirtc_error_to_string(TirtcError error);
|
|
97
|
+
|
|
98
|
+
#ifdef __cplusplus
|
|
99
|
+
}
|
|
100
|
+
#endif
|
|
101
|
+
|
|
102
|
+
#endif // TIRTC_FOUNDATION_ERROR_H_
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#ifndef TIRTC_FOUNDATION_BUILD_INFO_H_
|
|
2
|
+
#define TIRTC_FOUNDATION_BUILD_INFO_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/error.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
typedef struct TirtcBuildInfo {
|
|
11
|
+
const char* semver_base;
|
|
12
|
+
const char* semver_effective;
|
|
13
|
+
const char* commit_hash;
|
|
14
|
+
int commit_count;
|
|
15
|
+
const char* build_branch;
|
|
16
|
+
const char* build_time_utc;
|
|
17
|
+
const char* version_string;
|
|
18
|
+
} TirtcBuildInfo;
|
|
19
|
+
|
|
20
|
+
const TirtcBuildInfo* tirtc_build_info_get(void);
|
|
21
|
+
const char* tirtc_build_version_string(void);
|
|
22
|
+
|
|
23
|
+
#ifdef __cplusplus
|
|
24
|
+
}
|
|
25
|
+
#endif
|
|
26
|
+
|
|
27
|
+
#endif // TIRTC_FOUNDATION_BUILD_INFO_H_
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#ifndef TIRTC_FOUNDATION_HTTP_H_
|
|
2
|
+
#define TIRTC_FOUNDATION_HTTP_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/error.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
typedef enum TirtcHttpMethod {
|
|
11
|
+
TIRTC_HTTP_METHOD_GET = 0,
|
|
12
|
+
TIRTC_HTTP_METHOD_POST = 1,
|
|
13
|
+
TIRTC_HTTP_METHOD_PUT = 2,
|
|
14
|
+
TIRTC_HTTP_METHOD_PATCH = 3,
|
|
15
|
+
TIRTC_HTTP_METHOD_DELETE = 4,
|
|
16
|
+
} TirtcHttpMethod;
|
|
17
|
+
|
|
18
|
+
typedef struct TirtcHttpHeader {
|
|
19
|
+
const char* key;
|
|
20
|
+
const char* value;
|
|
21
|
+
} TirtcHttpHeader;
|
|
22
|
+
|
|
23
|
+
typedef struct TirtcHttpRequest {
|
|
24
|
+
const char* scheme;
|
|
25
|
+
const char* host;
|
|
26
|
+
int port;
|
|
27
|
+
const char* path;
|
|
28
|
+
const char* query;
|
|
29
|
+
const TirtcHttpHeader* headers;
|
|
30
|
+
int header_count;
|
|
31
|
+
const char* body;
|
|
32
|
+
int body_size;
|
|
33
|
+
int connect_timeout_ms;
|
|
34
|
+
int read_timeout_ms;
|
|
35
|
+
int write_timeout_ms;
|
|
36
|
+
} TirtcHttpRequest;
|
|
37
|
+
|
|
38
|
+
typedef struct TirtcHttpResponse {
|
|
39
|
+
int status_code;
|
|
40
|
+
const char* body;
|
|
41
|
+
int body_size;
|
|
42
|
+
} TirtcHttpResponse;
|
|
43
|
+
|
|
44
|
+
typedef TirtcError (*TirtcHttpMockHandler)(const TirtcHttpRequest* request, TirtcHttpMethod method,
|
|
45
|
+
TirtcHttpResponse* response, void* user_data);
|
|
46
|
+
|
|
47
|
+
TirtcError tirtc_http_request(const TirtcHttpRequest* request, TirtcHttpMethod method,
|
|
48
|
+
TirtcHttpResponse* response);
|
|
49
|
+
void tirtc_http_response_dispose(TirtcHttpResponse* response);
|
|
50
|
+
TirtcError tirtc_http_set_mock_handler(TirtcHttpMockHandler handler, void* user_data);
|
|
51
|
+
void tirtc_http_clear_mock_handler(void);
|
|
52
|
+
|
|
53
|
+
#ifdef __cplusplus
|
|
54
|
+
}
|
|
55
|
+
#endif
|
|
56
|
+
|
|
57
|
+
#endif // TIRTC_FOUNDATION_HTTP_H_
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#ifndef TIRTC_FOUNDATION_LOGGING_H_
|
|
2
|
+
#define TIRTC_FOUNDATION_LOGGING_H_
|
|
3
|
+
|
|
4
|
+
#include <stdarg.h>
|
|
5
|
+
|
|
6
|
+
#include "tirtc/error.h"
|
|
7
|
+
|
|
8
|
+
#ifdef __cplusplus
|
|
9
|
+
extern "C" {
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
typedef enum TirtcLogLevel {
|
|
13
|
+
TIRTC_LOG_LEVEL_VERBOSE = 0,
|
|
14
|
+
TIRTC_LOG_LEVEL_DEBUG,
|
|
15
|
+
TIRTC_LOG_LEVEL_INFO,
|
|
16
|
+
TIRTC_LOG_LEVEL_WARN,
|
|
17
|
+
TIRTC_LOG_LEVEL_ERROR,
|
|
18
|
+
TIRTC_LOG_LEVEL_FATAL,
|
|
19
|
+
} TirtcLogLevel;
|
|
20
|
+
|
|
21
|
+
typedef void (*TirtcLoggingPrintFunction)(const char* prefix, TirtcLogLevel level, const char* tag,
|
|
22
|
+
const char* fmt, va_list args);
|
|
23
|
+
|
|
24
|
+
#define TIRTC_LOG_PREFIX_DEFAULT "TIRTC_"
|
|
25
|
+
|
|
26
|
+
TirtcError tirtc_logging_set_print_function(TirtcLoggingPrintFunction function);
|
|
27
|
+
TirtcError tirtc_logging_set_level(TirtcLogLevel level);
|
|
28
|
+
TirtcError tirtc_logging_set_console_enabled(int enabled);
|
|
29
|
+
|
|
30
|
+
TirtcError tirtc_logging_initialize(const char* root_dir);
|
|
31
|
+
TirtcError tirtc_logging_write(TirtcLogLevel level, const char* tag, const char* message);
|
|
32
|
+
TirtcError tirtc_logging_print(const char* prefix, TirtcLogLevel level, const char* tag,
|
|
33
|
+
const char* fmt, ...);
|
|
34
|
+
TirtcError tirtc_logging_flush(void);
|
|
35
|
+
TirtcError tirtc_logging_export(const char* output_zip_path);
|
|
36
|
+
TirtcError tirtc_logging_upload(char* log_id, int log_id_capacity);
|
|
37
|
+
|
|
38
|
+
#define TIRTC_LOGV(tag, fmt, ...) \
|
|
39
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_VERBOSE, tag, fmt, ##__VA_ARGS__)
|
|
40
|
+
#define TIRTC_LOGD(tag, fmt, ...) \
|
|
41
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_DEBUG, tag, fmt, ##__VA_ARGS__)
|
|
42
|
+
#define TIRTC_LOGI(tag, fmt, ...) \
|
|
43
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_INFO, tag, fmt, ##__VA_ARGS__)
|
|
44
|
+
#define TIRTC_LOGW(tag, fmt, ...) \
|
|
45
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_WARN, tag, fmt, ##__VA_ARGS__)
|
|
46
|
+
#define TIRTC_LOGE(tag, fmt, ...) \
|
|
47
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_ERROR, tag, fmt, ##__VA_ARGS__)
|
|
48
|
+
#define TIRTC_LOGF(tag, fmt, ...) \
|
|
49
|
+
tirtc_logging_print(TIRTC_LOG_PREFIX_DEFAULT, TIRTC_LOG_LEVEL_FATAL, tag, fmt, ##__VA_ARGS__)
|
|
50
|
+
|
|
51
|
+
#ifdef __cplusplus
|
|
52
|
+
}
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
#endif // TIRTC_FOUNDATION_LOGGING_H_
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#ifndef TIRTC_MEDIA_CONTRACT_MEDIA_CODEC_H_
|
|
2
|
+
#define TIRTC_MEDIA_CONTRACT_MEDIA_CODEC_H_
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
typedef enum TirtcMediaCodec {
|
|
9
|
+
TIRTC_MEDIA_CODEC_NONE = 0,
|
|
10
|
+
TIRTC_MEDIA_CODEC_AUDIO_G711A = 1,
|
|
11
|
+
/* Reserved shared identifiers; concrete video implementations live outside media-contract. */
|
|
12
|
+
TIRTC_MEDIA_CODEC_VIDEO_H264 = 65,
|
|
13
|
+
TIRTC_MEDIA_CODEC_VIDEO_H265 = 66,
|
|
14
|
+
TIRTC_MEDIA_CODEC_VIDEO_MJPEG = 67,
|
|
15
|
+
} TirtcMediaCodec;
|
|
16
|
+
|
|
17
|
+
#ifdef __cplusplus
|
|
18
|
+
}
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
#endif // TIRTC_MEDIA_CONTRACT_MEDIA_CODEC_H_
|