Documentation ¶
Index ¶
- func SplitAnnexB[T ~[]byte](frame T, process func(T), delimiter []byte)
- type AVFrame
- type AVTrack
- type AudioTrack
- type DataFrame
- func (df *DataFrame[T]) Discard() int32
- func (df *DataFrame[T]) GetSequence() uint32
- func (df *DataFrame[T]) Init()
- func (df *DataFrame[T]) IsDiscarded() bool
- func (df *DataFrame[T]) IsWriting() bool
- func (df *DataFrame[T]) ReaderCount() int32
- func (df *DataFrame[T]) ReaderEnter() int32
- func (df *DataFrame[T]) ReaderLeave() int32
- func (df *DataFrame[T]) Ready()
- func (df *DataFrame[T]) Reset()
- func (df *DataFrame[T]) SetSequence(sequence uint32)
- func (df *DataFrame[T]) StartWrite() bool
- type IIO
- type IPuber
- type IStream
- type LIRTP
- type ParamaterSets
- type RTPFrame
- type TimelineData
- type Track
- type TrackState
- type VideoTrack
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SplitAnnexB ¶
Types ¶
type AVFrame ¶
type AVFrame struct { DataFrame[any] IFrame bool PTS time.Duration DTS time.Duration Timestamp time.Duration // 绝对时间戳 ADTS util.LIBP `json:"-" yaml:"-"` // ADTS头 AVCC util.BLL `json:"-" yaml:"-"` // 打包好的AVCC格式(MPEG-4格式、Byte-Stream Format) RTP util.List[RTPFrame] `json:"-" yaml:"-"` AUList util.BLLs `json:"-" yaml:"-"` // 裸数据 }
func NewAVFrame ¶
func NewAVFrame() *AVFrame
type AVTrack ¶
type AVTrack interface { Track PreFrame() *AVFrame CurrentFrame() *AVFrame Attach() Detach() WriteAVCC(ts uint32, frame *util.BLL) error //写入AVCC格式的数据 WriteRTP(*LIRTP) WriteRTPPack(*rtp.Packet) WriteSequenceHead(sh []byte) error Flush() SetSpeedLimit(time.Duration) GetRTPFromPool() *LIRTP GetFromPool(util.IBytes) util.LIBP }
type AudioTrack ¶
type DataFrame ¶
type DataFrame[T any] struct { DeltaTime uint32 // 相对上一帧时间戳,毫秒 WriteTime time.Time // 写入时间,可用于比较两个帧的先后 Sequence uint32 // 在一个Track中的序号 BytesIn int // 输入字节数用于计算BPS CanRead bool `json:"-" yaml:"-"` // 是否可读取 Data T `json:"-" yaml:"-"` sync.Cond `json:"-" yaml:"-"` // contains filtered or unexported fields }
func NewDataFrame ¶
func (*DataFrame[T]) GetSequence ¶
func (*DataFrame[T]) IsDiscarded ¶
func (*DataFrame[T]) ReaderCount ¶
func (*DataFrame[T]) ReaderEnter ¶
func (*DataFrame[T]) ReaderLeave ¶
func (*DataFrame[T]) SetSequence ¶
func (*DataFrame[T]) StartWrite ¶
type IPuber ¶
type IPuber interface { IIO GetAudioTrack() AudioTrack GetVideoTrack() VideoTrack GetConfig() *config.Publish Publish(streamPath string, pub IPuber) error }
type ParamaterSets ¶
type ParamaterSets [][]byte
func (ParamaterSets) GetAnnexB ¶
func (v ParamaterSets) GetAnnexB() (r net.Buffers)
func (ParamaterSets) WriteAnnexBTo ¶
func (v ParamaterSets) WriteAnnexBTo(w io.Writer) (n int, err error)
type RTPFrame ¶
func (*RTPFrame) H264Type ¶
func (r *RTPFrame) H264Type() (naluType codec.H264NALUType)
func (*RTPFrame) H265Type ¶
func (r *RTPFrame) H265Type() (naluType codec.H265NALUType)
type TimelineData ¶
type TrackState ¶
type TrackState byte
const ( TrackStateOnline TrackState = iota // 上线 TrackStateOffline // 下线 )
Click to show internal directories.
Click to hide internal directories.