bitrate

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2020 License: MIT Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitrate

type Bitrate interface {
	// @param nowUnixMSec: 变参,可选择从外部传入当前 unix 时间戳,单位毫秒
	Add(bytes int, nowUnixMSec ...int64)

	Rate(nowUnixMSec ...int64) float32
}

func New added in v0.7.0

func New(modOptions ...ModOption) Bitrate

type ModOption

type ModOption func(option *Option)

type Option

type Option struct {
	WindowMS int
	Unit     Unit
}

TODO chef: 考虑支持配置是否在内部使用锁

type Unit added in v0.7.0

type Unit uint8
const (
	UnitBitPerSec Unit = iota + 1
	UnitBytePerSec
	UnitKBitPerSec
	UnitKBytePerSec
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL