@@ -4,7 +4,9 @@ use crate::data_channel::{DataChannel, DataChannelEvent, DataChannelImpl};
44use crate :: ice_gatherer:: RTCIceGatherOptions ;
55use crate :: ice_gatherer:: RTCIceGatherer ;
66use crate :: media_stream:: { TrackLocal , TrackRemote } ;
7- use crate :: peer_connection_driver:: PeerConnectionDriver ;
7+ use crate :: peer_connection_driver:: {
8+ DATA_CHANNEL_EVENT_CHANNEL_CAPACITY , MSG_CHANNEL_CAPACITY , PeerConnectionDriver ,
9+ } ;
810use crate :: rtp_transceiver:: { RtpReceiver , RtpSender , RtpTransceiver } ;
911use crate :: runtime:: { JoinHandle , Runtime , default_runtime} ;
1012use crate :: runtime:: { Mutex , Sender , channel} ;
@@ -97,12 +99,6 @@ pub trait PeerConnectionEventHandler: Send + Sync + 'static {
9799/// Unified inner message type for the peer connection driver
98100#[ derive( Debug ) ]
99101pub ( crate ) enum MessageInner {
100- // Outgoing RTP packet from local track
101- //SenderRtp(RTCRtpSenderId, rtc::rtp::Packet),
102- // Outgoing RTCP packets from sender
103- //SenderRtcp(RTCRtpSenderId, Vec<Box<dyn rtc::rtcp::Packet>>),
104- // Outgoing RTCP packets from receiver
105- //ReceiverRtcp(RTCRtpReceiverId, Vec<Box<dyn rtc::rtcp::Packet>>),
106102 WriteNotify ,
107103 IceGathering ,
108104 Close ,
@@ -371,7 +367,7 @@ where
371367 }
372368 }
373369
374- let ( msg_tx, msg_rx) = channel ( ) ;
370+ let ( msg_tx, msg_rx) = channel ( MSG_CHANNEL_CAPACITY ) ;
375371 let peer_connection = Self {
376372 inner : Arc :: new ( PeerConnectionRef {
377373 core : Mutex :: new ( core) ,
@@ -550,7 +546,7 @@ where
550546 rtc_dc. id ( )
551547 } ;
552548
553- let ( evt_tx, evt_rx) = channel ( ) ;
549+ let ( evt_tx, evt_rx) = channel ( DATA_CHANNEL_EVENT_CHANNEL_CAPACITY ) ;
554550 {
555551 let mut data_channels = self . inner . data_channels . lock ( ) . await ;
556552 data_channels. insert ( channel_id, evt_tx) ;
0 commit comments