Skip to content

Commit e60607f

Browse files
Remove unused method determine_payload_type
1 parent c24006b commit e60607f

File tree

1 file changed

+0
-15
lines changed
  • webrtc/src/track/track_remote

1 file changed

+0
-15
lines changed

webrtc/src/track/track_remote/mod.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::api::media_engine::MediaEngine;
22
use crate::error::{Error, Result};
33
use crate::rtp_transceiver::rtp_codec::{RTCRtpCodecParameters, RTCRtpParameters, RTPCodecType};
44
use crate::rtp_transceiver::{PayloadType, SSRC};
5-
use crate::RECEIVE_MTU;
65

76
use crate::rtp_transceiver::rtp_receiver::RTPReceiverInternal;
87

@@ -286,20 +285,6 @@ impl TrackRemote {
286285
Ok((r, attributes))
287286
}
288287

289-
/// determine_payload_type blocks and reads a single packet to determine the PayloadType for this Track
290-
/// this is useful because we can't announce it to the user until we know the payload_type
291-
pub(crate) async fn determine_payload_type(&self) -> Result<()> {
292-
let mut b = vec![0u8; RECEIVE_MTU];
293-
let (n, _) = self.peek(&mut b).await?;
294-
295-
let mut buf = &b[..n];
296-
let r = rtp::packet::Packet::unmarshal(&mut buf)?;
297-
self.payload_type
298-
.store(r.header.payload_type, Ordering::SeqCst);
299-
300-
Ok(())
301-
}
302-
303288
/// peek is like Read, but it doesn't discard the packet read
304289
pub(crate) async fn peek(&self, b: &mut [u8]) -> Result<(usize, Attributes)> {
305290
let (n, a) = self.read(b).await?;

0 commit comments

Comments
 (0)