Skip to content

Commit

Permalink
fix register.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed Sep 17, 2022
1 parent fd43f84 commit ccbfe93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion server/internal/types/codec/codecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type RTPCodec struct {
Capability webrtc.RTPCodecCapability
}

func (codec *RTPCodec) Register(engine *webrtc.MediaEngine) error {
func (codec RTPCodec) Register(engine *webrtc.MediaEngine) error {
return engine.RegisterCodec(webrtc.RTPCodecParameters{
RTPCodecCapability: codec.Capability,
PayloadType: codec.PayloadType,
Expand Down
14 changes: 2 additions & 12 deletions server/internal/webrtc/webrtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,8 @@ func (manager *WebRTCManager) initAPI() error {

// Create MediaEngine with selected codecs
engine := webrtc.MediaEngine{}

audioCodec := manager.capture.Audio().Codec()
_ = 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)
manager.capture.Audio().Codec().Register(&engine)
manager.capture.Video().Codec().Register(&engine)

// Register Interceptors
i := &interceptor.Registry{}
Expand Down

0 comments on commit ccbfe93

Please sign in to comment.