Skip to content

Commit 4f8e73e

Browse files
chenghao-mouclaude
andcommitted
bump FFI to v0.12.67
Bumps the rust-sdks submodule from livekit-ffi v0.12.65 to v0.12.67. Upstream renamed "Packet Trailer" to "Frame Metadata" (livekit/rust-sdks#1179), so update the hand-written wrapper, exports, examples, and tests to the new names: - PacketTrailerFeature -> FrameMetadataFeature - PTF_USER_TIMESTAMP/PTF_FRAME_ID -> FMF_USER_TIMESTAMP/FMF_FRAME_ID - packet_trailer_features -> frame_metadata_features The generated _proto stubs are regenerated by CI on the PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6893e13 commit 4f8e73e

7 files changed

Lines changed: 49 additions & 49 deletions

File tree

examples/local_video/publisher.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ def _open_camera(args: argparse.Namespace) -> tuple[cv2.VideoCapture, int, int]:
108108
return capture, width, height
109109

110110

111-
def _packet_trailer_features(args: argparse.Namespace) -> list[int]:
111+
def _frame_metadata_features(args: argparse.Namespace) -> list[int]:
112112
features = []
113113
if args.attach_timestamp:
114-
features.append(rtc.PacketTrailerFeature.PTF_USER_TIMESTAMP)
114+
features.append(rtc.FrameMetadataFeature.FMF_USER_TIMESTAMP)
115115
if args.attach_frame_id:
116-
features.append(rtc.PacketTrailerFeature.PTF_FRAME_ID)
116+
features.append(rtc.FrameMetadataFeature.FMF_FRAME_ID)
117117
return features
118118

119119

@@ -224,13 +224,13 @@ async def run(args: argparse.Namespace, stop_event: asyncio.Event) -> None:
224224
max_framerate=args.fps,
225225
max_bitrate=3_000_000,
226226
),
227-
packet_trailer_features=_packet_trailer_features(args),
227+
frame_metadata_features=_frame_metadata_features(args),
228228
)
229229
publication = await room.local_participant.publish_track(track, options)
230230
logging.info(
231-
"published camera track %s with packet trailer features %s",
231+
"published camera track %s with frame metadata features %s",
232232
publication.sid,
233-
list(publication.packet_trailer_features),
233+
list(publication.frame_metadata_features),
234234
)
235235

236236
await _capture_loop(args, capture, source, width, height, stop_event)

