tirtc-devtools-cli 0.0.15 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/USAGE.md +1 -3
- package/dist/cli/src/index.js +17 -1
- 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 +216 -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 +208 -0
- package/vendor/runtime/linux-x64/include/tirtc/error.h +63 -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 +154 -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 +99 -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/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 +8 -8
- package/vendor/devtools/driver/macos-arm64/runtime_validation_client_bin +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/** @file trp.h
|
|
2
|
+
* @brief Facade transport-facing public C API.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
#ifndef TIRTC_FACADE_TRP_H_
|
|
6
|
+
#define TIRTC_FACADE_TRP_H_
|
|
7
|
+
|
|
8
|
+
#include <stddef.h>
|
|
9
|
+
#include <stdint.h>
|
|
10
|
+
|
|
11
|
+
#include "tirtc/error.h"
|
|
12
|
+
|
|
13
|
+
#ifdef __cplusplus
|
|
14
|
+
extern "C" {
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
typedef struct TirtcInitOptions {
|
|
18
|
+
const char* app_id;
|
|
19
|
+
|
|
20
|
+
const char* endpoint;
|
|
21
|
+
|
|
22
|
+
const char* log_root_dir;
|
|
23
|
+
|
|
24
|
+
int console_log_enabled;
|
|
25
|
+
|
|
26
|
+
} TirtcInitOptions;
|
|
27
|
+
|
|
28
|
+
typedef enum TirtcMediaSendPolicy {
|
|
29
|
+
|
|
30
|
+
TIRTC_MEDIA_SEND_POLICY_ON_REQUEST = 0,
|
|
31
|
+
|
|
32
|
+
TIRTC_MEDIA_SEND_POLICY_AUTO_ON_CONNECTED = 1,
|
|
33
|
+
} TirtcMediaSendPolicy;
|
|
34
|
+
|
|
35
|
+
typedef struct TirtcConnServiceStartOptions {
|
|
36
|
+
const char* license;
|
|
37
|
+
|
|
38
|
+
uint32_t max_connections;
|
|
39
|
+
|
|
40
|
+
TirtcMediaSendPolicy media_send_policy;
|
|
41
|
+
} TirtcConnServiceStartOptions;
|
|
42
|
+
|
|
43
|
+
typedef struct TirtcConnConnectOptions {
|
|
44
|
+
const char* remote_id;
|
|
45
|
+
|
|
46
|
+
const char* token;
|
|
47
|
+
} TirtcConnConnectOptions;
|
|
48
|
+
|
|
49
|
+
typedef struct TirtcConnCreateOptions {
|
|
50
|
+
const struct TirtcConnCallbacks* callbacks;
|
|
51
|
+
|
|
52
|
+
void* user_data;
|
|
53
|
+
} TirtcConnCreateOptions;
|
|
54
|
+
|
|
55
|
+
typedef struct TirtcConnService TirtcConnService;
|
|
56
|
+
|
|
57
|
+
typedef struct TirtcConn TirtcConn;
|
|
58
|
+
|
|
59
|
+
typedef enum TirtcConnState {
|
|
60
|
+
|
|
61
|
+
TIRTC_CONN_STATE_IDLE = 0,
|
|
62
|
+
|
|
63
|
+
TIRTC_CONN_STATE_CONNECTING = 1,
|
|
64
|
+
|
|
65
|
+
TIRTC_CONN_STATE_CONNECTED = 2,
|
|
66
|
+
|
|
67
|
+
TIRTC_CONN_STATE_DISCONNECTED = 3,
|
|
68
|
+
} TirtcConnState;
|
|
69
|
+
|
|
70
|
+
typedef struct TirtcStreamMessage {
|
|
71
|
+
uint32_t timestamp_ms;
|
|
72
|
+
|
|
73
|
+
const void* data;
|
|
74
|
+
|
|
75
|
+
size_t length;
|
|
76
|
+
} TirtcStreamMessage;
|
|
77
|
+
|
|
78
|
+
typedef struct TirtcConnCommand {
|
|
79
|
+
uint32_t command;
|
|
80
|
+
|
|
81
|
+
const void* data;
|
|
82
|
+
|
|
83
|
+
size_t length;
|
|
84
|
+
} TirtcConnCommand;
|
|
85
|
+
|
|
86
|
+
typedef struct TirtcConnMetricsSnapshot {
|
|
87
|
+
int has_connect_start;
|
|
88
|
+
int has_connected;
|
|
89
|
+
uint64_t connect_start_monotonic_ms;
|
|
90
|
+
uint64_t connected_monotonic_ms;
|
|
91
|
+
} TirtcConnMetricsSnapshot;
|
|
92
|
+
|
|
93
|
+
/** Heap-owned byte payload allocated by facade callback dispatch. */
|
|
94
|
+
typedef struct TirtcOwnedBytes {
|
|
95
|
+
/** Payload buffer allocated by facade, or `NULL` for zero-length payloads. */
|
|
96
|
+
void* data;
|
|
97
|
+
|
|
98
|
+
/** Number of bytes stored in `data`. */
|
|
99
|
+
size_t length;
|
|
100
|
+
} TirtcOwnedBytes;
|
|
101
|
+
|
|
102
|
+
/** Heap-owned UTF-8 string allocated by facade callback dispatch. */
|
|
103
|
+
typedef struct TirtcOwnedString {
|
|
104
|
+
/** Null-terminated UTF-8 buffer allocated by facade, or `NULL` when no message is available. */
|
|
105
|
+
char* data;
|
|
106
|
+
} TirtcOwnedString;
|
|
107
|
+
|
|
108
|
+
typedef struct TirtcConnServiceCallbacks {
|
|
109
|
+
void (*on_started)(TirtcConnService* service, void* user_data);
|
|
110
|
+
|
|
111
|
+
void (*on_stopped)(TirtcConnService* service, void* user_data);
|
|
112
|
+
|
|
113
|
+
void (*on_connected)(TirtcConnService* service, TirtcConn* connection, void* user_data);
|
|
114
|
+
|
|
115
|
+
void (*on_error)(TirtcConnService* service, TirtcError error, const char* message,
|
|
116
|
+
void* user_data);
|
|
117
|
+
} TirtcConnServiceCallbacks;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Connection observer installed through `tirtc_conn_create()` or `tirtc_conn_set_callbacks()`.
|
|
121
|
+
*
|
|
122
|
+
* For `on_command()` and `on_stream_message()`, facade copies the variable-length payload to heap
|
|
123
|
+
* memory before dispatch. The callback receives ownership of that payload and must release it with
|
|
124
|
+
* `tirtc_owned_bytes_release()` after converting or copying the bytes it needs. The release API is
|
|
125
|
+
* NULL-safe. If facade cannot allocate an owned copy for a non-empty payload, it drops that
|
|
126
|
+
* callback delivery rather than dispatching a borrowed pointer.
|
|
127
|
+
*/
|
|
128
|
+
typedef struct TirtcConnCallbacks {
|
|
129
|
+
void (*on_state_changed)(TirtcConn* connection, TirtcConnState state, TirtcError error,
|
|
130
|
+
void* user_data);
|
|
131
|
+
|
|
132
|
+
void (*on_command)(TirtcConn* connection, uint32_t command, TirtcOwnedBytes* owned_payload,
|
|
133
|
+
void* user_data);
|
|
134
|
+
|
|
135
|
+
void (*on_stream_message)(TirtcConn* connection, uint8_t stream_id, uint32_t timestamp_ms,
|
|
136
|
+
TirtcOwnedBytes* owned_payload, void* user_data);
|
|
137
|
+
} TirtcConnCallbacks;
|
|
138
|
+
|
|
139
|
+
TirtcError tirtc_init(const TirtcInitOptions* options);
|
|
140
|
+
|
|
141
|
+
void tirtc_uninit(void);
|
|
142
|
+
|
|
143
|
+
TirtcError tirtc_conn_service_start(const TirtcConnServiceStartOptions* options,
|
|
144
|
+
const TirtcConnServiceCallbacks* observer, void* user_data,
|
|
145
|
+
TirtcConnService** out_service);
|
|
146
|
+
|
|
147
|
+
TirtcError tirtc_conn_service_stop(TirtcConnService* service);
|
|
148
|
+
|
|
149
|
+
TirtcError tirtc_conn_create(const TirtcConnCreateOptions* options, TirtcConn** out_connection);
|
|
150
|
+
|
|
151
|
+
TirtcError tirtc_conn_set_callbacks(TirtcConn* connection, const TirtcConnCallbacks* callbacks,
|
|
152
|
+
void* user_data);
|
|
153
|
+
|
|
154
|
+
TirtcError tirtc_conn_connect(TirtcConn* connection, const TirtcConnConnectOptions* options);
|
|
155
|
+
|
|
156
|
+
TirtcError tirtc_conn_disconnect(TirtcConn* connection);
|
|
157
|
+
|
|
158
|
+
void tirtc_conn_destroy(TirtcConn* connection);
|
|
159
|
+
|
|
160
|
+
TirtcError tirtc_conn_send_stream_message(TirtcConn* connection, uint8_t stream_id,
|
|
161
|
+
const TirtcStreamMessage* message);
|
|
162
|
+
|
|
163
|
+
/** Copies a stream-message payload into a releasable owned buffer. */
|
|
164
|
+
TirtcOwnedBytes* tirtc_stream_message_copy_payload(const TirtcStreamMessage* message);
|
|
165
|
+
|
|
166
|
+
/** Copies a command payload into a releasable owned buffer. */
|
|
167
|
+
TirtcOwnedBytes* tirtc_conn_command_copy_payload(const TirtcConnCommand* command);
|
|
168
|
+
|
|
169
|
+
/** Copies a UTF-8 string into a releasable owned buffer. */
|
|
170
|
+
TirtcOwnedString* tirtc_string_copy_owned(const char* message);
|
|
171
|
+
|
|
172
|
+
/** Releases a payload received from facade owned-memory callback APIs. Safe to call with `NULL`. */
|
|
173
|
+
void tirtc_owned_bytes_release(TirtcOwnedBytes* owned);
|
|
174
|
+
|
|
175
|
+
/** Releases a string received from facade owned-memory callback APIs. Safe to call with `NULL`. */
|
|
176
|
+
void tirtc_owned_string_release(TirtcOwnedString* owned);
|
|
177
|
+
|
|
178
|
+
TirtcError tirtc_conn_send_command(TirtcConn* connection, const TirtcConnCommand* command);
|
|
179
|
+
|
|
180
|
+
TirtcError tirtc_metrics_conn_get_snapshot(TirtcConn* connection,
|
|
181
|
+
TirtcConnMetricsSnapshot* out_snapshot);
|
|
182
|
+
|
|
183
|
+
#ifdef __cplusplus
|
|
184
|
+
}
|
|
185
|
+
#endif
|
|
186
|
+
|
|
187
|
+
#endif
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_CODEC_H_
|
|
2
|
+
#define TIRTC_VIDEO_CODEC_H_
|
|
3
|
+
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
#include "tirtc/error.h"
|
|
8
|
+
#include "tirtc/video_frame.h"
|
|
9
|
+
|
|
10
|
+
#ifdef __cplusplus
|
|
11
|
+
extern "C" {
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
typedef struct TirtcVideoEncoder TirtcVideoEncoder;
|
|
15
|
+
typedef struct TirtcVideoDecoder TirtcVideoDecoder;
|
|
16
|
+
|
|
17
|
+
typedef enum TirtcVideoEncoderPreference {
|
|
18
|
+
TIRTC_VIDEO_ENCODER_PREFERENCE_AUTO = 0,
|
|
19
|
+
TIRTC_VIDEO_ENCODER_PREFERENCE_SOFTWARE = 1,
|
|
20
|
+
TIRTC_VIDEO_ENCODER_PREFERENCE_HARDWARE = 2,
|
|
21
|
+
} TirtcVideoEncoderPreference;
|
|
22
|
+
|
|
23
|
+
typedef enum TirtcVideoDecoderPreference {
|
|
24
|
+
TIRTC_VIDEO_DECODER_PREFERENCE_AUTO = 0,
|
|
25
|
+
TIRTC_VIDEO_DECODER_PREFERENCE_SOFTWARE = 1,
|
|
26
|
+
TIRTC_VIDEO_DECODER_PREFERENCE_HARDWARE = 2,
|
|
27
|
+
} TirtcVideoDecoderPreference;
|
|
28
|
+
|
|
29
|
+
typedef enum TirtcVideoEncoderBackendKind {
|
|
30
|
+
TIRTC_VIDEO_ENCODER_BACKEND_KIND_SOFTWARE = 1,
|
|
31
|
+
TIRTC_VIDEO_ENCODER_BACKEND_KIND_HARDWARE = 2,
|
|
32
|
+
} TirtcVideoEncoderBackendKind;
|
|
33
|
+
|
|
34
|
+
typedef struct TirtcVideoEncoderRuntimeInfo {
|
|
35
|
+
TirtcVideoEncoderBackendKind actual_backend;
|
|
36
|
+
TirtcVideoEncoderPreference requested_encoder_preference;
|
|
37
|
+
int did_fallback;
|
|
38
|
+
TirtcVideoPixelFormat resolved_input_pixel_format;
|
|
39
|
+
} TirtcVideoEncoderRuntimeInfo;
|
|
40
|
+
|
|
41
|
+
typedef struct TirtcVideoEncoderConfig {
|
|
42
|
+
TirtcMediaCodec codec;
|
|
43
|
+
TirtcVideoBitstreamFormat bitstream_format;
|
|
44
|
+
uint32_t width;
|
|
45
|
+
uint32_t height;
|
|
46
|
+
uint32_t fps;
|
|
47
|
+
uint32_t bitrate_kbps;
|
|
48
|
+
TirtcVideoPixelFormat input_pixel_format;
|
|
49
|
+
/**
|
|
50
|
+
* Selects the encoder backend family before the encoder is created.
|
|
51
|
+
*
|
|
52
|
+
* Zero-initialized configs use `AUTO`, which currently preserves the software encoder path.
|
|
53
|
+
* `HARDWARE` is strict: if the requested hardware backend is unavailable or cannot initialize,
|
|
54
|
+
* create fails with a video encoder error instead of falling back to software.
|
|
55
|
+
*/
|
|
56
|
+
TirtcVideoEncoderPreference encoder_preference;
|
|
57
|
+
} TirtcVideoEncoderConfig;
|
|
58
|
+
|
|
59
|
+
typedef struct TirtcVideoDecoderConfig {
|
|
60
|
+
TirtcMediaCodec codec;
|
|
61
|
+
TirtcVideoBitstreamFormat bitstream_format;
|
|
62
|
+
TirtcVideoPixelFormat output_pixel_format;
|
|
63
|
+
} TirtcVideoDecoderConfig;
|
|
64
|
+
|
|
65
|
+
TirtcError tirtc_video_encoder_create(const TirtcVideoEncoderConfig* config,
|
|
66
|
+
TirtcVideoEncoder** out_encoder);
|
|
67
|
+
void tirtc_video_encoder_destroy(TirtcVideoEncoder* encoder);
|
|
68
|
+
TirtcError tirtc_video_encoder_reset(TirtcVideoEncoder* encoder);
|
|
69
|
+
TirtcError tirtc_video_encoder_request_key_frame(TirtcVideoEncoder* encoder);
|
|
70
|
+
/**
|
|
71
|
+
* Returns the backend decision made during encoder creation.
|
|
72
|
+
*
|
|
73
|
+
* `out_info` is caller-owned storage. The function writes a value copy and does not allocate or
|
|
74
|
+
* transfer ownership. It may be called after successful create and before destroy, including while
|
|
75
|
+
* another thread is using the encoder through the normal encode/control API.
|
|
76
|
+
*/
|
|
77
|
+
TirtcError tirtc_video_encoder_get_runtime_info(const TirtcVideoEncoder* encoder,
|
|
78
|
+
TirtcVideoEncoderRuntimeInfo* out_info);
|
|
79
|
+
TirtcError tirtc_video_encoder_encode(TirtcVideoEncoder* encoder,
|
|
80
|
+
const TirtcVideoPixelFrame* in_frame, void* out_buffer,
|
|
81
|
+
size_t out_buffer_capacity,
|
|
82
|
+
TirtcVideoEncodedFrame* out_frame);
|
|
83
|
+
|
|
84
|
+
TirtcError tirtc_video_decoder_create(const TirtcVideoDecoderConfig* config,
|
|
85
|
+
TirtcVideoDecoder** out_decoder);
|
|
86
|
+
void tirtc_video_decoder_destroy(TirtcVideoDecoder* decoder);
|
|
87
|
+
TirtcError tirtc_video_decoder_reset(TirtcVideoDecoder* decoder);
|
|
88
|
+
TirtcError tirtc_video_decoder_decode(TirtcVideoDecoder* decoder,
|
|
89
|
+
const TirtcVideoEncodedFrame* in_frame,
|
|
90
|
+
TirtcVideoPixelFrame* out_frame);
|
|
91
|
+
|
|
92
|
+
TirtcError tirtc_video_snapshot_export_jpeg(const TirtcVideoPixelFrame* frame,
|
|
93
|
+
const char* output_path);
|
|
94
|
+
|
|
95
|
+
#ifdef __cplusplus
|
|
96
|
+
}
|
|
97
|
+
#endif
|
|
98
|
+
|
|
99
|
+
#endif // TIRTC_VIDEO_CODEC_H_
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_FRAME_H_
|
|
2
|
+
#define TIRTC_VIDEO_FRAME_H_
|
|
3
|
+
|
|
4
|
+
#include <stddef.h>
|
|
5
|
+
#include <stdint.h>
|
|
6
|
+
|
|
7
|
+
#include "tirtc/media_codec.h"
|
|
8
|
+
|
|
9
|
+
#ifdef __cplusplus
|
|
10
|
+
extern "C" {
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
#define TIRTC_VIDEO_MAX_PLANES 4
|
|
14
|
+
|
|
15
|
+
typedef enum TirtcVideoPixelFormat {
|
|
16
|
+
TIRTC_VIDEO_PIXEL_FORMAT_NONE = 0,
|
|
17
|
+
TIRTC_VIDEO_PIXEL_FORMAT_I420 = 1,
|
|
18
|
+
TIRTC_VIDEO_PIXEL_FORMAT_NV12 = 2,
|
|
19
|
+
TIRTC_VIDEO_PIXEL_FORMAT_RGBA8888 = 3,
|
|
20
|
+
} TirtcVideoPixelFormat;
|
|
21
|
+
|
|
22
|
+
typedef enum TirtcVideoBitstreamFormat {
|
|
23
|
+
TIRTC_VIDEO_BITSTREAM_FORMAT_NONE = 0,
|
|
24
|
+
TIRTC_VIDEO_BITSTREAM_FORMAT_H264_ANNEXB = 1,
|
|
25
|
+
TIRTC_VIDEO_BITSTREAM_FORMAT_H265_ANNEXB = 2,
|
|
26
|
+
TIRTC_VIDEO_BITSTREAM_FORMAT_MJPEG_JFIF = 3,
|
|
27
|
+
} TirtcVideoBitstreamFormat;
|
|
28
|
+
|
|
29
|
+
typedef struct TirtcVideoPixelFrame {
|
|
30
|
+
uint32_t width;
|
|
31
|
+
uint32_t height;
|
|
32
|
+
TirtcVideoPixelFormat pixel_format;
|
|
33
|
+
int64_t pts_us;
|
|
34
|
+
uint32_t plane_count;
|
|
35
|
+
void* planes[TIRTC_VIDEO_MAX_PLANES];
|
|
36
|
+
uint32_t strides[TIRTC_VIDEO_MAX_PLANES];
|
|
37
|
+
size_t plane_bytes[TIRTC_VIDEO_MAX_PLANES];
|
|
38
|
+
} TirtcVideoPixelFrame;
|
|
39
|
+
|
|
40
|
+
typedef struct TirtcVideoEncodedFrame {
|
|
41
|
+
TirtcMediaCodec codec;
|
|
42
|
+
TirtcVideoBitstreamFormat bitstream_format;
|
|
43
|
+
uint32_t width;
|
|
44
|
+
uint32_t height;
|
|
45
|
+
int64_t pts_us;
|
|
46
|
+
int is_key_frame;
|
|
47
|
+
const void* data;
|
|
48
|
+
size_t data_bytes;
|
|
49
|
+
} TirtcVideoEncodedFrame;
|
|
50
|
+
|
|
51
|
+
#ifdef __cplusplus
|
|
52
|
+
}
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
#endif // TIRTC_VIDEO_FRAME_H_
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_IO_H_
|
|
2
|
+
#define TIRTC_VIDEO_IO_H_
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
|
|
6
|
+
#include "tirtc/error.h"
|
|
7
|
+
#include "tirtc/video_frame.h"
|
|
8
|
+
|
|
9
|
+
#ifdef __cplusplus
|
|
10
|
+
extern "C" {
|
|
11
|
+
#endif
|
|
12
|
+
|
|
13
|
+
typedef struct TirtcVideoVin TirtcVideoVin;
|
|
14
|
+
typedef struct TirtcVideoVout TirtcVideoVout;
|
|
15
|
+
|
|
16
|
+
typedef struct TirtcVideoIoConfig {
|
|
17
|
+
uint32_t width;
|
|
18
|
+
uint32_t height;
|
|
19
|
+
uint32_t fps;
|
|
20
|
+
/* Preferred pixel format; actual format resolution is backend-specific. */
|
|
21
|
+
TirtcVideoPixelFormat pixel_format;
|
|
22
|
+
} TirtcVideoIoConfig;
|
|
23
|
+
|
|
24
|
+
typedef struct TirtcVideoHeadlessVoutOptions {
|
|
25
|
+
const char* first_frame_json_path;
|
|
26
|
+
const char* first_frame_raw_path;
|
|
27
|
+
} TirtcVideoHeadlessVoutOptions;
|
|
28
|
+
|
|
29
|
+
typedef void (*TirtcVideoVinOnFrameFn)(TirtcVideoVin* vin, const TirtcVideoPixelFrame* frame,
|
|
30
|
+
void* user_data);
|
|
31
|
+
|
|
32
|
+
TirtcError tirtc_video_vin_open(TirtcVideoVin* vin, const TirtcVideoIoConfig* config,
|
|
33
|
+
TirtcVideoVinOnFrameFn on_frame, void* user_data);
|
|
34
|
+
TirtcError tirtc_video_vin_get_actual_config(TirtcVideoVin* vin, TirtcVideoIoConfig* out_config);
|
|
35
|
+
TirtcError tirtc_video_vin_start(TirtcVideoVin* vin);
|
|
36
|
+
TirtcError tirtc_video_vin_stop(TirtcVideoVin* vin);
|
|
37
|
+
TirtcError tirtc_video_vin_close(TirtcVideoVin* vin);
|
|
38
|
+
void tirtc_video_vin_destroy(TirtcVideoVin* vin);
|
|
39
|
+
|
|
40
|
+
TirtcError tirtc_video_vout_open(TirtcVideoVout* vout, const TirtcVideoIoConfig* config);
|
|
41
|
+
TirtcError tirtc_video_vout_create_headless_capture(const TirtcVideoHeadlessVoutOptions* options,
|
|
42
|
+
TirtcVideoVout** out_vout);
|
|
43
|
+
TirtcError tirtc_video_vout_get_actual_config(TirtcVideoVout* vout, TirtcVideoIoConfig* out_config);
|
|
44
|
+
TirtcError tirtc_video_vout_render_frame(TirtcVideoVout* vout, const TirtcVideoPixelFrame* frame);
|
|
45
|
+
TirtcError tirtc_video_vout_flush(TirtcVideoVout* vout);
|
|
46
|
+
TirtcError tirtc_video_vout_close(TirtcVideoVout* vout);
|
|
47
|
+
void tirtc_video_vout_destroy(TirtcVideoVout* vout);
|
|
48
|
+
|
|
49
|
+
#ifdef __cplusplus
|
|
50
|
+
}
|
|
51
|
+
#endif
|
|
52
|
+
|
|
53
|
+
#endif // TIRTC_VIDEO_IO_H_
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_IO_ANDROID_H_
|
|
2
|
+
#define TIRTC_VIDEO_IO_ANDROID_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/video_io.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#if defined(__ANDROID__)
|
|
11
|
+
struct ANativeWindow;
|
|
12
|
+
|
|
13
|
+
typedef enum TirtcVideoAndroidVoutRenderer {
|
|
14
|
+
TIRTC_VIDEO_ANDROID_VOUT_RENDERER_GLES = 0,
|
|
15
|
+
TIRTC_VIDEO_ANDROID_VOUT_RENDERER_NATIVE_WINDOW_RGBA = 1,
|
|
16
|
+
} TirtcVideoAndroidVoutRenderer;
|
|
17
|
+
|
|
18
|
+
typedef struct TirtcVideoAndroidSurfaceTextureVoutOptions {
|
|
19
|
+
struct ANativeWindow* native_window;
|
|
20
|
+
TirtcVideoAndroidVoutRenderer renderer;
|
|
21
|
+
const char* h264_decoder_name;
|
|
22
|
+
const char* h265_decoder_name;
|
|
23
|
+
} TirtcVideoAndroidSurfaceTextureVoutOptions;
|
|
24
|
+
|
|
25
|
+
TirtcError tirtc_video_android_create_surface_texture_vout(TirtcVideoVout** out_vout);
|
|
26
|
+
TirtcError tirtc_video_android_surface_texture_vout_set_options(
|
|
27
|
+
TirtcVideoVout* vout, const TirtcVideoAndroidSurfaceTextureVoutOptions* options);
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#ifdef __cplusplus
|
|
31
|
+
}
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#endif // TIRTC_VIDEO_IO_ANDROID_H_
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_IO_APPLE_H_
|
|
2
|
+
#define TIRTC_VIDEO_IO_APPLE_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/video_io.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#if defined(__APPLE__)
|
|
11
|
+
typedef enum TirtcVideoAppleVoutTarget {
|
|
12
|
+
TIRTC_VIDEO_APPLE_VOUT_TARGET_DEFAULT = 0,
|
|
13
|
+
TIRTC_VIDEO_APPLE_VOUT_TARGET_APPKIT_WINDOW = 1,
|
|
14
|
+
TIRTC_VIDEO_APPLE_VOUT_TARGET_PIXEL_BUFFER_CALLBACK = 2,
|
|
15
|
+
} TirtcVideoAppleVoutTarget;
|
|
16
|
+
|
|
17
|
+
typedef enum TirtcVideoAppleWindowSlot {
|
|
18
|
+
TIRTC_VIDEO_APPLE_WINDOW_SLOT_NONE = 0,
|
|
19
|
+
TIRTC_VIDEO_APPLE_WINDOW_SLOT_LEFT = 1,
|
|
20
|
+
TIRTC_VIDEO_APPLE_WINDOW_SLOT_RIGHT = 2,
|
|
21
|
+
} TirtcVideoAppleWindowSlot;
|
|
22
|
+
|
|
23
|
+
typedef int (*TirtcVideoAppleOnPixelBufferFn)(void* pixel_buffer, void* user_data);
|
|
24
|
+
|
|
25
|
+
typedef struct TirtcVideoAppleCoreVideoVoutOptions {
|
|
26
|
+
TirtcVideoAppleVoutTarget target;
|
|
27
|
+
TirtcVideoAppleOnPixelBufferFn on_pixel_buffer;
|
|
28
|
+
void* user_data;
|
|
29
|
+
const char* window_title;
|
|
30
|
+
TirtcVideoAppleWindowSlot window_slot;
|
|
31
|
+
int use_window_frame;
|
|
32
|
+
int32_t window_x;
|
|
33
|
+
int32_t window_y;
|
|
34
|
+
uint32_t window_width;
|
|
35
|
+
uint32_t window_height;
|
|
36
|
+
} TirtcVideoAppleCoreVideoVoutOptions;
|
|
37
|
+
|
|
38
|
+
TirtcError tirtc_video_apple_create_core_video_vout(TirtcVideoVout** out_vout);
|
|
39
|
+
TirtcError tirtc_video_apple_core_video_vout_set_options(
|
|
40
|
+
TirtcVideoVout* vout, const TirtcVideoAppleCoreVideoVoutOptions* options);
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#ifdef __cplusplus
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
#endif // TIRTC_VIDEO_IO_APPLE_H_
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_IO_HARMONY_H_
|
|
2
|
+
#define TIRTC_VIDEO_IO_HARMONY_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/video_io.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#if defined(__OHOS__)
|
|
11
|
+
typedef struct NativeWindow OHNativeWindow;
|
|
12
|
+
|
|
13
|
+
typedef enum TirtcVideoHarmonyVoutRenderer {
|
|
14
|
+
TIRTC_VIDEO_HARMONY_VOUT_RENDERER_GLES = 0,
|
|
15
|
+
TIRTC_VIDEO_HARMONY_VOUT_RENDERER_NATIVE_WINDOW_RGBA = 1,
|
|
16
|
+
} TirtcVideoHarmonyVoutRenderer;
|
|
17
|
+
|
|
18
|
+
typedef struct TirtcVideoHarmonyNativeImageVoutOptions {
|
|
19
|
+
OHNativeWindow* native_window;
|
|
20
|
+
TirtcVideoHarmonyVoutRenderer renderer;
|
|
21
|
+
} TirtcVideoHarmonyNativeImageVoutOptions;
|
|
22
|
+
|
|
23
|
+
TirtcError tirtc_video_harmony_create_native_image_vout(TirtcVideoVout** out_vout);
|
|
24
|
+
TirtcError tirtc_video_harmony_native_image_vout_set_options(
|
|
25
|
+
TirtcVideoVout* vout, const TirtcVideoHarmonyNativeImageVoutOptions* options);
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifdef __cplusplus
|
|
29
|
+
}
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#endif // TIRTC_VIDEO_IO_HARMONY_H_
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_IO_WINDOWS_H_
|
|
2
|
+
#define TIRTC_VIDEO_IO_WINDOWS_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/video_io.h"
|
|
5
|
+
|
|
6
|
+
#ifdef __cplusplus
|
|
7
|
+
extern "C" {
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
#if defined(_WIN32)
|
|
11
|
+
typedef struct HWND__* TirtcVideoWindowsHwnd;
|
|
12
|
+
|
|
13
|
+
typedef struct TirtcVideoWindowsDirect2dVoutOptions {
|
|
14
|
+
TirtcVideoWindowsHwnd hwnd;
|
|
15
|
+
} TirtcVideoWindowsDirect2dVoutOptions;
|
|
16
|
+
|
|
17
|
+
TirtcError tirtc_video_windows_create_direct2d_vout(TirtcVideoVout** out_vout);
|
|
18
|
+
TirtcError tirtc_video_windows_direct2d_vout_set_options(
|
|
19
|
+
TirtcVideoVout* vout, const TirtcVideoWindowsDirect2dVoutOptions* options);
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
}
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#endif // TIRTC_VIDEO_IO_WINDOWS_H_
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#ifndef TIRTC_VIDEO_PROCESSING_H_
|
|
2
|
+
#define TIRTC_VIDEO_PROCESSING_H_
|
|
3
|
+
|
|
4
|
+
#include "tirtc/error.h"
|
|
5
|
+
#include "tirtc/video_frame.h"
|
|
6
|
+
|
|
7
|
+
#ifdef __cplusplus
|
|
8
|
+
extern "C" {
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
typedef struct TirtcVideoProcessor TirtcVideoProcessor;
|
|
12
|
+
|
|
13
|
+
typedef struct TirtcVideoProcessorConfig {
|
|
14
|
+
uint32_t output_width;
|
|
15
|
+
uint32_t output_height;
|
|
16
|
+
TirtcVideoPixelFormat output_pixel_format;
|
|
17
|
+
} TirtcVideoProcessorConfig;
|
|
18
|
+
|
|
19
|
+
TirtcError tirtc_video_processor_create(const TirtcVideoProcessorConfig* config,
|
|
20
|
+
TirtcVideoProcessor** out_processor);
|
|
21
|
+
void tirtc_video_processor_destroy(TirtcVideoProcessor* processor);
|
|
22
|
+
|
|
23
|
+
TirtcError tirtc_video_processor_set_config(TirtcVideoProcessor* processor,
|
|
24
|
+
const TirtcVideoProcessorConfig* config);
|
|
25
|
+
TirtcError tirtc_video_processor_process(TirtcVideoProcessor* processor,
|
|
26
|
+
const TirtcVideoPixelFrame* in_frame,
|
|
27
|
+
TirtcVideoPixelFrame* out_frame);
|
|
28
|
+
TirtcError tirtc_video_processor_reset(TirtcVideoProcessor* processor);
|
|
29
|
+
|
|
30
|
+
#ifdef __cplusplus
|
|
31
|
+
}
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#endif // TIRTC_VIDEO_PROCESSING_H_
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
platform=linux-x64
|
|
2
|
+
profile=full
|
|
3
|
+
staged_at_utc=2026-04-30T08:01:24Z
|
|
4
|
+
source_sdk=/Users/allenfeng/Development/Repositories/tirtc-nexus/tirtc-matrix/.build/sdk/linux-x64
|
|
5
|
+
|
|
6
|
+
e962631f85675937fd973797720466fd75717f74335c8102c664814d59179113 include/tirtc/audio.h
|
|
7
|
+
6d972ccfe150a3b4f2d7f18fa92b3ade9210c1c8bb754d061ac6b7997b59e2cb include/tirtc/audio_codec.h
|
|
8
|
+
7bacbdb2d8bb10d6444036a8fef42f2a8e3ea34dfc38e165ee678d61f189db41 include/tirtc/audio_frame.h
|
|
9
|
+
fb8ea35263167c33487bd3aa503c26ed2dfbf97877f7bda92c10065cd5c97c13 include/tirtc/audio_io.h
|
|
10
|
+
c2e1f31dcc75be461c577d18b1cebe32774f212d51cb4dd2a5b5a9bfe62b693e include/tirtc/audio_io_android.h
|
|
11
|
+
878bb18220ac62304ec95807f31e83e050c8dac14811f873454f9b045028694a include/tirtc/audio_io_apple.h
|
|
12
|
+
0569eb1d043ee7fa8d45ca43143eca1a22e4c4bf1507ca7e045e010a3ecbc288 include/tirtc/audio_io_harmony.h
|
|
13
|
+
51cbc911fe9f9834046f0e0a1a7cdd814a8e194a615894a8b4d11f9e5f095610 include/tirtc/audio_io_windows.h
|
|
14
|
+
21f60729117260a44af22c1af986ef17d22673b102b7b7a035f492d0665cce16 include/tirtc/audio_processing.h
|
|
15
|
+
0ca7c3c630b1242f51a0fd8154097c0a332b4c816a5707090e4381719852998c include/tirtc/audio_sample_rate.h
|
|
16
|
+
94f378da8bc728a1b9a44fbe74a0367b06ad2401ae55fa5bb6bee63b447ce511 include/tirtc/av.h
|
|
17
|
+
70d0e950f78309e12c927b37a6f7184fe3724edc5391176a697f7d7c7f49ab5a include/tirtc/error.h
|
|
18
|
+
ae805545a9515edc9b94262e72ad2c7b7d649288166f4daeb450d8a55e82ae0b include/tirtc/foundation/build_info.h
|
|
19
|
+
7cf8b372a3d48d4de4a65a04c7f102281a7b42cebb9ec247853d3c53afb63b6a include/tirtc/http.h
|
|
20
|
+
70bbf93b84d9d1a85f376d9986de570c1f658319e1e5ab6d621f7a4d41033f5c include/tirtc/logging.h
|
|
21
|
+
7e2f7f81afe37e22f5414d9db32438edd948ff775230c3a0a17ff9ac1a0b560e include/tirtc/media_codec.h
|
|
22
|
+
0d1c3a8d1537a839cb6050fe5b35079087f094673dd9eb5b4d9acdcc9a2dd5fc include/tirtc/media_downlink.h
|
|
23
|
+
e64191a39004165cdcd11b2ca824af34d4bfe02f7ec3c3101fa9291f56488c30 include/tirtc/media_uplink.h
|
|
24
|
+
489f6c9caa3e4094566b660ef0a002a39c66c1956ef0a1bdb6eacca3798c849a include/tirtc/transport.h
|
|
25
|
+
bb9c1bf46f2ab51a9f7adb211276c8563b09e7968031c0c6abeebc0eddd66acb include/tirtc/trp.h
|
|
26
|
+
118593dd6e57d1a982c4b861e7d26f066a4eb4b5f2e152dbf7b7205d87b467f2 include/tirtc/video_codec.h
|
|
27
|
+
e51379666c199588cc33279ccf52248035d1cae3d1d468b1615ebf29f0b39c9c include/tirtc/video_frame.h
|
|
28
|
+
2a02645d82c58d433c7306a9f0bcd31d0f3e560b63822f7e80919761b81a6284 include/tirtc/video_io.h
|
|
29
|
+
9930dce5e8e2b12a1ab28ee91f3fb46f6cf3487e515ea2b4ec0e00009bd5f070 include/tirtc/video_io_android.h
|
|
30
|
+
005114b9213ec826e18d11eca4b9d65cce2ca0e7c781f03d85292365d9d5dfdd include/tirtc/video_io_apple.h
|
|
31
|
+
cae0bbeb884e5466a56da15182c78cc22baab6c743f349a58d3595f623333585 include/tirtc/video_io_harmony.h
|
|
32
|
+
65b5d24fe3a6bc2a299a2220148a153ba4eb0955a49c1c3baabf1fdfed8aabdd include/tirtc/video_io_windows.h
|
|
33
|
+
8cd6b66bea14890a665cc317f8572429b2c3e4463773f8b77c1e4dc30a4a8747 include/tirtc/video_processing.h
|
|
34
|
+
ceb7cdd45efae57e5bd53d4177cb20c4a0cb9917fcdd23127b050d69c8b919ac lib/libTiRTC.a
|
|
35
|
+
b1f4135025cb8e8520a14268d831b9998920a4239f84bb6b409d0e4909fd5bee lib/libcrypto.a
|
|
36
|
+
80ac9dbdaeb9663399f41611d1bc92a8ee42895b8b38e7d55c25182d90892830 lib/libmatrix_runtime_audio.a
|
|
37
|
+
8833f0f933d73a4c6b10ff3cbbe449e11eb22b2267cb4f2da2fc347782d08d83 lib/libmatrix_runtime_facade.a
|
|
38
|
+
36903d3970287164fa51fe9c2014aa7f654e144a93886c8909904f732ff14d94 lib/libmatrix_runtime_foundation_http.a
|
|
39
|
+
e9a29e7e32a3402bbfdd3fead86ba50a778023ba623de79bc4ab7440797a90a0 lib/libmatrix_runtime_foundation_logging.a
|
|
40
|
+
85c9a5f7ee47279be62c719a3f0efb9b0b5b9724ed3679c38c49900c53105c36 lib/libmatrix_runtime_media.a
|
|
41
|
+
4afd4c0059a4735cd206f4d26669acaa97a367d572c0cc30e51efba198d9817f lib/libmatrix_runtime_transport.a
|
|
42
|
+
6d57712181cff75b8169753d7217c1a1675c3df4e4a30eca3645c5016cb0b87e lib/libmatrix_runtime_video.a
|
|
43
|
+
511d521f7972df3993e5976d6e2dbcad7a6fbce9be15071274d0cbd9d51157f5 lib/libssl.a
|
|
44
|
+
a67ec9034848ef24a1b17671e444daa62a8f9e6b8319a1e932593908720ff2a1 lib/libwebrtc_apm.a
|
|
45
|
+
700e455255897e3cffab13ca593a6e4d9d11383ae609215cbbd6043a63d47161 lib/libxlog.a
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|