Skip to content

user_timestamp FFI#980

Merged
chenosaurus merged 1 commit intodc/feature/user_timestampfrom
sderosa/feature/user_timestamp_ffi
Mar 31, 2026
Merged

user_timestamp FFI#980
chenosaurus merged 1 commit intodc/feature/user_timestampfrom
sderosa/feature/user_timestamp_ffi

Conversation

@stephen-derosa
Copy link
Copy Markdown

Expose user_timestamp for video frames to the FFI

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes per-frame packet-trailer metadata (notably user_timestamp_us, plus frame_id) through the FFI layer so downstream clients can both attach metadata when capturing frames and receive it on decoded frames.

Changes:

  • Add FrameMetadata to the FFI video frame protocol and thread it through CaptureVideoFrameRequest and VideoFrameReceived.
  • Convert metadata between LiveKit FrameMetadata and FFI proto::FrameMetadata in FfiVideoSource and FfiVideoStream, with unit tests.
  • Add packet_trailer_features to TrackPublishOptions to enable packet trailer metadata emission, with Rust conversion + tests and updated Node bindings.

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
livekit-ffi/src/server/video_stream.rs Maps VideoFrame.frame_metadata into proto::VideoFrameReceived.metadata and adds unit tests for conversion.
livekit-ffi/src/server/video_source.rs Maps CaptureVideoFrameRequest.metadata into VideoFrame.frame_metadata (dropping empty metadata) and adds unit tests.
livekit-ffi/src/conversion/room.rs Converts TrackPublishOptions.packet_trailer_features into LiveKit PacketTrailerFeatures and adds unit tests.
livekit-ffi/protocol/video_frame.proto Introduces FrameMetadata message and adds optional metadata fields to capture and receive messages.
livekit-ffi/protocol/room.proto Adds packet_trailer_features to TrackPublishOptions.
livekit-ffi-node-bindings/proto/video_frame_pb.js Regenerates Node JS bindings to include FrameMetadata and the new optional metadata fields.
livekit-ffi-node-bindings/proto/video_frame_pb.d.ts Regenerates Node TS declarations for FrameMetadata and the new optional metadata fields.
livekit-ffi-node-bindings/proto/room_pb.js Regenerates Node JS bindings to include packet_trailer_features on TrackPublishOptions.
livekit-ffi-node-bindings/proto/room_pb.d.ts Regenerates Node TS declarations for packet_trailer_features on TrackPublishOptions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenosaurus chenosaurus merged commit 5a15baa into dc/feature/user_timestamp Mar 31, 2026
5 checks passed
@chenosaurus chenosaurus deleted the sderosa/feature/user_timestamp_ffi branch March 31, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants