Skip to content

Commit e63fb1e

Browse files
committed
rename all Packet Trailer to Frame Metadata
1 parent 99daa41 commit e63fb1e

16 files changed

Lines changed: 83 additions & 83 deletions

File tree

examples/local_video/src/publisher.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use anyhow::Result;
22
use clap::{Parser, ValueEnum};
33
use livekit::e2ee::{key_provider::*, E2eeOptions, EncryptionType};
44
use livekit::options::{
5-
self, video as video_presets, PacketTrailerFeatures, TrackPublishOptions, VideoCodec,
5+
self, video as video_presets, FrameMetadataFeatures, TrackPublishOptions, VideoCodec,
66
VideoEncoderBackend, VideoEncoding, VideoPreset,
77
};
88
use livekit::prelude::*;
@@ -1178,16 +1178,16 @@ async fn run(args: Args, ctrl_c_received: Arc<AtomicBool>) -> Result<()> {
11781178
);
11791179
}
11801180

1181-
let mut packet_trailer_features = PacketTrailerFeatures::default();
1182-
packet_trailer_features.user_timestamp = args.attach_timestamp;
1183-
packet_trailer_features.frame_id = args.attach_frame_id;
1181+
let mut frame_metadata_features = FrameMetadataFeatures::default();
1182+
frame_metadata_features.user_timestamp = args.attach_timestamp;
1183+
frame_metadata_features.frame_id = args.attach_frame_id;
11841184

