mirror of
https://github.com/pion/webrtc.git
synced 2025-10-05 15:16:52 +08:00
Disable MediaEngine Copy by Default
If an API is shared between PeerConnections they would use the same MediaEngine. A MediaEngine contains negotiated PayloadTypes so if the PeerConnections were answering you would end up in invalid states. Add DisableMediaEngineCopy to SettingEngine in case user needs old behavior. Resolves #1662
This commit is contained in:
@@ -59,6 +59,7 @@ type SettingEngine struct {
|
||||
LoggerFactory logging.LoggerFactory
|
||||
iceTCPMux ice.TCPMux
|
||||
iceProxyDialer proxy.Dialer
|
||||
disableMediaEngineCopy bool
|
||||
}
|
||||
|
||||
// DetachDataChannels enables detaching data channels. When enabled
|
||||
@@ -255,3 +256,10 @@ func (e *SettingEngine) SetICETCPMux(tcpMux ice.TCPMux) {
|
||||
func (e *SettingEngine) SetICEProxyDialer(d proxy.Dialer) {
|
||||
e.iceProxyDialer = d
|
||||
}
|
||||
|
||||
// DisableMediaEngineCopy stops the MediaEngine from being copied. This allows a user to modify
|
||||
// the MediaEngine after the PeerConnection has been constructed. This is useful if you wish to
|
||||
// modify codecs after signaling. Make sure not to share MediaEngines between PeerConnections.
|
||||
func (e *SettingEngine) DisableMediaEngineCopy(isDisabled bool) {
|
||||
e.disableMediaEngineCopy = isDisabled
|
||||
}
|
||||
|
Reference in New Issue
Block a user