Documentation
¶
Index ¶
- type AVCCFrame
- type AVFrame
- type AVRing
- type AVTrack
- type AnnexBFrame
- type AudioSlice
- type AudioTrack
- type Base
- type BaseFrame
- type DTSEstimator
- type DataFrame
- type DecoderConfiguration
- type IStream
- type LockFrame
- type LockRing
- type NALUSlice
- type RTPFrame
- type RawSlice
- type RingBuffer
- type TimelineData
- type Track
- type VideoTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVCCFrame ¶
type AVCCFrame []byte // 一帧AVCC格式的数据
func (AVCCFrame) AudioCodecID ¶
func (avcc AVCCFrame) AudioCodecID() codec.AudioCodecID
func (AVCCFrame) IsSequence ¶
func (AVCCFrame) VideoCodecID ¶
func (avcc AVCCFrame) VideoCodecID() codec.VideoCodecID
type AVFrame ¶
type AVFrame[T RawSlice] struct { BaseFrame IFrame bool PTS uint32 DTS uint32 AVCC net.Buffers `json:"-"` // 打包好的AVCC格式 RTP []*RTPFrame `json:"-"` Raw []T `json:"-"` // 裸数据 // contains filtered or unexported fields }
func (*AVFrame[T]) AppendAVCC ¶
type AnnexBFrame ¶
type AnnexBFrame []byte // 一帧AnnexB格式数据
type AudioSlice ¶
type AudioSlice []byte
type AudioTrack ¶
type AudioTrack interface { AVTrack GetDecoderConfiguration() DecoderConfiguration[AudioSlice] CurrentFrame() *AVFrame[AudioSlice] PreFrame() *AVFrame[AudioSlice] WriteSlice(AudioSlice) WriteADTS([]byte) }
type Base ¶ added in v4.1.0
type Base struct { Name string Stream IStream `json:"-"` BPS int FPS int RawPart []int // 裸数据片段用于UI上显示 RawSize int // 裸数据长度 BPSs []TimelineData[int] // 10s码率统计 FPSs []TimelineData[int] // 10s帧率统计 // contains filtered or unexported fields }
Base 基础Track类
func (*Base) ComputeBPS ¶ added in v4.1.0
func (*Base) SnapForJson ¶ added in v4.5.1
func (bt *Base) SnapForJson()
type DTSEstimator ¶
type DTSEstimator struct {
// contains filtered or unexported fields
}
DTSEstimator is a DTS estimator.
func NewDTSEstimator ¶
func NewDTSEstimator() *DTSEstimator
NewDTSEstimator allocates a DTSEstimator.
func (*DTSEstimator) Feed ¶
func (d *DTSEstimator) Feed(pts uint32) uint32
Feed provides PTS to the estimator, and returns the estimated DTS.
type DecoderConfiguration ¶
type DecoderConfiguration[T RawSlice] struct { PayloadType byte AVCC net.Buffers Raw T FLV net.Buffers Seq int //收到第几个序列帧,用于变码率时让订阅者发送序列帧 }
func (annexb AnnexBFrame) ToSlices() (ret []NALUSlice) { for len(annexb) > 0 { before, after, found := bytes.Cut(annexb, codec.NALU_Delimiter1) if !found { return append(ret, NALUSlice{annexb}) } if len(before) > 0 { ret = append(ret, NALUSlice{before}) } annexb = after } return }
func (annexb AnnexBFrame) ToNALUs() (ret [][]NALUSlice) { for len(annexb) > 0 { before, after, found := bytes.Cut(annexb, codec.NALU_Delimiter1) if !found { return append(ret, annexb.ToSlices()) } if len(before) > 0 { ret = append(ret, AnnexBFrame(before).ToSlices()) } annexb = after } return }
type NALUSlice ¶
func (NALUSlice) H264Type ¶
func (nalu NALUSlice) H264Type() (naluType codec.H264NALUType)
func (nalu *H264NALU) Append(slice ...NALUSlice) { *nalu = append(*nalu, slice...) }
func (NALUSlice) H265Type ¶
func (nalu NALUSlice) H265Type() (naluType codec.H265NALUType)
type RTPFrame ¶
func (*RTPFrame) H264Type ¶
func (rtp *RTPFrame) H264Type() (naluType codec.H264NALUType)
func (*RTPFrame) H265Type ¶
func (rtp *RTPFrame) H265Type() (naluType codec.H265NALUType)
type RingBuffer ¶
func (*RingBuffer[T]) Init ¶
func (rb *RingBuffer[T]) Init(n int) *RingBuffer[T]
func (*RingBuffer[T]) MoveNext ¶
func (rb *RingBuffer[T]) MoveNext() *T
type TimelineData ¶ added in v4.5.6
type VideoTrack ¶
Click to show internal directories.
Click to hide internal directories.