Documentation
¶
Index ¶
- type AVCCFrame
- type AVFrame
- type AVRing
- type AVTrack
- type AnnexBFrame
- type AudioSlice
- type AudioTrack
- type BPS
- type BaseFrame
- type DTSEstimator
- type DataFrame
- type DecoderConfiguration
- type IStream
- type LockFrame
- type LockRing
- type MediaFrame
- type NALUSlice
- type RTPFrame
- type RawSlice
- type RingBuffer
- 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 FLV net.Buffers // 打包好的FLV Tag AVCC net.Buffers // 打包好的AVCC格式 RTP []*RTPFrame Raw []T //裸数据 // 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] WriteSlice(AudioSlice) WriteADTS([]byte) }
type BPS ¶
type BPS struct { BPS int // contains filtered or unexported fields }
func (*BPS) ComputeBPS ¶
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 }
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 MediaFrame ¶
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
func (*RingBuffer[T]) PreValue ¶
func (rb *RingBuffer[T]) PreValue() *T
func (RingBuffer[T]) SubRing ¶
func (rb RingBuffer[T]) SubRing(rr *util.Ring[T]) *RingBuffer[T]
type VideoTrack ¶
type VideoTrack interface { AVTrack GetDecoderConfiguration() DecoderConfiguration[NALUSlice] CurrentFrame() *AVFrame[NALUSlice] WriteSlice(NALUSlice) WriteAnnexB(uint32, uint32, AnnexBFrame) }
Click to show internal directories.
Click to hide internal directories.