Skip to content

Commit 4d0a090

Browse files
lukasIOcloudwebrtc
andauthored
Bump ffi to 0.12.36 (#551)
* bump ffi * Create smart-suits-tap.md * nsure protoc is set up * bump prost * mount protoc * copy protoc over * Modify CI workflow for build image and dependencies Updated CI configuration to use a new build image to support cuda and added additional dependencies for libva and libdrm. --------- Co-authored-by: CloudWebRTC <[email protected]>
1 parent 303df26 commit 4d0a090

File tree

7 files changed

+281
-17
lines changed

7 files changed

+281
-17
lines changed

.changeset/smart-suits-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/rtc-node": patch
3+
---
4+
5+
Bump ffi to v0.12.36

.github/workflows/ci.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
- os: ubuntu-latest
114114
platform: linux
115115
target: x86_64-unknown-linux-gnu
116-
build_image: quay.io/pypa/manylinux_2_28_x86_64
116+
build_image: sameli/manylinux_2_28_x86_64_cuda_12.3
117117
- os: ubuntu-24.04-arm
118118
platform: linux
119119
target: aarch64-unknown-linux-gnu
@@ -143,6 +143,12 @@ jobs:
143143
toolchain: stable
144144
targets: ${{ matrix.target }}
145145

146+
- name: Install Protoc
147+
uses: arduino/setup-protoc@v3
148+
with:
149+
version: '25.1'
150+
repo-token: ${{ secrets.GITHUB_TOKEN }}
151+
146152
- name: Cache cargo
147153
uses: actions/cache@v4
148154
with:
@@ -160,16 +166,23 @@ jobs:
160166
- name: Build (Linux)
161167
if: ${{ matrix.platform == 'linux' }}
162168
run: |
163-
docker run --rm -v $PWD:/workspace -w /workspace ${{ matrix.build_image }} bash -c "\
164-
uname -a; \
165-
export PATH=/root/.cargo/bin:\$PATH; \
166-
export RUST_BACKTRACE=full; \
167-
yum install openssl-devel libX11-devel mesa-libGL-devel libXext-devel clang-devel -y; \
168-
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
169-
curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -; \
170-
yum install -y nodejs --setopt=nodesource-nodejs.module_hotfixes=1; \
171-
npm install --global pnpm && pnpm install; \
172-
cd packages/livekit-rtc && pnpm build --target ${{ matrix.target }}"
169+
PROTOC_PATH=$(which protoc)
170+
docker run --rm \
171+
-v $PWD:/workspace \
172+
-v $PROTOC_PATH:/tmp/protoc:ro \
173+
-w /workspace \
174+
${{ matrix.build_image }} \
175+
bash -c "\
176+
uname -a; \
177+
cp /tmp/protoc /usr/local/bin/protoc && chmod +x /usr/local/bin/protoc; \
178+
export PATH=/root/.cargo/bin:\$PATH; \
179+
export RUST_BACKTRACE=full; \
180+
yum install -y openssl-devel libX11-devel mesa-libGL-devel libXext-devel libva-devel libdrm-devel clang-devel; \
181+
curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
182+
curl -fsSL https://rpm.nodesource.com/setup_20.x | bash -; \
183+
yum install -y nodejs --setopt=nodesource-nodejs.module_hotfixes=1; \
184+
npm install --global pnpm && pnpm install; \
185+
cd packages/livekit-rtc && pnpm build --target ${{ matrix.target }}"
173186
174187
- name: Build (macOS)
175188
if: ${{ matrix.platform == 'macos' }}

packages/livekit-rtc/Cargo.toml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ version = "0.0.1"
77
crate-type = ["cdylib"]
88

99
[dependencies]
10-
napi = { version = "2.12.2", default-features = false, features = ["async", "napi6"] }
10+
napi = { version = "2.12.2", default-features = false, features = [
11+
"async",
12+
"napi6",
13+
] }
1114
napi-derive = "2.12.2"
1215
livekit-ffi = { path = "./rust-sdks/livekit-ffi" }
13-
prost = "0.12"
14-
prost-types = "0.12"
16+
prost = "0.14"
17+
prost-types = "0.14"
1518
log = "0.4.20"
1619
tokio = { version = "1.37.0", features = ["full"] }
1720

packages/livekit-rtc/rust-sdks

Submodule rust-sdks updated 221 files

packages/livekit-rtc/src/proto/data_stream_pb.ts

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2121
import { Message, proto2 } from "@bufbuild/protobuf";
2222
import { FfiOwnedHandle } from "./handle_pb.js";
23+
import { EncryptionType } from "./e2ee_pb.js";
2324

2425
/**
2526
* A reader for an incoming stream.
@@ -1074,6 +1075,152 @@ export class StreamSendFileCallback extends Message<StreamSendFileCallback> {
10741075
}
10751076
}
10761077

1078+
/**
1079+
* Sends bytes over a data stream.
1080+
*
1081+
* @generated from message livekit.proto.StreamSendBytesRequest
1082+
*/
1083+
export class StreamSendBytesRequest extends Message<StreamSendBytesRequest> {
1084+
/**
1085+
* @generated from field: required uint64 local_participant_handle = 1;
1086+
*/
1087+
localParticipantHandle?: bigint;
1088+
1089+
/**
1090+
* @generated from field: required livekit.proto.StreamByteOptions options = 2;
1091+
*/
1092+
options?: StreamByteOptions;
1093+
1094+
/**
1095+
* Bytes to send.
1096+
*
1097+
* @generated from field: required bytes bytes = 3;
1098+
*/
1099+
bytes?: Uint8Array;
1100+
1101+
constructor(data?: PartialMessage<StreamSendBytesRequest>) {
1102+
super();
1103+
proto2.util.initPartial(data, this);
1104+
}
1105+
1106+
static readonly runtime: typeof proto2 = proto2;
1107+
static readonly typeName = "livekit.proto.StreamSendBytesRequest";
1108+
static readonly fields: FieldList = proto2.util.newFieldList(() => [
1109+
{ no: 1, name: "local_participant_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true },
1110+
{ no: 2, name: "options", kind: "message", T: StreamByteOptions, req: true },
1111+
{ no: 3, name: "bytes", kind: "scalar", T: 12 /* ScalarType.BYTES */, req: true },
1112+
]);
1113+
1114+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StreamSendBytesRequest {
1115+
return new StreamSendBytesRequest().fromBinary(bytes, options);
1116+
}
1117+
1118+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): StreamSendBytesRequest {
1119+
return new StreamSendBytesRequest().fromJson(jsonValue, options);
1120+
}
1121+
1122+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): StreamSendBytesRequest {
1123+
return new StreamSendBytesRequest().fromJsonString(jsonString, options);
1124+
}
1125+
1126+
static equals(a: StreamSendBytesRequest | PlainMessage<StreamSendBytesRequest> | undefined, b: StreamSendBytesRequest | PlainMessage<StreamSendBytesRequest> | undefined): boolean {
1127+
return proto2.util.equals(StreamSendBytesRequest, a, b);
1128+
}
1129+
}
1130+
1131+
/**
1132+
* @generated from message livekit.proto.StreamSendBytesResponse
1133+
*/
1134+
export class StreamSendBytesResponse extends Message<StreamSendBytesResponse> {
1135+
/**
1136+
* @generated from field: required uint64 async_id = 1;
1137+
*/
1138+
asyncId?: bigint;
1139+
1140+
constructor(data?: PartialMessage<StreamSendBytesResponse>) {
1141+
super();
1142+
proto2.util.initPartial(data, this);
1143+
}
1144+
1145+
static readonly runtime: typeof proto2 = proto2;
1146+
static readonly typeName = "livekit.proto.StreamSendBytesResponse";
1147+
static readonly fields: FieldList = proto2.util.newFieldList(() => [
1148+
{ no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true },
1149+
]);
1150+
1151+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StreamSendBytesResponse {
1152+
return new StreamSendBytesResponse().fromBinary(bytes, options);
1153+
}
1154+
1155+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): StreamSendBytesResponse {
1156+
return new StreamSendBytesResponse().fromJson(jsonValue, options);
1157+
}
1158+
1159+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): StreamSendBytesResponse {
1160+
return new StreamSendBytesResponse().fromJsonString(jsonString, options);
1161+
}
1162+
1163+
static equals(a: StreamSendBytesResponse | PlainMessage<StreamSendBytesResponse> | undefined, b: StreamSendBytesResponse | PlainMessage<StreamSendBytesResponse> | undefined): boolean {
1164+
return proto2.util.equals(StreamSendBytesResponse, a, b);
1165+
}
1166+
}
1167+
1168+
/**
1169+
* @generated from message livekit.proto.StreamSendBytesCallback
1170+
*/
1171+
export class StreamSendBytesCallback extends Message<StreamSendBytesCallback> {
1172+
/**
1173+
* @generated from field: required uint64 async_id = 1;
1174+
*/
1175+
asyncId?: bigint;
1176+
1177+
/**
1178+
* @generated from oneof livekit.proto.StreamSendBytesCallback.result
1179+
*/
1180+
result: {
1181+
/**
1182+
* @generated from field: livekit.proto.ByteStreamInfo info = 2;
1183+
*/
1184+
value: ByteStreamInfo;
1185+
case: "info";
1186+
} | {
1187+
/**
1188+
* @generated from field: livekit.proto.StreamError error = 3;
1189+
*/
1190+
value: StreamError;
1191+
case: "error";
1192+
} | { case: undefined; value?: undefined } = { case: undefined };
1193+
1194+
constructor(data?: PartialMessage<StreamSendBytesCallback>) {
1195+
super();
1196+
proto2.util.initPartial(data, this);
1197+
}
1198+
1199+
static readonly runtime: typeof proto2 = proto2;
1200+
static readonly typeName = "livekit.proto.StreamSendBytesCallback";
1201+
static readonly fields: FieldList = proto2.util.newFieldList(() => [
1202+
{ no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true },
1203+
{ no: 2, name: "info", kind: "message", T: ByteStreamInfo, oneof: "result" },
1204+
{ no: 3, name: "error", kind: "message", T: StreamError, oneof: "result" },
1205+
]);
1206+
1207+
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): StreamSendBytesCallback {
1208+
return new StreamSendBytesCallback().fromBinary(bytes, options);
1209+
}
1210+
1211+
static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): StreamSendBytesCallback {
1212+
return new StreamSendBytesCallback().fromJson(jsonValue, options);
1213+
}
1214+
1215+
static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): StreamSendBytesCallback {
1216+
return new StreamSendBytesCallback().fromJsonString(jsonString, options);
1217+
}
1218+
1219+
static equals(a: StreamSendBytesCallback | PlainMessage<StreamSendBytesCallback> | undefined, b: StreamSendBytesCallback | PlainMessage<StreamSendBytesCallback> | undefined): boolean {
1220+
return proto2.util.equals(StreamSendBytesCallback, a, b);
1221+
}
1222+
}
1223+
10771224
/**
10781225
* Sends text over a data stream.
10791226
*
@@ -2163,6 +2310,11 @@ export class TextStreamInfo extends Message<TextStreamInfo> {
21632310
*/
21642311
generated?: boolean;
21652312

