Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions examples/local_video/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def _open_camera(args: argparse.Namespace) -> tuple[cv2.VideoCapture, int, int]:
return capture, width, height


def _packet_trailer_features(args: argparse.Namespace) -> list[int]:
def _frame_metadata_features(args: argparse.Namespace) -> list[int]:
features = []
if args.attach_timestamp:
features.append(rtc.PacketTrailerFeature.PTF_USER_TIMESTAMP)
features.append(rtc.FrameMetadataFeature.FMF_USER_TIMESTAMP)
if args.attach_frame_id:
features.append(rtc.PacketTrailerFeature.PTF_FRAME_ID)
features.append(rtc.FrameMetadataFeature.FMF_FRAME_ID)
return features


Expand Down Expand Up @@ -224,13 +224,13 @@ async def run(args: argparse.Namespace, stop_event: asyncio.Event) -> None:
max_framerate=args.fps,
max_bitrate=3_000_000,
),
packet_trailer_features=_packet_trailer_features(args),
frame_metadata_features=_frame_metadata_features(args),
)
publication = await room.local_participant.publish_track(track, options)
logging.info(
"published camera track %s with packet trailer features %s",
"published camera track %s with frame metadata features %s",
publication.sid,
list(publication.packet_trailer_features),
list(publication.frame_metadata_features),
)

await _capture_loop(args, capture, source, width, height, stop_event)
Expand Down
6 changes: 3 additions & 3 deletions examples/local_video/subscriber.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def _feature_names(features: list[int]) -> str:
names = []
for feature in features:
try:
names.append(rtc.PacketTrailerFeature.Name(feature))
names.append(rtc.FrameMetadataFeature.Name(feature))
except ValueError:
names.append(str(feature))
return ", ".join(names) or "none"
Expand Down Expand Up @@ -309,10 +309,10 @@ def on_track_unpublished(
active_publication_sid = subscribed.publication.sid
active_track_gone = asyncio.Event()
logging.info(
"subscribed to %s from %s with packet trailer features: %s",
"subscribed to %s from %s with frame metadata features: %s",
subscribed.publication.sid,
subscribed.participant.identity,
_feature_names(list(subscribed.publication.packet_trailer_features)),
_feature_names(list(subscribed.publication.frame_metadata_features)),
)

video_stream = rtc.VideoStream.from_track(
Expand Down
4 changes: 2 additions & 2 deletions livekit-rtc/livekit/rtc/__init__.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 livekit-protocol package still uses old PacketTrailerFeature names

The livekit-protocol package (livekit-protocol/livekit/protocol/models.py, models.pyi, rtc.pyi) still defines and references PacketTrailerFeature, PTF_USER_TIMESTAMP, PTF_FRAME_ID, and packet_trailer_features. This is a separate package from livekit-rtc and appears to represent the server-side protocol definitions. If these two packages are used together in applications, the naming inconsistency could be confusing. This may just mean the protocol package hasn't been updated yet and will follow in a separate PR.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
VideoEncoding,
)
from ._proto.track_pb2 import (
PacketTrailerFeature,
FrameMetadataFeature,
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
StreamState,
TrackKind,
TrackSource,
Expand Down Expand Up @@ -148,7 +148,7 @@
"StreamState",
"TrackKind",
"TrackSource",
"PacketTrailerFeature",
"FrameMetadataFeature",
"ParticipantTrackPermission",
"VideoBufferType",
"VideoRotation",
Expand Down
28 changes: 14 additions & 14 deletions livekit-rtc/livekit/rtc/_proto/room_pb2.py

Large diffs are not rendered by default.

18 changes: 14 additions & 4 deletions livekit-rtc/livekit/rtc/_proto/room_pb2.pyi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions livekit-rtc/livekit/rtc/_proto/track_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading