Unify codec params type/func naming

This commit is contained in:
Atsushi Watanabe
2020-03-22 17:09:38 +09:00
parent 7bb7c9e927
commit 73cee07d71
4 changed files with 19 additions and 19 deletions

View File

@@ -9,8 +9,8 @@ import (
"github.com/pion/webrtc/v2"
)
// ParamVP8 stores VP8 encoding parameters.
type ParamVP8 struct {
// ParamsVP8 stores VP8 encoding parameters.
type ParamsVP8 struct {
codec.BaseParams
Sequence SequenceParamVP8
RateControlMode RateControlMode
@@ -24,9 +24,9 @@ type SequenceParamVP8 struct {
ClampQindexLow uint
}
// NewVP8Param returns default parameters of VP8 codec.
func NewVP8Param() (ParamVP8, error) {
return ParamVP8{
// NewVP8Params returns default parameters of VP8 codec.
func NewVP8Params() (ParamsVP8, error) {
return ParamsVP8{
BaseParams: codec.BaseParams{
BitRate: 320000,
KeyFrameInterval: 30,
@@ -47,17 +47,17 @@ func NewVP8Param() (ParamVP8, error) {
}
// Name represents the codec name
func (p *ParamVP8) Name() string {
func (p *ParamsVP8) Name() string {
return webrtc.VP8
}
// BuildVideoEncoder builds VP8 encoder with given params
func (p *ParamVP8) BuildVideoEncoder(r video.Reader, property prop.Media) (io.ReadCloser, error) {
func (p *ParamsVP8) BuildVideoEncoder(r video.Reader, property prop.Media) (io.ReadCloser, error) {
return newVP8Encoder(r, property, *p)
}
// ParamVP9 represents VAEncSequenceParameterBufferVP9 and other parameter buffers.
type ParamVP9 struct {
// ParamsVP9 represents VAEncSequenceParameterBufferVP9 and other parameter buffers.
type ParamsVP9 struct {
codec.BaseParams
RateControlMode RateControlMode
RateControl RateControlParam
@@ -97,9 +97,9 @@ const (
RateControlAVBR RateControlMode = 0x00000800
)
// NewVP9Param returns default parameters of VP9 codec.
func NewVP9Param() (ParamVP9, error) {
return ParamVP9{
// NewVP9Params returns default parameters of VP9 codec.
func NewVP9Params() (ParamsVP9, error) {
return ParamsVP9{
BaseParams: codec.BaseParams{
BitRate: 320000,
KeyFrameInterval: 30,
@@ -116,11 +116,11 @@ func NewVP9Param() (ParamVP9, error) {
}
// Name represents the codec name
func (p *ParamVP9) Name() string {
func (p *ParamsVP9) Name() string {
return webrtc.VP9
}
// BuildVideoEncoder builds VP9 encoder with given params
func (p *ParamVP9) BuildVideoEncoder(r video.Reader, property prop.Media) (io.ReadCloser, error) {
func (p *ParamsVP9) BuildVideoEncoder(r video.Reader, property prop.Media) (io.ReadCloser, error) {
return newVP9Encoder(r, property, *p)
}