File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ impl ParticipantCore {
171171 pkt. raw_header . marker ,
172172 pkt. raw_header . ext_vals ,
173173 true ,
174- pkt. payload ,
174+ pkt. payload . to_vec ( ) ,
175175 ) {
176176 tracing:: warn!( %mid, ssrc = %pkt. raw_header. ssrc, "Dropping RTP for invalid rtp header: {err:?}" ) ;
177177 }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ pub mod switcher;
44pub mod sync;
55pub mod timeline;
66
7+ use bytes:: Bytes ;
78use str0m:: media:: { Frequency , MediaTime } ;
89use str0m:: rtp:: rtcp:: SenderInfo ;
910use str0m:: rtp:: { RtpHeader , SeqNo } ;
@@ -37,7 +38,7 @@ pub struct RtpPacket {
3738 pub playout_time : Instant ,
3839 pub is_keyframe_start : bool ,
3940 pub last_sender_info : Option < SenderInfo > ,
40- pub payload : Vec < u8 > ,
41+ pub payload : Bytes ,
4142}
4243
4344impl Default for RtpPacket {
@@ -57,7 +58,7 @@ impl Default for RtpPacket {
5758 playout_time : Instant :: now ( ) ,
5859 is_keyframe_start : false ,
5960 last_sender_info : None ,
60- payload : vec ! [ 0u8 ; 1200 ] , // 1.2KB payload for test realism
61+ payload : Bytes :: from_static ( & [ 0u8 ; 1200 ] ) , // 1.2KB payload for test realism
6162 }
6263 }
6364}
@@ -79,7 +80,7 @@ impl RtpPacket {
7980 playout_time : rtp. timestamp . into ( ) ,
8081 is_keyframe_start,
8182 last_sender_info : None ,
82- payload : rtp. payload ,
83+ payload : Bytes :: from ( rtp. payload ) ,
8384 }
8485 }
8586
You can’t perform that action at this time.
0 commit comments