Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 178) sorted by relevance

12345678

/webrtc/webrtc/src/mux/
H A Dmux_func.rs11 Box::new(move |buf: &[u8]| -> bool { in match_range()
12 if buf.is_empty() { in match_range()
15 let b = buf[0]; in match_range()
45 pub(crate) fn is_rtcp(buf: &[u8]) -> bool { in is_rtcp()
47 if buf.len() < 4 { in is_rtcp()
51 let rtcp_packet_type = buf[1]; in is_rtcp()
56 pub fn match_srtp(buf: &[u8]) -> bool { in match_srtp()
57 match_srtp_or_srtcp(buf) && !is_rtcp(buf) in match_srtp()
61 pub fn match_srtcp(buf: &[u8]) -> bool { in match_srtcp()
62 match_srtp_or_srtcp(buf) && is_rtcp(buf) in match_srtcp()
/webrtc/rtcp/src/extended_report/
H A Dvm.rs113 let n = h.marshal_to(buf)?; in marshal_to()
114 buf = &mut buf[n..]; in marshal_to()
116 buf.put_u32(self.ssrc); in marshal_to()
117 buf.put_u8(self.loss_rate); in marshal_to()
127 buf.put_u8(self.rerl); in marshal_to()
128 buf.put_u8(self.gmin); in marshal_to()
129 buf.put_u8(self.rfactor); in marshal_to()
131 buf.put_u8(self.mos_lq); in marshal_to()
132 buf.put_u8(self.mos_cq); in marshal_to()
133 buf.put_u8(self.rx_config); in marshal_to()
[all …]
H A Dssr.rs156 let n = h.marshal_to(buf)?; in marshal_to()
157 buf = &mut buf[n..]; in marshal_to()
159 buf.put_u32(self.ssrc); in marshal_to()
160 buf.put_u16(self.begin_seq); in marshal_to()
161 buf.put_u16(self.end_seq); in marshal_to()
162 buf.put_u32(self.lost_packets); in marshal_to()
163 buf.put_u32(self.dup_packets); in marshal_to()
164 buf.put_u32(self.min_jitter); in marshal_to()
165 buf.put_u32(self.max_jitter); in marshal_to()
166 buf.put_u32(self.mean_jitter); in marshal_to()
[all …]
H A Dprt.rs89 fn marshal_to(&self, mut buf: &mut [u8]) -> Result<usize> { in marshal_to()
90 if buf.remaining_mut() < self.marshal_size() { in marshal_to()
95 let n = h.marshal_to(buf)?; in marshal_to()
96 buf = &mut buf[n..]; in marshal_to()
98 buf.put_u32(self.ssrc); in marshal_to()
99 buf.put_u16(self.begin_seq); in marshal_to()
100 buf.put_u16(self.end_seq); in marshal_to()
102 buf.put_u32(*rt); in marshal_to()
/webrtc/data/src/message/
H A Dmessage_channel_open.rs81 buf.put_u8(byte); in marshal_to()
97 actual: buf.remaining(), in unmarshal()
102 let b0 = buf.get_u8(); in unmarshal()
175 buf = &mut buf[n..]; in marshal_to()
176 buf.put_u16(self.priority); in marshal_to()
195 actual: buf.remaining(), in unmarshal()
201 let priority = buf.get_u16(); in unmarshal()
297 buf.resize(1, 0u8); in test_channel_type_marshal()
302 let bytes = buf.freeze(); in test_channel_type_marshal()
432 buf.resize(11 + 5 + 8, 0u8); in test_channel_open_marshal()
[all …]
H A Dmod.rs35 fn marshal_to(&self, mut buf: &mut [u8]) -> Result<usize, util::Error> { in marshal_to()
37 let n = self.message_type().marshal_to(buf)?; in marshal_to()
38 buf = &mut buf[n..]; in marshal_to()
42 Message::DataChannelOpen(open) => open.marshal_to(buf)?, in marshal_to()
49 fn unmarshal<B>(buf: &mut B) -> Result<Self, util::Error> in unmarshal()
54 if buf.remaining() < MESSAGE_TYPE_LEN { in unmarshal()
57 actual: buf.remaining(), in unmarshal()
62 match MessageType::unmarshal(buf)? { in unmarshal()
65 Ok(Self::DataChannelOpen(DataChannelOpen::unmarshal(buf)?)) in unmarshal()
H A Dmessage_type.rs25 fn marshal_to(&self, mut buf: &mut [u8]) -> Result<usize> { in marshal_to()
31 buf.put_u8(b); in marshal_to()
38 fn unmarshal<B>(buf: &mut B) -> Result<Self> in unmarshal()
43 if buf.remaining() < required_len { in unmarshal()
46 actual: buf.remaining(), in unmarshal()
51 let b = buf.get_u8(); in unmarshal()
114 let mut buf = BytesMut::with_capacity(MESSAGE_TYPE_LEN); in test_message_type_marshal() localVariable
115 buf.resize(MESSAGE_TYPE_LEN, 0u8); in test_message_type_marshal()
117 let n = msg_type.marshal_to(&mut buf)?; in test_message_type_marshal()
118 let bytes = buf.freeze(); in test_message_type_marshal()
/webrtc/turn/src/proto/
H A Dchandata.rs59 let buf = &self.raw; in decode() localVariable
60 if buf.len() < CHANNEL_DATA_HEADER_SIZE { in decode()
63 let num = u16::from_be_bytes([buf[0], buf[1]]); in decode()
69 buf[CHANNEL_DATA_NUMBER_SIZE], in decode()
70 buf[CHANNEL_DATA_NUMBER_SIZE + 1], in decode()
72 if l > buf[CHANNEL_DATA_HEADER_SIZE..].len() { in decode()
94 pub fn is_channel_data(buf: &[u8]) -> bool { in is_channel_data()
95 if buf.len() < CHANNEL_DATA_HEADER_SIZE { in is_channel_data()
100 buf[CHANNEL_DATA_NUMBER_SIZE], in is_channel_data()
101 buf[CHANNEL_DATA_NUMBER_SIZE + 1], in is_channel_data()
[all …]
/webrtc/util/src/conn/
H A Dconn_udp.rs11 async fn recv(&self, buf: &mut [u8]) -> Result<usize> { in recv()
12 Ok(self.recv(buf).await?) in recv()
15 async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)> { in recv_from()
16 Ok(self.recv_from(buf).await?) in recv_from()
19 async fn send(&self, buf: &[u8]) -> Result<usize> { in send()
20 Ok(self.send(buf).await?) in send()
23 async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize> { in send_to()
24 Ok(self.send_to(buf, target).await?) in send_to()
H A Dconn_disconnected_packet.rs31 async fn recv(&self, buf: &mut [u8]) -> Result<usize> { in recv()
32 let (n, addr) = self.pconn.recv_from(buf).await?; in recv()
37 async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)> { in recv_from()
38 self.pconn.recv_from(buf).await in recv_from()
41 async fn send(&self, buf: &[u8]) -> Result<usize> { in send()
43 self.pconn.send_to(buf, addr).await in send()
46 async fn send_to(&self, buf: &[u8], target: SocketAddr) -> Result<usize> { in send_to()
47 self.pconn.send_to(buf, target).await in send_to()
H A Dconn_bridge_test.rs22 let mut buf = vec![0u8; 256]; in test_bridge_normal() localVariable
23 let n = conn1.recv(&mut buf).await?; in test_bridge_normal()
48 let mut buf = vec![0u8; 256]; in test_bridge_drop_1st_packet_from_conn0() localVariable
49 let n = conn1.recv(&mut buf).await?; in test_bridge_drop_1st_packet_from_conn0()
75 let mut buf = vec![0u8; 256]; in test_bridge_drop_2nd_packet_from_conn0() localVariable
76 let n = conn1.recv(&mut buf).await?; in test_bridge_drop_2nd_packet_from_conn0()
102 let mut buf = vec![0u8; 256]; in test_bridge_drop_1st_packet_from_conn1() localVariable
129 let mut buf = vec![0u8; 256]; in test_bridge_drop_2nd_packet_from_conn1() localVariable
156 let mut buf = vec![0u8; 256]; in test_bridge_reorder_packets_from_conn0() localVariable
187 let mut buf = vec![0u8; 256]; in test_bridge_reorder_packets_from_conn1() localVariable
[all …]
/webrtc/util/src/marshal/
H A Dmod.rs12 fn marshal_to(&self, buf: &mut [u8]) -> Result<usize>; in marshal_to()
16 let mut buf = BytesMut::with_capacity(l); in marshal() localVariable
17 buf.resize(l, 0); in marshal()
18 let n = self.marshal_to(&mut buf)?; in marshal()
24 Ok(buf.freeze()) in marshal()
30 fn unmarshal<B>(buf: &mut B) -> Result<Self> in unmarshal()
/webrtc/rtp/src/extension/video_orientation_extension/
H A Dvideo_orientation_extension_test.rs7 let mut buf = &vec![0u8; 0][..]; in test_video_orientation_extension_too_small() localVariable
8 let result = VideoOrientationExtension::unmarshal(&mut buf); in test_video_orientation_extension_too_small()
17 let buf = &mut raw.clone(); in test_video_orientation_extension_back_facing_camera() localVariable
18 let a1 = VideoOrientationExtension::unmarshal(buf)?; in test_video_orientation_extension_back_facing_camera()
37 let buf = &mut raw.clone(); in test_video_orientation_extension_flip_true() localVariable
38 let a1 = VideoOrientationExtension::unmarshal(buf)?; in test_video_orientation_extension_flip_true()
57 let buf = &mut raw.clone(); in test_video_orientation_extension_degree_90() localVariable
58 let a1 = VideoOrientationExtension::unmarshal(buf)?; in test_video_orientation_extension_degree_90()
77 let buf = &mut raw.clone(); in test_video_orientation_extension_degree_180() localVariable
78 let a1 = VideoOrientationExtension::unmarshal(buf)?; in test_video_orientation_extension_degree_180()
[all …]
/webrtc/dtls/src/fragment_buffer/
H A Dmod.rs39 pub fn push(&mut self, mut buf: &[u8]) -> Result<bool> { in push()
41 if current_size + buf.len() >= FRAGMENT_BUFFER_MAX_SIZE { in push()
43 new_size: current_size + buf.len(), in push()
48 let mut reader = Cursor::new(buf); in push()
56 buf = &buf[RECORD_LAYER_HEADER_SIZE..]; in push()
57 while !buf.is_empty() { in push()
58 let mut reader = Cursor::new(buf); in push()
68 if end > buf.len() { in push()
69 end = buf.len(); in push()
73 let data = buf[HANDSHAKE_HEADER_LENGTH..end].to_vec(); in push()
[all …]
/webrtc/rtcp/src/
H A Dreception_report.rs111 if buf.remaining_mut() < self.marshal_size() { in marshal_to()
115 buf.put_u32(self.ssrc); in marshal_to()
117 buf.put_u8(self.fraction_lost); in marshal_to()
124 buf.put_u8(((self.total_lost >> 16) & 0xFF) as u8); in marshal_to()
125 buf.put_u8(((self.total_lost >> 8) & 0xFF) as u8); in marshal_to()
126 buf.put_u8((self.total_lost & 0xFF) as u8); in marshal_to()
128 buf.put_u32(self.last_sequence_number); in marshal_to()
129 buf.put_u32(self.jitter); in marshal_to()
130 buf.put_u32(self.last_sender_report); in marshal_to()
131 buf.put_u32(self.delay); in marshal_to()
[all …]
/webrtc/rtcp/src/source_description/
H A Dmod.rs113 buf.put_u32(self.source); in marshal_to()
116 let n = it.marshal_to(buf)?; in marshal_to()
117 buf = &mut buf[n..]; in marshal_to()
124 put_padding(buf, self.raw_size()); in marshal_to()
216 buf.put_u8(self.sdes_type as u8); in marshal_to()
221 buf.put_u8(self.text.len() as u8); in marshal_to()
222 buf.put(self.text.clone()); in marshal_to()
369 let n = h.marshal_to(buf)?; in marshal_to()
370 buf = &mut buf[n..]; in marshal_to()
373 let n = c.marshal_to(buf)?; in marshal_to()
[all …]
/webrtc/rtcp/src/sender_report/
H A Dmod.rs183 let n = h.marshal_to(buf)?; in marshal_to()
184 buf = &mut buf[n..]; in marshal_to()
186 buf.put_u32(self.ssrc); in marshal_to()
187 buf.put_u64(self.ntp_time); in marshal_to()
188 buf.put_u32(self.rtp_time); in marshal_to()
189 buf.put_u32(self.packet_count); in marshal_to()
190 buf.put_u32(self.octet_count); in marshal_to()
193 let n = report.marshal_to(buf)?; in marshal_to()
194 buf = &mut buf[n..]; in marshal_to()
197 buf.put(self.profile_extensions.clone()); in marshal_to()
[all …]
/webrtc/rtcp/src/transport_feedbacks/transport_layer_cc/
H A Dmod.rs167 buf.put_u16(dst); in marshal_to()
248 buf.put_u16(dst); in marshal_to()
350 buf.put_u8(delta as u8); in marshal_to()
528 let n = h.marshal_to(buf)?; in marshal_to()
529 buf = &mut buf[n..]; in marshal_to()
532 buf.put_u32(self.media_ssrc); in marshal_to()
544 buf = &mut buf[n..]; in marshal_to()
549 buf = &mut buf[n..]; in marshal_to()
595 let mut buf = vec![0u8; 3]; in unmarshal() localVariable
596 buf[0] = raw_packet.get_u8(); in unmarshal()
[all …]
/webrtc/rtp/src/extension/transport_cc_extension/
H A Dtransport_cc_extension_test.rs7 let mut buf = &vec![0u8; 0][..]; in test_transport_cc_extension_too_small() localVariable
8 let result = TransportCcExtension::unmarshal(&mut buf); in test_transport_cc_extension_too_small()
17 let buf = &mut raw.clone(); in test_transport_cc_extension() localVariable
18 let t1 = TransportCcExtension::unmarshal(buf)?; in test_transport_cc_extension()
35 let buf = &mut raw; in test_transport_cc_extension_extra_bytes() localVariable
36 let t1 = TransportCcExtension::unmarshal(buf)?; in test_transport_cc_extension_extra_bytes()
/webrtc/rtp/benches/
H A Dpacket_bench.rs31 let buf = &mut raw.clone(); in benchmark_packet() localVariable
32 let p = Packet::unmarshal(buf).unwrap(); in benchmark_packet()
38 let mut buf = BytesMut::with_capacity(pkt.marshal_size()); in benchmark_packet() localVariable
39 buf.resize(pkt.marshal_size(), 0); in benchmark_packet()
42 let _ = pkt.marshal_to(&mut buf).unwrap(); in benchmark_packet()
54 let buf = &mut raw.clone(); in benchmark_packet() localVariable
55 let _ = Packet::unmarshal(buf).unwrap(); in benchmark_packet()
/webrtc/srtp/src/
H A Dstream.rs51 pub async fn read(&self, buf: &mut [u8]) -> Result<usize> { in read()
52 Ok(self.buffer.read(buf, None).await?) in read()
56 pub async fn read_rtp(&self, buf: &mut [u8]) -> Result<(usize, rtp::header::Header)> { in read_rtp()
61 let n = self.buffer.read(buf, None).await?; in read_rtp()
62 let mut b = &buf[..n]; in read_rtp()
69 pub async fn read_rtcp(&self, buf: &mut [u8]) -> Result<(usize, rtcp::header::Header)> { in read_rtcp()
74 let n = self.buffer.read(buf, None).await?; in read_rtcp()
75 let mut b = &buf[..n]; in read_rtcp()
/webrtc/rtcp/src/payload_feedbacks/receiver_estimated_maximum_bitrate/
H A Dmod.rs124 if buf.remaining_mut() < self.marshal_size() { in marshal_to()
129 let n = h.marshal_to(buf)?; in marshal_to()
130 buf = &mut buf[n..]; in marshal_to()
132 buf.put_u32(self.sender_ssrc); in marshal_to()
133 buf.put_u32(0); // always zero in marshal_to()
135 buf.put_slice(&UNIQUE_IDENTIFIER); in marshal_to()
138 buf.put_u8(self.ssrcs.len() as u8); in marshal_to()
165 buf.put_u8((mantissa >> 8) as u8); in marshal_to()
166 buf.put_u8(mantissa as u8); in marshal_to()
170 buf.put_u32(*ssrc); in marshal_to()
[all …]
/webrtc/rtcp/src/payload_feedbacks/full_intra_request/
H A Dmod.rs91 fn marshal_to(&self, mut buf: &mut [u8]) -> Result<usize> { in marshal_to()
92 if buf.remaining_mut() < self.marshal_size() { in marshal_to()
97 let n = h.marshal_to(buf)?; in marshal_to()
98 buf = &mut buf[n..]; in marshal_to()
100 buf.put_u32(self.sender_ssrc); in marshal_to()
101 buf.put_u32(self.media_ssrc); in marshal_to()
104 buf.put_u32(fir.ssrc); in marshal_to()
105 buf.put_u8(fir.sequence_number); in marshal_to()
106 buf.put_u8(0); in marshal_to()
107 buf.put_u16(0); in marshal_to()
[all …]
/webrtc/sctp/src/param/
H A Dparam_outgoing_reset_request.rs100 fn marshal_to(&self, buf: &mut BytesMut) -> Result<usize> { in marshal_to()
101 self.header().marshal_to(buf)?; in marshal_to()
102 buf.put_u32(self.reconfig_request_sequence_number); in marshal_to()
103 buf.put_u32(self.reconfig_response_sequence_number); in marshal_to()
104 buf.put_u32(self.sender_last_tsn); in marshal_to()
106 buf.put_u16(*sid); in marshal_to()
108 Ok(buf.len()) in marshal_to()
/webrtc/rtcp/src/receiver_report/
H A Dmod.rs99 fn marshal_to(&self, mut buf: &mut [u8]) -> Result<usize> { in marshal_to()
104 if buf.remaining_mut() < self.marshal_size() { in marshal_to()
136 let n = h.marshal_to(buf)?; in marshal_to()
137 buf = &mut buf[n..]; in marshal_to()
139 buf.put_u32(self.ssrc); in marshal_to()
142 let n = report.marshal_to(buf)?; in marshal_to()
143 buf = &mut buf[n..]; in marshal_to()
146 buf.put(self.profile_extensions.clone()); in marshal_to()
149 put_padding(buf, self.raw_size()); in marshal_to()

12345678