2313+
/**
2314+
* @generated from field: required livekit.proto.EncryptionType encryption_type = 12;
2315+
*/
2316+
encryptionType?: EncryptionType;
2317+
21662318
constructor(data?: PartialMessage<TextStreamInfo>) {
21672319
super();
21682320
proto2.util.initPartial(data, this);
@@ -2182,6 +2334,7 @@ export class TextStreamInfo extends Message<TextStreamInfo> {
21822334
{ no: 9, name: "reply_to_stream_id", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
21832335
{ no: 10, name: "attached_stream_ids", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true },
21842336
{ no: 11, name: "generated", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
2337+
{ no: 12, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true },
21852338
]);
21862339

21872340
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): TextStreamInfo {
@@ -2280,6 +2433,11 @@ export class ByteStreamInfo extends Message<ByteStreamInfo> {
22802433
*/
22812434
name?: string;
22822435

2436+
/**
2437+
* @generated from field: required livekit.proto.EncryptionType encryption_type = 8;
2438+
*/
2439+
encryptionType?: EncryptionType;
2440+
22832441
constructor(data?: PartialMessage<ByteStreamInfo>) {
22842442
super();
22852443
proto2.util.initPartial(data, this);
@@ -2295,6 +2453,7 @@ export class ByteStreamInfo extends Message<ByteStreamInfo> {
22952453
{ no: 5, name: "total_length", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true },
22962454
{ no: 6, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} },
22972455
{ no: 7, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, req: true },
2456+
{ no: 8, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true },
22982457
]);
22992458

23002459
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): ByteStreamInfo {

packages/livekit-rtc/src/proto/ffi_pb.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { ApmProcessReverseStreamRequest, ApmProcessReverseStreamResponse, ApmPro
2626
import { E2eeRequest, E2eeResponse } from "./e2ee_pb.js";
2727
import { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMethodRequest, RegisterRpcMethodResponse, RpcMethodInvocationEvent, RpcMethodInvocationResponseRequest, RpcMethodInvocationResponseResponse, UnregisterRpcMethodRequest, UnregisterRpcMethodResponse } from "./rpc_pb.js";
2828
import { EnableRemoteTrackPublicationRequest, EnableRemoteTrackPublicationResponse, UpdateRemoteTrackPublicationDimensionRequest, UpdateRemoteTrackPublicationDimensionResponse } from "./track_publication_pb.js";
29-
import { ByteStreamOpenCallback, ByteStreamOpenRequest, ByteStreamOpenResponse, ByteStreamReaderEvent, ByteStreamReaderReadAllCallback, ByteStreamReaderReadAllRequest, ByteStreamReaderReadAllResponse, ByteStreamReaderReadIncrementalRequest, ByteStreamReaderReadIncrementalResponse, ByteStreamReaderWriteToFileCallback, ByteStreamReaderWriteToFileRequest, ByteStreamReaderWriteToFileResponse, ByteStreamWriterCloseCallback, ByteStreamWriterCloseRequest, ByteStreamWriterCloseResponse, ByteStreamWriterWriteCallback, ByteStreamWriterWriteRequest, ByteStreamWriterWriteResponse, StreamSendFileCallback, StreamSendFileRequest, StreamSendFileResponse, StreamSendTextCallback, StreamSendTextRequest, StreamSendTextResponse, TextStreamOpenCallback, TextStreamOpenRequest, TextStreamOpenResponse, TextStreamReaderEvent, TextStreamReaderReadAllCallback, TextStreamReaderReadAllRequest, TextStreamReaderReadAllResponse, TextStreamReaderReadIncrementalRequest, TextStreamReaderReadIncrementalResponse, TextStreamWriterCloseCallback, TextStreamWriterCloseRequest, TextStreamWriterCloseResponse, TextStreamWriterWriteCallback, TextStreamWriterWriteRequest, TextStreamWriterWriteResponse } from "./data_stream_pb.js";
29+
import { ByteStreamOpenCallback, ByteStreamOpenRequest, ByteStreamOpenResponse, ByteStreamReaderEvent, ByteStreamReaderReadAllCallback, ByteStreamReaderReadAllRequest, ByteStreamReaderReadAllResponse, ByteStreamReaderReadIncrementalRequest, ByteStreamReaderReadIncrementalResponse, ByteStreamReaderWriteToFileCallback, ByteStreamReaderWriteToFileRequest, ByteStreamReaderWriteToFileResponse, ByteStreamWriterCloseCallback, ByteStreamWriterCloseRequest, ByteStreamWriterCloseResponse, ByteStreamWriterWriteCallback, ByteStreamWriterWriteRequest, ByteStreamWriterWriteResponse, StreamSendBytesCallback, StreamSendBytesRequest, StreamSendBytesResponse, StreamSendFileCallback, StreamSendFileRequest, StreamSendFileResponse, StreamSendTextCallback, StreamSendTextRequest, StreamSendTextResponse, TextStreamOpenCallback, TextStreamOpenRequest, TextStreamOpenResponse, TextStreamReaderEvent, TextStreamReaderReadAllCallback, TextStreamReaderReadAllRequest, TextStreamReaderReadAllResponse, TextStreamReaderReadIncrementalRequest, TextStreamReaderReadIncrementalResponse, TextStreamWriterCloseCallback, TextStreamWriterCloseRequest, TextStreamWriterCloseResponse, TextStreamWriterWriteCallback, TextStreamWriterWriteRequest, TextStreamWriterWriteResponse } from "./data_stream_pb.js";
3030

3131
/**
3232
* @generated from enum livekit.proto.LogLevel
@@ -486,6 +486,12 @@ export class FfiRequest extends Message<FfiRequest> {
486486
*/
487487
value: TextStreamWriterCloseRequest;
488488
case: "textStreamClose";
489+
} | {
490+
/**
491+
* @generated from field: livekit.proto.StreamSendBytesRequest send_bytes = 67;
492+
*/
493+
value: StreamSendBytesRequest;
494+
case: "sendBytes";
489495
} | { case: undefined; value?: undefined } = { case: undefined };
490496

491497
constructor(data?: PartialMessage<FfiRequest>) {
@@ -561,6 +567,7 @@ export class FfiRequest extends Message<FfiRequest> {
561567
{ no: 64, name: "text_stream_open", kind: "message", T: TextStreamOpenRequest, oneof: "message" },
562568
{ no: 65, name: "text_stream_write", kind: "message", T: TextStreamWriterWriteRequest, oneof: "message" },
563569
{ no: 66, name: "text_stream_close", kind: "message", T: TextStreamWriterCloseRequest, oneof: "message" },
570+
{ no: 67, name: "send_bytes", kind: "message", T: StreamSendBytesRequest, oneof: "message" },
564571
]);
565572

566573
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiRequest {
@@ -993,6 +1000,12 @@ export class FfiResponse extends Message<FfiResponse> {
9931000
*/
9941001
value: TextStreamWriterCloseResponse;
9951002
case: "textStreamClose";
1003+
} | {
1004+
/**
1005+
* @generated from field: livekit.proto.StreamSendBytesResponse send_bytes = 66;
1006+
*/
1007+
value: StreamSendBytesResponse;
1008+
case: "sendBytes";
9961009
} | { case: undefined; value?: undefined } = { case: undefined };
9971010

9981011
constructor(data?: PartialMessage<FfiResponse>) {
@@ -1067,6 +1080,7 @@ export class FfiResponse extends Message<FfiResponse> {
10671080
{ no: 63, name: "text_stream_open", kind: "message", T: TextStreamOpenResponse, oneof: "message" },
10681081
{ no: 64, name: "text_stream_write", kind: "message", T: TextStreamWriterWriteResponse, oneof: "message" },
10691082
{ no: 65, name: "text_stream_close", kind: "message", T: TextStreamWriterCloseResponse, oneof: "message" },
1083+
{ no: 66, name: "send_bytes", kind: "message", T: StreamSendBytesResponse, oneof: "message" },
10701084
]);
10711085

10721086
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiResponse {
@@ -1335,6 +1349,12 @@ export class FfiEvent extends Message<FfiEvent> {
13351349
*/
13361350
value: StreamSendTextCallback;
13371351
case: "sendText";
1352+
} | {
1353+
/**
1354+
* @generated from field: livekit.proto.StreamSendBytesCallback send_bytes = 41;
1355+
*/
1356+
value: StreamSendBytesCallback;
1357+
case: "sendBytes";
13381358
} | { case: undefined; value?: undefined } = { case: undefined };
13391359

13401360
constructor(data?: PartialMessage<FfiEvent>) {
@@ -1384,6 +1404,7 @@ export class FfiEvent extends Message<FfiEvent> {
13841404
{ no: 38, name: "text_stream_writer_write", kind: "message", T: TextStreamWriterWriteCallback, oneof: "message" },
13851405
{ no: 39, name: "text_stream_writer_close", kind: "message", T: TextStreamWriterCloseCallback, oneof: "message" },
13861406
{ no: 40, name: "send_text", kind: "message", T: StreamSendTextCallback, oneof: "message" },
1407+
{ no: 41, name: "send_bytes", kind: "message", T: StreamSendBytesCallback, oneof: "message" },
13871408
]);
13881409

13891410
static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): FfiEvent {

0 commit comments

Comments
 (0)