Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

72 lines
1.1 KiB

package core
import (
"time"
"github.com/pion/rtp"
)
// data is the data unit routed across the server.
type data interface {
getTrackID() int
getRTPPackets() []*rtp.Packet
getNTP() time.Time
}
type dataGeneric struct {
trackID int
rtpPackets []*rtp.Packet
ntp time.Time
}
func (d *dataGeneric) getTrackID() int {
return d.trackID
}
func (d *dataGeneric) getRTPPackets() []*rtp.Packet {
return d.rtpPackets
}
func (d *dataGeneric) getNTP() time.Time {
return d.ntp
}
type dataH264 struct {
trackID int
rtpPackets []*rtp.Packet
ntp time.Time
pts time.Duration
nalus [][]byte
}
func (d *dataH264) getTrackID() int {
return d.trackID
}
func (d *dataH264) getRTPPackets() []*rtp.Packet {
return d.rtpPackets
}
func (d *dataH264) getNTP() time.Time {
return d.ntp
}
type dataMPEG4Audio struct {
trackID int
rtpPackets []*rtp.Packet
ntp time.Time
pts time.Duration
aus [][]byte
}
func (d *dataMPEG4Audio) getTrackID() int {
return d.trackID
}
func (d *dataMPEG4Audio) getRTPPackets() []*rtp.Packet {
return d.rtpPackets
}
func (d *dataMPEG4Audio) getNTP() time.Time {
return d.ntp
}