11851185
let publish_opts = |codec: VideoCodec| TrackPublishOptions {
11861186
source: TrackSource::Camera,
11871187
simulcast: args.simulcast,
11881188
video_codec: codec,
11891189
video_encoder: requested_encoder,
1190-
packet_trailer_features,
1190+
frame_metadata_features,
11911191
video_encoding: Some(main_encoding.clone()),
11921192
simulcast_layers: args.simulcast.then(|| simulcast_presets.clone()),
11931193
..Default::default()

examples/local_video/src/subscriber.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,15 +881,15 @@ async fn handle_track_subscribed(
881881
}
882882

883883
info!(
884-
"Subscribed to video track: {} (sid {}) from {} - codec: {}, simulcast: {}, dimension: {}x{}, packet_trailer_features: {:?}",
884+
"Subscribed to video track: {} (sid {}) from {} - codec: {}, simulcast: {}, dimension: {}x{}, frame_metadata_features: {:?}",
885885
publication.name(),
886886
publication.sid(),
887887
participant.identity(),
888888
codec,
889889
publication.simulcasted(),
890890
publication.dimension().0,
891891
publication.dimension().1,
892-
publication.packet_trailer_features(),
892+
publication.frame_metadata_features(),
893893
);
894894

895895
{

livekit-ffi-node-bindings/proto/room_pb.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
2121
import { Message, proto2 } from "@bufbuild/protobuf";
2222
import type { DisconnectReason, OwnedParticipant, ParticipantInfo, ParticipantPermission } from "./participant_pb.js";
23-
import type { OwnedTrack, OwnedTrackPublication, PacketTrailerFeature, TrackPublicationInfo, TrackSource } from "./track_pb.js";
23+
import type { FrameMetadataFeature, OwnedTrack, OwnedTrackPublication, TrackPublicationInfo, TrackSource } from "./track_pb.js";
2424
import type { RtcStats } from "./stats_pb.js";
2525
import type { VideoCodec } from "./video_frame_pb.js";
2626
import type { E2eeOptions, EncryptionState } from "./e2ee_pb.js";
@@ -1844,9 +1844,9 @@ export declare class TrackPublishOptions extends Message<TrackPublishOptions> {
18441844
preconnectBuffer?: boolean;
18451845

18461846
/**
1847-
* @generated from field: repeated livekit.proto.PacketTrailerFeature packet_trailer_features = 10;
1847+
* @generated from field: repeated livekit.proto.FrameMetadataFeature frame_metadata_features = 10;
18481848
*/
1849-
packetTrailerFeatures: PacketTrailerFeature[];
1849+
frameMetadataFeatures: FrameMetadataFeature[];
18501850

18511851
/**
18521852
* RTP scalability mode (e.g. "L3T3_KEY"). When set, a single RTP

livekit-ffi-node-bindings/proto/room_pb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
2222

2323
const { proto2 } = require("@bufbuild/protobuf");
2424
const { DisconnectReason, OwnedParticipant, ParticipantInfo, ParticipantPermission } = require("./participant_pb.js");
25-
const { OwnedTrack, OwnedTrackPublication, PacketTrailerFeature, TrackPublicationInfo, TrackSource } = require("./track_pb.js");
25+
const { FrameMetadataFeature, OwnedTrack, OwnedTrackPublication, TrackPublicationInfo, TrackSource } = require("./track_pb.js");
2626
const { RtcStats } = require("./stats_pb.js");
2727
const { VideoCodec } = require("./video_frame_pb.js");
2828
const { E2eeOptions, EncryptionState } = require("./e2ee_pb.js");
@@ -729,7 +729,7 @@ const TrackPublishOptions = /*@__PURE__*/ proto2.makeMessageType(
729729
{ no: 7, name: "source", kind: "enum", T: proto2.getEnumType(TrackSource), opt: true },
730730
{ no: 8, name: "stream", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
731731
{ no: 9, name: "preconnect_buffer", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
732-
{ no: 10, name: "packet_trailer_features", kind: "enum", T: proto2.getEnumType(PacketTrailerFeature), repeated: true },
732+
{ no: 10, name: "frame_metadata_features", kind: "enum", T: proto2.getEnumType(FrameMetadataFeature), repeated: true },
733733
{ no: 11, name: "scalability_mode", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
734734
{ no: 12, name: "video_encoder", kind: "enum", T: proto2.getEnumType(VideoEncoderBackend), opt: true },
735735
],

livekit-ffi-node-bindings/proto/track_pb.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,18 @@ export declare enum AudioTrackFeature {
136136
}
137137

138138
/**
139-
* @generated from enum livekit.proto.PacketTrailerFeature
139+
* @generated from enum livekit.proto.FrameMetadataFeature
140140
*/
141-
export declare enum PacketTrailerFeature {
141+
export declare enum FrameMetadataFeature {
142142
/**
143-
* @generated from enum value: PTF_USER_TIMESTAMP = 0;
143+
* @generated from enum value: FMF_USER_TIMESTAMP = 0;
144144
*/
145-
PTF_USER_TIMESTAMP = 0,
145+
FMF_USER_TIMESTAMP = 0,
146146

147147
/**
148-
* @generated from enum value: PTF_FRAME_ID = 1;
148+
* @generated from enum value: FMF_FRAME_ID = 1;
149149
*/
150-
PTF_FRAME_ID = 1,
150+
FMF_FRAME_ID = 1,
151151
}
152152

153153
/**
@@ -431,9 +431,9 @@ export declare class TrackPublicationInfo extends Message<TrackPublicationInfo>
431431
audioFeatures: AudioTrackFeature[];
432432

433433
/**
434-
* @generated from field: repeated livekit.proto.PacketTrailerFeature packet_trailer_features = 13;
434+
* @generated from field: repeated livekit.proto.FrameMetadataFeature frame_metadata_features = 13;
435435
*/
436-
packetTrailerFeatures: PacketTrailerFeature[];
436+
frameMetadataFeatures: FrameMetadataFeature[];
437437

438438
constructor(data?: PartialMessage<TrackPublicationInfo>);
439439

livekit-ffi-node-bindings/proto/track_pb.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ const AudioTrackFeature = /*@__PURE__*/ proto2.makeEnum(
8080
);
8181

8282
/**
83-
* @generated from enum livekit.proto.PacketTrailerFeature
83+
* @generated from enum livekit.proto.FrameMetadataFeature
8484
*/
85-
const PacketTrailerFeature = /*@__PURE__*/ proto2.makeEnum(
86-
"livekit.proto.PacketTrailerFeature",
85+
const FrameMetadataFeature = /*@__PURE__*/ proto2.makeEnum(
86+
"livekit.proto.FrameMetadataFeature",
8787
[
88-
{no: 0, name: "PTF_USER_TIMESTAMP"},
89-
{no: 1, name: "PTF_FRAME_ID"},
88+
{no: 0, name: "FMF_USER_TIMESTAMP"},
89+
{no: 1, name: "FMF_FRAME_ID"},
9090
],
9191
);
9292

@@ -195,7 +195,7 @@ const TrackPublicationInfo = /*@__PURE__*/ proto2.makeMessageType(
195195
{ no: 10, name: "remote", kind: "scalar", T: 8 /* ScalarType.BOOL */, req: true },
196196
{ no: 11, name: "encryption_type", kind: "enum", T: proto2.getEnumType(EncryptionType), req: true },
197197
{ no: 12, name: "audio_features", kind: "enum", T: proto2.getEnumType(AudioTrackFeature), repeated: true },
198-
{ no: 13, name: "packet_trailer_features", kind: "enum", T: proto2.getEnumType(PacketTrailerFeature), repeated: true },
198+
{ no: 13, name: "frame_metadata_features", kind: "enum", T: proto2.getEnumType(FrameMetadataFeature), repeated: true },
199199
],
200200
);
201201

@@ -319,7 +319,7 @@ exports.TrackKind = TrackKind;
319319
exports.TrackSource = TrackSource;
320320
exports.StreamState = StreamState;
321321
exports.AudioTrackFeature = AudioTrackFeature;
322-
exports.PacketTrailerFeature = PacketTrailerFeature;
322+
exports.FrameMetadataFeature = FrameMetadataFeature;
323323
exports.CreateVideoTrackRequest = CreateVideoTrackRequest;
324324
exports.CreateVideoTrackResponse = CreateVideoTrackResponse;
325325
exports.CreateAudioTrackRequest = CreateAudioTrackRequest;

livekit-ffi/protocol/room.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ message TrackPublishOptions {
312312
optional TrackSource source = 7;
313313
optional string stream = 8;
314314
optional bool preconnect_buffer = 9;
315-
repeated PacketTrailerFeature packet_trailer_features = 10;
315+
repeated FrameMetadataFeature frame_metadata_features = 10;
316316
// RTP scalability mode (e.g. "L3T3_KEY"). When set, a single RTP
317317
// encoding is produced with this mode, enabling true SVC for codecs
318318
// that support it (VP9, AV1). Has no effect for VP8/H264.

livekit-ffi/protocol/track.proto

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ message TrackPublicationInfo {
9191
required bool remote = 10;
9292
required EncryptionType encryption_type = 11;
9393
repeated AudioTrackFeature audio_features = 12;
94-
repeated PacketTrailerFeature packet_trailer_features = 13;
94+
repeated FrameMetadataFeature frame_metadata_features = 13;
9595
}
9696

9797
message OwnedTrackPublication {
@@ -161,7 +161,7 @@ enum AudioTrackFeature {
161161
TF_PRECONNECT_BUFFER = 6; // client will buffer audio once available and send it to the server via bytes stream once connected
162162
}
163163

164-
enum PacketTrailerFeature {
165-
PTF_USER_TIMESTAMP = 0;
166-
PTF_FRAME_ID = 1;
164+
enum FrameMetadataFeature {
165+
FMF_USER_TIMESTAMP = 0;
166+
FMF_FRAME_ID = 1;
167167
}

livekit-ffi/src/conversion/room.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use livekit::{
1919
E2eeOptions, EncryptionType,
2020
},
2121
options::{
22-
AudioEncoding, PacketTrailerFeatures, TrackPublishOptions, VideoEncoderBackend,
22+
AudioEncoding, FrameMetadataFeatures, TrackPublishOptions, VideoEncoderBackend,
2323
VideoEncoding,
2424
},
2525
prelude::*,
@@ -31,23 +31,23 @@ use livekit::{
3131
};
3232
use std::time::Duration;
3333

34-
fn packet_trailer_features_from_proto(features: Vec<i32>) -> PacketTrailerFeatures {
35-
let mut packet_trailer_features = PacketTrailerFeatures::default();
34+
fn frame_metadata_features_from_proto(features: Vec<i32>) -> FrameMetadataFeatures {
35+
let mut frame_metadata_features = FrameMetadataFeatures::default();
3636

3737
for feature in
38-
features.into_iter().filter_map(|value| proto::PacketTrailerFeature::try_from(value).ok())
38+
features.into_iter().filter_map(|value| proto::FrameMetadataFeature::try_from(value).ok())
3939
{
4040
match feature {
41-
proto::PacketTrailerFeature::PtfUserTimestamp => {
42-
packet_trailer_features.user_timestamp = true;
41+
proto::FrameMetadataFeature::FmfUserTimestamp => {
42+
frame_metadata_features.user_timestamp = true;
4343
}
44-
proto::PacketTrailerFeature::PtfFrameId => {
45-
packet_trailer_features.frame_id = true;
44+
proto::FrameMetadataFeature::FmfFrameId => {
45+
frame_metadata_features.frame_id = true;
4646
}
4747
}
4848
}
4949

50-
packet_trailer_features
50+
frame_metadata_features
5151
}
5252

5353
fn video_encoder_from_proto(backend: Option<i32>) -> Option<VideoEncoderBackend> {
@@ -329,8 +329,8 @@ impl From<proto::TrackPublishOptions> for TrackPublishOptions {
329329
preconnect_buffer: opts
330330
.preconnect_buffer
331331
.unwrap_or(default_publish_options.preconnect_buffer),
332-
packet_trailer_features: packet_trailer_features_from_proto(
333-
opts.packet_trailer_features,
332+
frame_metadata_features: frame_metadata_features_from_proto(
333+
opts.frame_metadata_features,
334334
),
335335
video_encoder: video_encoder_from_proto(opts.video_encoder)
336336
.unwrap_or(default_publish_options.video_encoder),
@@ -355,22 +355,22 @@ impl From<proto::AudioEncoding> for AudioEncoding {
355355
mod tests {
356356
use livekit::options::{TrackPublishOptions, VideoEncoderBackend};
357357

358-
use super::{packet_trailer_features_from_proto, video_encoder_from_proto};
358+
use super::{frame_metadata_features_from_proto, video_encoder_from_proto};
359359
use crate::proto;
360360

361361
#[test]
362-
fn packet_trailer_features_default_to_empty() {
363-
let features = packet_trailer_features_from_proto(Vec::new());
362+
fn frame_metadata_features_default_to_empty() {
363+
let features = frame_metadata_features_from_proto(Vec::new());
364364

365365
assert!(!features.user_timestamp);
366366
assert!(!features.frame_id);
367367
}
368368

369369
#[test]
370-
fn packet_trailer_features_enable_known_flags() {
371-
let features = packet_trailer_features_from_proto(vec![
372-
proto::PacketTrailerFeature::PtfUserTimestamp.into(),
373-
proto::PacketTrailerFeature::PtfFrameId.into(),
370+
fn frame_metadata_features_enable_known_flags() {
371+
let features = frame_metadata_features_from_proto(vec![
372+
proto::FrameMetadataFeature::FmfUserTimestamp.into(),
373+
proto::FrameMetadataFeature::FmfFrameId.into(),
374374
]);
375375

376376
assert!(features.user_timestamp);

livekit-ffi/src/conversion/track.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ impl From<&FfiPublication> for proto::TrackPublicationInfo {
3939
.into_iter()
4040
.map(|i| proto::AudioTrackFeature::from(i).into())
4141
.collect(),
42-
packet_trailer_features: publication
43-
.packet_trailer_features()
42+
frame_metadata_features: publication
43+
.frame_metadata_features()
4444
.into_iter()
45-
.map(|i| proto::PacketTrailerFeature::from(i).into())
45+
.map(|i| proto::FrameMetadataFeature::from(i).into())
4646
.collect(),
4747
}
4848
}
@@ -164,14 +164,14 @@ impl From<AudioTrackFeature> for proto::AudioTrackFeature {
164164
}
165165
}
166166

167-
impl From<livekit_protocol::PacketTrailerFeature> for proto::PacketTrailerFeature {
167+
impl From<livekit_protocol::PacketTrailerFeature> for proto::FrameMetadataFeature {
168168
fn from(value: livekit_protocol::PacketTrailerFeature) -> Self {
169169
match value {
170170
livekit_protocol::PacketTrailerFeature::PtfUserTimestamp => {
171-
proto::PacketTrailerFeature::PtfUserTimestamp
171+
proto::FrameMetadataFeature::FmfUserTimestamp
172172
}
173173
livekit_protocol::PacketTrailerFeature::PtfFrameId => {
174-
proto::PacketTrailerFeature::PtfFrameId
174+
proto::FrameMetadataFeature::FmfFrameId
175175
}
176176
}
177177
}

0 commit comments

Comments
 (0)