examples/local_video/subscriber.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _feature_names(features: list[int]) -> str:
176176
names = []
177177
for feature in features:
178178
try:
179-
names.append(rtc.PacketTrailerFeature.Name(feature))
179+
names.append(rtc.FrameMetadataFeature.Name(feature))
180180
except ValueError:
181181
names.append(str(feature))
182182
return ", ".join(names) or "none"
@@ -309,10 +309,10 @@ def on_track_unpublished(
309309
active_publication_sid = subscribed.publication.sid
310310
active_track_gone = asyncio.Event()
311311
logging.info(
312-
"subscribed to %s from %s with packet trailer features: %s",
312+
"subscribed to %s from %s with frame metadata features: %s",
313313
subscribed.publication.sid,
314314
subscribed.participant.identity,
315-
_feature_names(list(subscribed.publication.packet_trailer_features)),
315+
_feature_names(list(subscribed.publication.frame_metadata_features)),
316316
)
317317

318318
video_stream = rtc.VideoStream.from_track(

livekit-rtc/livekit/rtc/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
VideoEncoding,
3838
)
3939
from ._proto.track_pb2 import (
40-
PacketTrailerFeature,
40+
FrameMetadataFeature,
4141
StreamState,
4242
TrackKind,
4343
TrackSource,
@@ -148,7 +148,7 @@
148148
"StreamState",
149149
"TrackKind",
150150
"TrackSource",
151-
"PacketTrailerFeature",
151+
"FrameMetadataFeature",
152152
"ParticipantTrackPermission",
153153
"VideoBufferType",
154154
"VideoRotation",

livekit-rtc/livekit/rtc/track_publication.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ def audio_features(self) -> List[proto_track.AudioTrackFeature.ValueType]:
8080
return list(self._info.audio_features)
8181

8282
@property
83-
def packet_trailer_features(self) -> List[proto_track.PacketTrailerFeature.ValueType]:
84-
return list(self._info.packet_trailer_features)
83+
def frame_metadata_features(self) -> List[proto_track.FrameMetadataFeature.ValueType]:
84+
return list(self._info.frame_metadata_features)
8585

8686

8787
class LocalTrackPublication(TrackPublication):

livekit-rtc/rust-sdks

Submodule rust-sdks updated 54 files

tests/rtc/test_e2e.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ def on_track_subscribed(
144144

145145
@pytest.mark.asyncio
146146
@skip_if_no_credentials() # type: ignore[untyped-decorator]
147-
async def test_video_packet_trailer_metadata() -> None:
148-
"""Test that packet trailer metadata can be sent and received on video frames."""
149-
room_name = unique_room_name("test-video-packet-trailer")
147+
async def test_video_frame_metadata() -> None:
148+
"""Test that frame metadata can be sent and received on video frames."""
149+
room_name = unique_room_name("test-video-frame-metadata")
150150
url = os.getenv("LIVEKIT_URL")
151151
assert url is not None
152152

@@ -184,21 +184,21 @@ def on_track_subscribed(
184184
frame_width, frame_height = 320, 240
185185
source = rtc.VideoSource(frame_width, frame_height)
186186
track = rtc.LocalVideoTrack.create_video_track("metadata-video", source)
187-
packet_trailer_features = [
188-
rtc.PacketTrailerFeature.PTF_USER_TIMESTAMP,
189-
rtc.PacketTrailerFeature.PTF_FRAME_ID,
187+
frame_metadata_features = [
188+
rtc.FrameMetadataFeature.FMF_USER_TIMESTAMP,
189+
rtc.FrameMetadataFeature.FMF_FRAME_ID,
190190
]
191191
options = rtc.TrackPublishOptions(
192192
source=rtc.TrackSource.SOURCE_CAMERA,
193-
packet_trailer_features=packet_trailer_features,
193+
frame_metadata_features=frame_metadata_features,
194194
)
195195
publication = await publisher_room.local_participant.publish_track(track, options)
196196

197-
assert publication.packet_trailer_features == packet_trailer_features
197+
assert publication.frame_metadata_features == frame_metadata_features
198198
await asyncio.wait_for(track_subscribed_event.wait(), timeout=5.0)
199199
assert subscribed_track is not None
200200
assert subscribed_publication is not None
201-
assert subscribed_publication.packet_trailer_features == packet_trailer_features
201+
assert subscribed_publication.frame_metadata_features == frame_metadata_features
202202

203203
video_stream = rtc.VideoStream.from_track(track=subscribed_track, capacity=1)
204204
frame = rtc.VideoFrame(
@@ -255,15 +255,15 @@ def on_reconnected() -> None:
255255

256256
source = rtc.VideoSource(2, 2)
257257
track = rtc.LocalVideoTrack.create_video_track("republish-video", source)
258-
packet_trailer_features = [
259-
rtc.PacketTrailerFeature.PTF_USER_TIMESTAMP,
260-
rtc.PacketTrailerFeature.PTF_FRAME_ID,
258+
frame_metadata_features = [
259+
rtc.FrameMetadataFeature.FMF_USER_TIMESTAMP,
260+
rtc.FrameMetadataFeature.FMF_FRAME_ID,
261261
]
262262
publication = await room.local_participant.publish_track(
263263
track,
264264
rtc.TrackPublishOptions(
265265
source=rtc.TrackSource.SOURCE_CAMERA,
266-
packet_trailer_features=packet_trailer_features,
266+
frame_metadata_features=frame_metadata_features,
267267
),
268268
)
269269
previous_sid = publication.sid
@@ -282,7 +282,7 @@ def on_reconnected() -> None:
282282

283283
assert publication.sid != previous_sid
284284
assert previous_sid not in room.local_participant.track_publications
285-
assert publication.packet_trailer_features == packet_trailer_features
285+
assert publication.frame_metadata_features == frame_metadata_features
286286

287287
finally:
288288
if source is not None:
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
def _publication_info(
2323
sid: str,
2424
*,
25-
packet_trailer_features: list[proto_track.PacketTrailerFeature.ValueType] | None = None,
25+
frame_metadata_features: list[proto_track.FrameMetadataFeature.ValueType] | None = None,
2626
) -> proto_track.TrackPublicationInfo:
2727
return proto_track.TrackPublicationInfo(
2828
sid=sid,
@@ -36,45 +36,45 @@ def _publication_info(
3636
muted=False,
3737
remote=False,
3838
encryption_type=proto_e2ee.NONE,
39-
packet_trailer_features=packet_trailer_features or [],
39+
frame_metadata_features=frame_metadata_features or [],
4040
)
4141

4242

4343
def _owned_publication(
4444
sid: str,
4545
*,
46-
packet_trailer_features: list[proto_track.PacketTrailerFeature.ValueType] | None = None,
46+
frame_metadata_features: list[proto_track.FrameMetadataFeature.ValueType] | None = None,
4747
) -> proto_track.OwnedTrackPublication:
4848
return proto_track.OwnedTrackPublication(
4949
handle=proto_handle.FfiOwnedHandle(id=0),
50-
info=_publication_info(sid, packet_trailer_features=packet_trailer_features),
50+
info=_publication_info(sid, frame_metadata_features=frame_metadata_features),
5151
)
5252

5353

54-
def test_packet_trailer_symbols_are_exported() -> None:
54+
def test_frame_metadata_symbols_are_exported() -> None:
5555
metadata = rtc.FrameMetadata(user_timestamp=123, frame_id=7)
5656

57-
assert rtc.PacketTrailerFeature.PTF_USER_TIMESTAMP == proto_track.PTF_USER_TIMESTAMP
58-
assert rtc.PacketTrailerFeature.PTF_FRAME_ID == proto_track.PTF_FRAME_ID
57+
assert rtc.FrameMetadataFeature.FMF_USER_TIMESTAMP == proto_track.FMF_USER_TIMESTAMP
58+
assert rtc.FrameMetadataFeature.FMF_FRAME_ID == proto_track.FMF_FRAME_ID
5959
assert metadata.HasField("user_timestamp")
6060
assert metadata.HasField("frame_id")
6161

6262

6363
@pytest.mark.asyncio
64-
async def test_track_publication_exposes_packet_trailer_features() -> None:
64+
async def test_track_publication_exposes_frame_metadata_features() -> None:
6565
publication = rtc.LocalTrackPublication(
6666
_owned_publication(
6767
"TR_OLD",
68-
packet_trailer_features=[
69-
proto_track.PTF_USER_TIMESTAMP,
70-
proto_track.PTF_FRAME_ID,
68+
frame_metadata_features=[
69+
proto_track.FMF_USER_TIMESTAMP,
70+
proto_track.FMF_FRAME_ID,
7171
],
7272
)
7373
)
7474

75-
assert publication.packet_trailer_features == [
76-
proto_track.PTF_USER_TIMESTAMP,
77-
proto_track.PTF_FRAME_ID,
75+
assert publication.frame_metadata_features == [
76+
proto_track.FMF_USER_TIMESTAMP,
77+
proto_track.FMF_FRAME_ID,
7878
]
7979

8080

@@ -140,7 +140,7 @@ async def test_local_track_republished_updates_existing_publication() -> None:
140140
publication = rtc.LocalTrackPublication(
141141
_owned_publication(
142142
"TR_OLD",
143-
packet_trailer_features=[proto_track.PTF_USER_TIMESTAMP],
143+
frame_metadata_features=[proto_track.FMF_USER_TIMESTAMP],
144144
)
145145
)
146146
# Build a real Track via __new__ (bypassing FFI) so the republish handler's
@@ -161,9 +161,9 @@ async def test_local_track_republished_updates_existing_publication() -> None:
161161
previous_sid="TR_OLD",
162162
info=_publication_info(
163163
"TR_NEW",
164-
packet_trailer_features=[
165-
proto_track.PTF_USER_TIMESTAMP,
166-
proto_track.PTF_FRAME_ID,
164+
frame_metadata_features=[
165+
proto_track.FMF_USER_TIMESTAMP,
166+
proto_track.FMF_FRAME_ID,
167167
],
168168
),
169169
),
@@ -173,7 +173,7 @@ async def test_local_track_republished_updates_existing_publication() -> None:
173173
assert "TR_OLD" not in local_participant.track_publications
174174
assert local_participant.track_publications["TR_NEW"] is publication
175175
assert publication.sid == "TR_NEW"
176-
assert publication.packet_trailer_features == [
177-
proto_track.PTF_USER_TIMESTAMP,
178-
proto_track.PTF_FRAME_ID,
176+
assert publication.frame_metadata_features == [
177+
proto_track.FMF_USER_TIMESTAMP,
178+
proto_track.FMF_FRAME_ID,
179179
]

0 commit comments

Comments
 (0)