fix register.
This commit is contained in:
parent
fd43f84bd0
commit
ccbfe93765
@ -55,7 +55,7 @@ type RTPCodec struct {
|
|||||||
Capability webrtc.RTPCodecCapability
|
Capability webrtc.RTPCodecCapability
|
||||||
}
|
}
|
||||||
|
|
||||||
func (codec *RTPCodec) Register(engine *webrtc.MediaEngine) error {
|
func (codec RTPCodec) Register(engine *webrtc.MediaEngine) error {
|
||||||
return engine.RegisterCodec(webrtc.RTPCodecParameters{
|
return engine.RegisterCodec(webrtc.RTPCodecParameters{
|
||||||
RTPCodecCapability: codec.Capability,
|
RTPCodecCapability: codec.Capability,
|
||||||
PayloadType: codec.PayloadType,
|
PayloadType: codec.PayloadType,
|
||||||
|
@ -157,18 +157,8 @@ func (manager *WebRTCManager) initAPI() error {
|
|||||||
|
|
||||||
// Create MediaEngine with selected codecs
|
// Create MediaEngine with selected codecs
|
||||||
engine := webrtc.MediaEngine{}
|
engine := webrtc.MediaEngine{}
|
||||||
|
manager.capture.Audio().Codec().Register(&engine)
|
||||||
audioCodec := manager.capture.Audio().Codec()
|
manager.capture.Video().Codec().Register(&engine)
|
||||||
_ = engine.RegisterCodec(webrtc.RTPCodecParameters{
|
|
||||||
RTPCodecCapability: audioCodec.Capability,
|
|
||||||
PayloadType: audioCodec.PayloadType,
|
|
||||||
}, audioCodec.Type)
|
|
||||||
|
|
||||||
videoCodec := manager.capture.Video().Codec()
|
|
||||||
_ = engine.RegisterCodec(webrtc.RTPCodecParameters{
|
|
||||||
RTPCodecCapability: videoCodec.Capability,
|
|
||||||
PayloadType: videoCodec.PayloadType,
|
|
||||||
}, videoCodec.Type)
|
|
||||||
|
|
||||||
// Register Interceptors
|
// Register Interceptors
|
||||||
i := &interceptor.Registry{}
|
i := &interceptor.Registry{}
|
||||||
|
Reference in New Issue
Block a user