@@ -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} ;
3232use 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
5353fn 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 {
355355mod 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) ;
0 commit comments