Replace Name with RTPCodec in codec builder

Allowing users to implement RTPCodec will give users freedom to have
a custom encoder with custom RTP payload.
This commit is contained in:
Lukas Herman
2020-10-06 22:26:35 -07:00
parent c9779e7f73
commit abdd96e6b2
8 changed files with 53 additions and 61 deletions

View File

@@ -43,9 +43,9 @@ func NewVP8Params() (ParamsVP8, error) {
}, nil
}
// Name represents the codec name
func (p *ParamsVP8) Name() codec.Name {
return codec.NameVP8
// RTPCodec represents the codec metadata
func (p *ParamsVP8) RTPCodec() *codec.RTPCodec {
return codec.NewRTPVP8Codec(90000)
}
// BuildVideoEncoder builds VP8 encoder with given params
@@ -112,9 +112,9 @@ func NewVP9Params() (ParamsVP9, error) {
}, nil
}
// Name represents the codec name
func (p *ParamsVP9) Name() codec.Name {
return codec.NameVP9
// RTPCodec represents the codec metadata
func (p *ParamsVP9) RTPCodec() *codec.RTPCodec {
return codec.NewRTPVP9Codec(90000)
}
// BuildVideoEncoder builds VP9 encoder with given params