mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-06 09:06:52 +08:00
41 lines
751 B
Go
41 lines
751 B
Go
package common
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/pion/rtp"
|
|
)
|
|
|
|
type Track interface {
|
|
GetName() string
|
|
LastWriteTime() time.Time
|
|
}
|
|
|
|
type AVTrack interface {
|
|
Track
|
|
Attach()
|
|
Detach()
|
|
WriteAVCC(ts uint32, frame AVCCFrame) //写入AVCC格式的数据
|
|
WriteRTP([]byte)
|
|
WriteRTPPack(*rtp.Packet)
|
|
Flush()
|
|
}
|
|
type VideoTrack interface {
|
|
AVTrack
|
|
GetDecoderConfiguration() DecoderConfiguration[NALUSlice]
|
|
CurrentFrame() *AVFrame[NALUSlice]
|
|
PreFrame() *AVFrame[NALUSlice]
|
|
WriteSlice(NALUSlice)
|
|
WriteAnnexB(uint32, uint32, AnnexBFrame)
|
|
}
|
|
|
|
type AudioTrack interface {
|
|
AVTrack
|
|
GetDecoderConfiguration() DecoderConfiguration[AudioSlice]
|
|
CurrentFrame() *AVFrame[AudioSlice]
|
|
PreFrame() *AVFrame[AudioSlice]
|
|
WriteSlice(AudioSlice)
|
|
WriteADTS([]byte)
|
|
}
|
|
|