Skip to content

Commit 788ab46

Browse files
logist322rainliu
authored andcommitted
Add bytes
1 parent bf65b67 commit 788ab46

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

srtp/benches/srtp_bench.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use bytes::Bytes;
1+
use bytes::BytesMut;
22
use criterion::{criterion_group, criterion_main, Criterion};
33
use util::Marshal;
44
use webrtc_srtp::{context::Context, protection_profile::ProtectionProfile};
@@ -11,12 +11,16 @@ fn benchmark_buffer(c: &mut Criterion) {
1111
None,
1212
None,
1313
).unwrap();
14+
let mut pld = BytesMut::new();
15+
for i in 0..1000 {
16+
pld.extend_from_slice(&[i as u8]);
17+
}
1418
let pkt = rtp::packet::Packet {
1519
header: rtp::header::Header {
1620
sequence_number: 322,
1721
..Default::default()
1822
},
19-
payload: Bytes::from_static(&[0x00, 0x01, 0x02, 0x03, 0x04, 0x05]),
23+
payload: pld.into(),
2024
};
2125
let pkt_raw = pkt.marshal().unwrap();
2226

0 commit comments

Comments
 (0)