From 9087e36cf701e4b918c974f8d3598a9d0612e179 Mon Sep 17 00:00:00 2001 From: Alan George Date: Fri, 16 Oct 2026 07:27:44 +0800 Subject: [PATCH 1/3] Avoid creating full encoder for jetson probing capability --- .../src/jetson/jetson_mmapi_encoder.cpp | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/webrtc-sys/src/jetson/jetson_mmapi_encoder.cpp b/webrtc-sys/src/jetson/jetson_mmapi_encoder.cpp index d67ac1d16..ae302e429 100644 --- a/webrtc-sys/src/jetson/jetson_mmapi_encoder.cpp +++ b/webrtc-sys/src/jetson/jetson_mmapi_encoder.cpp @@ -53,6 +53,17 @@ bool DeviceExists(const char* path) { return stat(path, &st) == 0; } +bool IsOrinPlatform() { + std::ifstream compatible("/proc/device-tree/compatible", + std::ios::in | std::ios::binary); + if (!compatible) { + return false; + } + const std::string contents((std::istreambuf_iterator(compatible)), + std::istreambuf_iterator()); + return contents.find("nvidia,tegra234") != std::string::npos; +} + void CopyPlane(uint8_t* dst, int dst_stride, const uint8_t* src, @@ -176,22 +187,16 @@ bool JetsonMmapiEncoder::IsCodecSupported(JetsonCodec codec) { "libraries (libnvbufsurface/libv4l2) could not be loaded."; return false; } - std::unique_ptr encoder( - NvVideoEncoder::createVideoEncoder("livekit-encoder")); - if (!encoder) { - return false; - } - const uint32_t pixfmt = CodecToV4L2PixFmt(codec); - if (encoder->setCapturePlaneFormat(pixfmt, 64, 64, - kMinBitstreamBufferSize) < 0) { - const uint32_t fallback_pixfmt = CodecToV4L2FallbackPixFmt(codec); - if (fallback_pixfmt == pixfmt || - encoder->setCapturePlaneFormat(fallback_pixfmt, 64, 64, - kMinBitstreamBufferSize) < 0) { - return false; - } - } - return true; + // Do not create a temporary NvVideoEncoder here. NvVideoEncoder uses + // libv4l2, whose v4l2_close() unloads NVIDIA's nvvideocodec plugin on + // JetPack. That unload invalidates GLib thread-local state used by a + // subsequently-created nvarguscamerasrc pipeline. Capability discovery must + // therefore remain passive; Initialize() performs the authoritative check + // when an encoder is actually needed and keeps it alive for the session. + // + // H.264 and H.265 are supported by every Jetson encoder exposed through + // these device nodes. AV1 encoding starts with Orin (Tegra234). + return codec != JetsonCodec::kAV1 || IsOrinPlatform(); } std::optional JetsonMmapiEncoder::FindEncoderDevice() { From 4ba74985593f1c6e421aec4d0c87da53f934ee8f Mon Sep 17 00:00:00 2001 From: Alan George Date: Sat, 17 Oct 2026 03:31:35 +0800 Subject: [PATCH 2/3] Refactor after sync --- livekit-ffi/protocol/capture.proto | 25 ++++-- livekit-ffi/protocol/ffi.proto | 11 ++- livekit-ffi/src/server/capture.rs | 139 ++++++++++++++++++++--------- livekit-ffi/src/server/requests.rs | 7 +- 4 files changed, 128 insertions(+), 54 deletions(-) diff --git a/livekit-ffi/protocol/capture.proto b/livekit-ffi/protocol/capture.proto index 331d62dfa..9f1d5012a 100644 --- a/livekit-ffi/protocol/capture.proto +++ b/livekit-ffi/protocol/capture.proto @@ -34,8 +34,9 @@ import "video_frame.proto"; // embeds an OwnedVideoSource for the existing CreateVideoTrackRequest and // the recommended TrackPublishOptions for PublishTrackRequest. // 2. StartCaptureRequest: starts pumping frames into the RTC source. -// 3. The capture runs until StopCaptureRequest, end of stream, or an error; -// a CaptureSourceEvent is delivered exactly once when it ends. +// 3. StopCaptureRequest signals the pump to stop without waiting. +// 4. JoinCaptureRequest consumes the running pump and completes asynchronously +// after its thread exits, returning its terminal result. // Bitrate unit expected by a GStreamer encoder property. enum GstreamerBitrateUnit { @@ -153,12 +154,19 @@ message NewCaptureSourceCallback { message StartCaptureRequest { required uint64 capture_handle = 1; } message StartCaptureResponse { optional string error = 1; } -// Signal a running capture to stop after the frame in flight. The terminal -// CaptureSourceEvent follows shortly. Stopping an already-finished capture -// is a no-op. +// Signal a running capture to stop after the frame in flight without waiting +// for its thread to exit. Stopping an already-finished capture is a no-op. message StopCaptureRequest { required uint64 capture_handle = 1; } message StopCaptureResponse { optional string error = 1; } +// Consume a running capture and wait asynchronously for its pump thread to +// exit. Like RunningPump::join, this does not signal the pump to stop. +message JoinCaptureRequest { + required uint64 capture_handle = 1; + optional uint64 request_async_id = 2; +} +message JoinCaptureResponse { required uint64 async_id = 1; } + // Why a capture ended without error. enum CaptureExit { // Stopped by StopCaptureRequest (or handle disposal). @@ -174,10 +182,9 @@ message CaptureFinished { message CaptureError { required string error = 1; } -// Delivered exactly once when a started capture ends, regardless of why -// (stop request, end of stream, or failure). -message CaptureSourceEvent { - required uint64 capture_handle = 1; +// Completes JoinCaptureRequest with the pump's terminal result. +message JoinCaptureCallback { + required uint64 async_id = 1; oneof message { CaptureFinished finished = 2; CaptureError error = 3; diff --git a/livekit-ffi/protocol/ffi.proto b/livekit-ffi/protocol/ffi.proto index c4461bc7e..31d70854a 100644 --- a/livekit-ffi/protocol/ffi.proto +++ b/livekit-ffi/protocol/ffi.proto @@ -193,8 +193,9 @@ message FfiRequest { NewCaptureSourceRequest new_capture_source = 91; StartCaptureRequest start_capture = 89; StopCaptureRequest stop_capture = 90; + JoinCaptureRequest join_capture = 92; - // NEXT_ID: 92 + // NEXT_ID: 93 } } @@ -331,8 +332,9 @@ message FfiResponse { NewCaptureSourceResponse new_capture_source = 91; StartCaptureResponse start_capture = 89; StopCaptureResponse stop_capture = 90; + JoinCaptureResponse join_capture = 92; - // NEXT_ID: 92 + // NEXT_ID: 93 } } @@ -340,6 +342,7 @@ message FfiResponse { // It is easily deducible from the room events and it turned out that is is easier to implement // on the ffi client side. message FfiEvent { + reserved 48; // Removed CaptureSourceEvent. oneof message { RoomEvent room_event = 1; TrackEvent track_event = 2; @@ -403,9 +406,9 @@ message FfiEvent { // Capture sources (livekit-capture; requires the `capture` feature) NewCaptureSourceCallback new_capture_source = 47; - CaptureSourceEvent capture_source_event = 48; + JoinCaptureCallback join_capture = 49; - // NEXT_ID: 49 + // NEXT_ID: 50 } } diff --git a/livekit-ffi/src/server/capture.rs b/livekit-ffi/src/server/capture.rs index 09838fe32..f195221c1 100644 --- a/livekit-ffi/src/server/capture.rs +++ b/livekit-ffi/src/server/capture.rs @@ -62,9 +62,11 @@ impl CapturePump { enum CaptureState { /// Created but not started. Idle(CapturePump), - /// Started; the watcher task owns the running pump. - Running, - /// The capture ended; the terminal event has been dispatched. + /// Started; the FFI object owns the running pump until join consumes it. + Running(RunningPump), + /// A join request consumed the running pump and is awaiting its thread. + Joining, + /// The capture was joined or failed to start. Finished, } @@ -79,10 +81,9 @@ impl FfiHandle for FfiCaptureSource {} impl Drop for FfiCaptureSource { fn drop(&mut self) { - // Disposing a running capture stops it; the pump thread observes the - // signal within one bounded wait and drops the source (stopping the - // producer). The watcher task delivers the terminal event, which may - // trail the disposal. + // Signal in every state, including Joining after ownership moved into + // the join request task. In Running, dropping `state` immediately + // afterward also drops the owned RunningPump. self.stop.stop(); } } @@ -236,11 +237,11 @@ pub fn on_start_capture( let ffi_capture = server.retrieve_handle::(capture_handle)?; let mut state = ffi_capture.state.lock(); - let pump = match std::mem::replace(&mut *state, CaptureState::Running) { + let pump = match std::mem::replace(&mut *state, CaptureState::Finished) { CaptureState::Idle(pump) => pump, other => { let error = match &other { - CaptureState::Running => "capture is already started", + CaptureState::Running(_) | CaptureState::Joining => "capture is already started", _ => "capture has already finished", }; *state = other; @@ -257,25 +258,12 @@ pub fn on_start_capture( }); } }; - drop(state); - drop(ffi_capture); - - // The watcher owns the running pump and delivers the terminal event - // exactly once, whether the capture is stopped, ends, or fails. - server.async_runtime.spawn(async move { - let result = running.join().await; - if let Ok(ffi_capture) = server.retrieve_handle::(capture_handle) { - *ffi_capture.state.lock() = CaptureState::Finished; - } - let _ = server.send_event(proto::ffi_event::Message::CaptureSourceEvent( - proto::CaptureSourceEvent { capture_handle, message: Some(result.into()) }, - )); - }); + *state = CaptureState::Running(running); Ok(proto::StartCaptureResponse { error: None }) } -impl From> for proto::capture_source_event::Message { +impl From> for proto::join_capture_callback::Message { fn from(result: Result) -> Self { match result { Ok(stats) => { @@ -302,19 +290,82 @@ pub fn on_stop_capture( Ok(proto::StopCaptureResponse { error: None }) } +pub fn on_join_capture( + server: &'static FfiServer, + request: proto::JoinCaptureRequest, +) -> FfiResult { + let async_id = server.resolve_async_id(request.request_async_id); + let capture_handle = request.capture_handle; + let ffi_capture = server.retrieve_handle::(capture_handle)?; + + let mut state = ffi_capture.state.lock(); + let running = match std::mem::replace(&mut *state, CaptureState::Finished) { + CaptureState::Running(running) => { + *state = CaptureState::Joining; + running + } + other => { + let error = match &other { + CaptureState::Idle(_) => "capture has not been started", + CaptureState::Joining => "capture join is already in progress", + CaptureState::Finished => "capture has already been joined", + CaptureState::Running(_) => unreachable!(), + }; + *state = other; + drop(state); + drop(ffi_capture); + let _ = server.send_event(proto::ffi_event::Message::JoinCapture( + proto::JoinCaptureCallback { + async_id, + message: Some(proto::join_capture_callback::Message::Error( + proto::CaptureError { error: error.to_owned() }, + )), + }, + )); + return Ok(proto::JoinCaptureResponse { async_id }); + } + }; + drop(state); + drop(ffi_capture); + + server.async_runtime.spawn(async move { + let result = running.join().await; + if let Ok(ffi_capture) = server.retrieve_handle::(capture_handle) { + *ffi_capture.state.lock() = CaptureState::Finished; + } + let _ = + server.send_event(proto::ffi_event::Message::JoinCapture(proto::JoinCaptureCallback { + async_id, + message: Some(result.into()), + })); + }); + + Ok(proto::JoinCaptureResponse { async_id }) +} + #[cfg(all(test, feature = "capture-pattern"))] mod tests { use super::*; - use crate::FFI_SERVER; - use std::time::Duration; + use crate::{server::FfiConfig, FFI_SERVER}; + use std::{sync::Arc, time::Duration}; fn server() -> &'static FfiServer { &FFI_SERVER } - #[serial_test::parallel] + #[serial_test::serial] #[test] fn pattern_capture_lifecycle() { + let (event_tx, event_rx) = std::sync::mpsc::channel(); + server().setup(FfiConfig { + callback_fn: Arc::new(move |event| { + let _ = event_tx.send(event); + }), + capture_logs: false, + sdk: "livekit-ffi-test".to_owned(), + sdk_version: "test".to_owned(), + }); + let request = proto::NewCaptureSourceRequest { config: Some(proto::new_capture_source_request::Config::Pattern( proto::PatternVideoSourceConfig { @@ -334,7 +385,7 @@ mod tests { let capture_handle = source.handle.id; // Stopping before starting is allowed; the pump then exits - // immediately once started, and the watcher marks it finished. + // immediately once started, and join reports its result. let response = on_stop_capture(server(), proto::StopCaptureRequest { capture_handle }).unwrap(); assert_eq!(response.error, None); @@ -347,20 +398,28 @@ mod tests { on_start_capture(server(), proto::StartCaptureRequest { capture_handle }).unwrap(); assert!(response.error.is_some(), "double start must be rejected"); - let deadline = std::time::Instant::now() + Duration::from_secs(5); - loop { - { - let ffi_capture = - server().retrieve_handle::(capture_handle).unwrap(); - if matches!(*ffi_capture.state.lock(), CaptureState::Finished) { - break; - } - } - assert!(std::time::Instant::now() < deadline, "capture did not finish"); - std::thread::sleep(Duration::from_millis(10)); - } + let response = on_join_capture( + server(), + proto::JoinCaptureRequest { capture_handle, request_async_id: Some(42) }, + ) + .unwrap(); + assert_eq!(response.async_id, 42); + + let event = + event_rx.recv_timeout(Duration::from_secs(5)).expect("capture join did not complete"); + let callback = match event.message { + Some(proto::ffi_event::Message::JoinCapture(callback)) => callback, + other => panic!("expected join capture callback, got {other:?}"), + }; + assert_eq!(callback.async_id, 42); + let finished = match callback.message { + Some(proto::join_capture_callback::Message::Finished(finished)) => finished, + other => panic!("expected finished capture result, got {other:?}"), + }; + assert_eq!(finished.exit(), proto::CaptureExit::Stopped); server().drop_handle(capture_handle); server().drop_handle(source.info.video_source.handle.id); + *server().config.lock() = None; } } diff --git a/livekit-ffi/src/server/requests.rs b/livekit-ffi/src/server/requests.rs index 52c1d33c2..d1a733f58 100644 --- a/livekit-ffi/src/server/requests.rs +++ b/livekit-ffi/src/server/requests.rs @@ -1525,8 +1525,13 @@ pub fn handle_request( Request::StartCapture(req) => capture::on_start_capture(server, req)?.into(), #[cfg(feature = "capture")] Request::StopCapture(req) => capture::on_stop_capture(server, req)?.into(), + #[cfg(feature = "capture")] + Request::JoinCapture(req) => capture::on_join_capture(server, req)?.into(), #[cfg(not(feature = "capture"))] - Request::NewCaptureSource(_) | Request::StartCapture(_) | Request::StopCapture(_) => { + Request::NewCaptureSource(_) + | Request::StartCapture(_) + | Request::StopCapture(_) + | Request::JoinCapture(_) => { return Err(FfiError::InvalidRequest( "livekit-ffi was built without the 'capture' feature".into(), )); From e0e86240b66b8538bcce2b3f65cfaa647c8b3493 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Oct 2026 19:32:33 +0000 Subject: [PATCH 3/3] generated protobuf --- .../proto/capture_pb.d.ts | 86 +++++++++++++++---- livekit-ffi-node-bindings/proto/capture_pb.js | 44 +++++++--- livekit-ffi-node-bindings/proto/ffi_pb.d.ts | 20 ++++- livekit-ffi-node-bindings/proto/ffi_pb.js | 6 +- 4 files changed, 124 insertions(+), 32 deletions(-) diff --git a/livekit-ffi-node-bindings/proto/capture_pb.d.ts b/livekit-ffi-node-bindings/proto/capture_pb.d.ts index abba9e80d..cc6477155 100644 --- a/livekit-ffi-node-bindings/proto/capture_pb.d.ts +++ b/livekit-ffi-node-bindings/proto/capture_pb.d.ts @@ -532,9 +532,8 @@ export declare class StartCaptureResponse extends Message } /** - * Signal a running capture to stop after the frame in flight. The terminal - * CaptureSourceEvent follows shortly. Stopping an already-finished capture - * is a no-op. + * Signal a running capture to stop after the frame in flight without waiting + * for its thread to exit. Stopping an already-finished capture is a no-op. * * @generated from message livekit.proto.StopCaptureRequest */ @@ -583,6 +582,62 @@ export declare class StopCaptureResponse extends Message { static equals(a: StopCaptureResponse | PlainMessage | undefined, b: StopCaptureResponse | PlainMessage | undefined): boolean; } +/** + * Consume a running capture and wait asynchronously for its pump thread to + * exit. Like RunningPump::join, this does not signal the pump to stop. + * + * @generated from message livekit.proto.JoinCaptureRequest + */ +export declare class JoinCaptureRequest extends Message { + /** + * @generated from field: required uint64 capture_handle = 1; + */ + captureHandle?: bigint; + + /** + * @generated from field: optional uint64 request_async_id = 2; + */ + requestAsyncId?: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto2; + static readonly typeName = "livekit.proto.JoinCaptureRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): JoinCaptureRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): JoinCaptureRequest; + + static fromJsonString(jsonString: string, options?: Partial): JoinCaptureRequest; + + static equals(a: JoinCaptureRequest | PlainMessage | undefined, b: JoinCaptureRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message livekit.proto.JoinCaptureResponse + */ +export declare class JoinCaptureResponse extends Message { + /** + * @generated from field: required uint64 async_id = 1; + */ + asyncId?: bigint; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto2; + static readonly typeName = "livekit.proto.JoinCaptureResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): JoinCaptureResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): JoinCaptureResponse; + + static fromJsonString(jsonString: string, options?: Partial): JoinCaptureResponse; + + static equals(a: JoinCaptureResponse | PlainMessage | undefined, b: JoinCaptureResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message livekit.proto.CaptureFinished */ @@ -637,19 +692,18 @@ export declare class CaptureError extends Message { } /** - * Delivered exactly once when a started capture ends, regardless of why - * (stop request, end of stream, or failure). + * Completes JoinCaptureRequest with the pump's terminal result. * - * @generated from message livekit.proto.CaptureSourceEvent + * @generated from message livekit.proto.JoinCaptureCallback */ -export declare class CaptureSourceEvent extends Message { +export declare class JoinCaptureCallback extends Message { /** - * @generated from field: required uint64 capture_handle = 1; + * @generated from field: required uint64 async_id = 1; */ - captureHandle?: bigint; + asyncId?: bigint; /** - * @generated from oneof livekit.proto.CaptureSourceEvent.message + * @generated from oneof livekit.proto.JoinCaptureCallback.message */ message: { /** @@ -665,18 +719,18 @@ export declare class CaptureSourceEvent extends Message { case: "error"; } | { case: undefined; value?: undefined }; - constructor(data?: PartialMessage); + constructor(data?: PartialMessage); static readonly runtime: typeof proto2; - static readonly typeName = "livekit.proto.CaptureSourceEvent"; + static readonly typeName = "livekit.proto.JoinCaptureCallback"; static readonly fields: FieldList; - static fromBinary(bytes: Uint8Array, options?: Partial): CaptureSourceEvent; + static fromBinary(bytes: Uint8Array, options?: Partial): JoinCaptureCallback; - static fromJson(jsonValue: JsonValue, options?: Partial): CaptureSourceEvent; + static fromJson(jsonValue: JsonValue, options?: Partial): JoinCaptureCallback; - static fromJsonString(jsonString: string, options?: Partial): CaptureSourceEvent; + static fromJsonString(jsonString: string, options?: Partial): JoinCaptureCallback; - static equals(a: CaptureSourceEvent | PlainMessage | undefined, b: CaptureSourceEvent | PlainMessage | undefined): boolean; + static equals(a: JoinCaptureCallback | PlainMessage | undefined, b: JoinCaptureCallback | PlainMessage | undefined): boolean; } diff --git a/livekit-ffi-node-bindings/proto/capture_pb.js b/livekit-ffi-node-bindings/proto/capture_pb.js index 446d58cc9..12cf5a90d 100644 --- a/livekit-ffi-node-bindings/proto/capture_pb.js +++ b/livekit-ffi-node-bindings/proto/capture_pb.js @@ -223,9 +223,8 @@ const StartCaptureResponse = /*@__PURE__*/ proto2.makeMessageType( ); /** - * Signal a running capture to stop after the frame in flight. The terminal - * CaptureSourceEvent follows shortly. Stopping an already-finished capture - * is a no-op. + * Signal a running capture to stop after the frame in flight without waiting + * for its thread to exit. Stopping an already-finished capture is a no-op. * * @generated from message livekit.proto.StopCaptureRequest */ @@ -246,6 +245,30 @@ const StopCaptureResponse = /*@__PURE__*/ proto2.makeMessageType( ], ); +/** + * Consume a running capture and wait asynchronously for its pump thread to + * exit. Like RunningPump::join, this does not signal the pump to stop. + * + * @generated from message livekit.proto.JoinCaptureRequest + */ +const JoinCaptureRequest = /*@__PURE__*/ proto2.makeMessageType( + "livekit.proto.JoinCaptureRequest", + () => [ + { no: 1, name: "capture_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 2, name: "request_async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, opt: true }, + ], +); + +/** + * @generated from message livekit.proto.JoinCaptureResponse + */ +const JoinCaptureResponse = /*@__PURE__*/ proto2.makeMessageType( + "livekit.proto.JoinCaptureResponse", + () => [ + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + ], +); + /** * @generated from message livekit.proto.CaptureFinished */ @@ -268,15 +291,14 @@ const CaptureError = /*@__PURE__*/ proto2.makeMessageType( ); /** - * Delivered exactly once when a started capture ends, regardless of why - * (stop request, end of stream, or failure). + * Completes JoinCaptureRequest with the pump's terminal result. * - * @generated from message livekit.proto.CaptureSourceEvent + * @generated from message livekit.proto.JoinCaptureCallback */ -const CaptureSourceEvent = /*@__PURE__*/ proto2.makeMessageType( - "livekit.proto.CaptureSourceEvent", +const JoinCaptureCallback = /*@__PURE__*/ proto2.makeMessageType( + "livekit.proto.JoinCaptureCallback", () => [ - { no: 1, name: "capture_handle", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, + { no: 1, name: "async_id", kind: "scalar", T: 4 /* ScalarType.UINT64 */, req: true }, { no: 2, name: "finished", kind: "message", T: CaptureFinished, oneof: "message" }, { no: 3, name: "error", kind: "message", T: CaptureError, oneof: "message" }, ], @@ -300,6 +322,8 @@ exports.StartCaptureRequest = StartCaptureRequest; exports.StartCaptureResponse = StartCaptureResponse; exports.StopCaptureRequest = StopCaptureRequest; exports.StopCaptureResponse = StopCaptureResponse; +exports.JoinCaptureRequest = JoinCaptureRequest; +exports.JoinCaptureResponse = JoinCaptureResponse; exports.CaptureFinished = CaptureFinished; exports.CaptureError = CaptureError; -exports.CaptureSourceEvent = CaptureSourceEvent; +exports.JoinCaptureCallback = JoinCaptureCallback; diff --git a/livekit-ffi-node-bindings/proto/ffi_pb.d.ts b/livekit-ffi-node-bindings/proto/ffi_pb.d.ts index 93994e73f..b57869975 100644 --- a/livekit-ffi-node-bindings/proto/ffi_pb.d.ts +++ b/livekit-ffi-node-bindings/proto/ffi_pb.d.ts @@ -28,7 +28,7 @@ import type { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, Registe import type { EnableRemoteTrackPublicationRequest, EnableRemoteTrackPublicationResponse, SetRemoteTrackPublicationQualityRequest, SetRemoteTrackPublicationQualityResponse, UpdateRemoteTrackPublicationDimensionRequest, UpdateRemoteTrackPublicationDimensionResponse } from "./track_publication_pb.js"; import type { 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"; import type { DataTrackStreamEvent, DataTrackStreamReadRequest, DataTrackStreamReadResponse, DefineSchemaCallback, DefineSchemaRequest, DefineSchemaResponse, GetSchemaCallback, GetSchemaRequest, GetSchemaResponse, LocalDataTrackIsPublishedRequest, LocalDataTrackIsPublishedResponse, LocalDataTrackTryPushRequest, LocalDataTrackTryPushResponse, LocalDataTrackUnpublishRequest, LocalDataTrackUnpublishResponse, PublishDataTrackCallback, PublishDataTrackRequest, PublishDataTrackResponse, RemoteDataTrackIsPublishedRequest, RemoteDataTrackIsPublishedResponse, RemoteDataTrackSetPipelineOptionsRequest, RemoteDataTrackSetPipelineOptionsResponse, SubscribeDataTrackRequest, SubscribeDataTrackResponse } from "./data_track_pb.js"; -import type { CaptureSourceEvent, NewCaptureSourceCallback, NewCaptureSourceRequest, NewCaptureSourceResponse, StartCaptureRequest, StartCaptureResponse, StopCaptureRequest, StopCaptureResponse } from "./capture_pb.js"; +import type { JoinCaptureCallback, JoinCaptureRequest, JoinCaptureResponse, NewCaptureSourceCallback, NewCaptureSourceRequest, NewCaptureSourceResponse, StartCaptureRequest, StartCaptureResponse, StopCaptureRequest, StopCaptureResponse } from "./capture_pb.js"; /** * @generated from enum livekit.proto.LogLevel @@ -646,6 +646,12 @@ export declare class FfiRequest extends Message { */ value: StopCaptureRequest; case: "stopCapture"; + } | { + /** + * @generated from field: livekit.proto.JoinCaptureRequest join_capture = 92; + */ + value: JoinCaptureRequest; + case: "joinCapture"; } | { case: undefined; value?: undefined }; constructor(data?: PartialMessage); @@ -1242,6 +1248,12 @@ export declare class FfiResponse extends Message { */ value: StopCaptureResponse; case: "stopCapture"; + } | { + /** + * @generated from field: livekit.proto.JoinCaptureResponse join_capture = 92; + */ + value: JoinCaptureResponse; + case: "joinCapture"; } | { case: undefined; value?: undefined }; constructor(data?: PartialMessage); @@ -1560,10 +1572,10 @@ export declare class FfiEvent extends Message { case: "newCaptureSource"; } | { /** - * @generated from field: livekit.proto.CaptureSourceEvent capture_source_event = 48; + * @generated from field: livekit.proto.JoinCaptureCallback join_capture = 49; */ - value: CaptureSourceEvent; - case: "captureSourceEvent"; + value: JoinCaptureCallback; + case: "joinCapture"; } | { case: undefined; value?: undefined }; constructor(data?: PartialMessage); diff --git a/livekit-ffi-node-bindings/proto/ffi_pb.js b/livekit-ffi-node-bindings/proto/ffi_pb.js index 2a50d61cc..13234b355 100644 --- a/livekit-ffi-node-bindings/proto/ffi_pb.js +++ b/livekit-ffi-node-bindings/proto/ffi_pb.js @@ -30,7 +30,7 @@ const { PerformRpcCallback, PerformRpcRequest, PerformRpcResponse, RegisterRpcMe const { EnableRemoteTrackPublicationRequest, EnableRemoteTrackPublicationResponse, SetRemoteTrackPublicationQualityRequest, SetRemoteTrackPublicationQualityResponse, UpdateRemoteTrackPublicationDimensionRequest, UpdateRemoteTrackPublicationDimensionResponse } = require("./track_publication_pb.js"); const { 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 } = require("./data_stream_pb.js"); const { DataTrackStreamEvent, DataTrackStreamReadRequest, DataTrackStreamReadResponse, DefineSchemaCallback, DefineSchemaRequest, DefineSchemaResponse, GetSchemaCallback, GetSchemaRequest, GetSchemaResponse, LocalDataTrackIsPublishedRequest, LocalDataTrackIsPublishedResponse, LocalDataTrackTryPushRequest, LocalDataTrackTryPushResponse, LocalDataTrackUnpublishRequest, LocalDataTrackUnpublishResponse, PublishDataTrackCallback, PublishDataTrackRequest, PublishDataTrackResponse, RemoteDataTrackIsPublishedRequest, RemoteDataTrackIsPublishedResponse, RemoteDataTrackSetPipelineOptionsRequest, RemoteDataTrackSetPipelineOptionsResponse, SubscribeDataTrackRequest, SubscribeDataTrackResponse } = require("./data_track_pb.js"); -const { CaptureSourceEvent, NewCaptureSourceCallback, NewCaptureSourceRequest, NewCaptureSourceResponse, StartCaptureRequest, StartCaptureResponse, StopCaptureRequest, StopCaptureResponse } = require("./capture_pb.js"); +const { JoinCaptureCallback, JoinCaptureRequest, JoinCaptureResponse, NewCaptureSourceCallback, NewCaptureSourceRequest, NewCaptureSourceResponse, StartCaptureRequest, StartCaptureResponse, StopCaptureRequest, StopCaptureResponse } = require("./capture_pb.js"); /** * @generated from enum livekit.proto.LogLevel @@ -145,6 +145,7 @@ const FfiRequest = /*@__PURE__*/ proto2.makeMessageType( { no: 91, name: "new_capture_source", kind: "message", T: NewCaptureSourceRequest, oneof: "message" }, { no: 89, name: "start_capture", kind: "message", T: StartCaptureRequest, oneof: "message" }, { no: 90, name: "stop_capture", kind: "message", T: StopCaptureRequest, oneof: "message" }, + { no: 92, name: "join_capture", kind: "message", T: JoinCaptureRequest, oneof: "message" }, ], ); @@ -245,6 +246,7 @@ const FfiResponse = /*@__PURE__*/ proto2.makeMessageType( { no: 91, name: "new_capture_source", kind: "message", T: NewCaptureSourceResponse, oneof: "message" }, { no: 89, name: "start_capture", kind: "message", T: StartCaptureResponse, oneof: "message" }, { no: 90, name: "stop_capture", kind: "message", T: StopCaptureResponse, oneof: "message" }, + { no: 92, name: "join_capture", kind: "message", T: JoinCaptureResponse, oneof: "message" }, ], ); @@ -304,7 +306,7 @@ const FfiEvent = /*@__PURE__*/ proto2.makeMessageType( { no: 45, name: "define_schema", kind: "message", T: DefineSchemaCallback, oneof: "message" }, { no: 46, name: "get_schema", kind: "message", T: GetSchemaCallback, oneof: "message" }, { no: 47, name: "new_capture_source", kind: "message", T: NewCaptureSourceCallback, oneof: "message" }, - { no: 48, name: "capture_source_event", kind: "message", T: CaptureSourceEvent, oneof: "message" }, + { no: 49, name: "join_capture", kind: "message", T: JoinCaptureCallback, oneof: "message" }, ], );