mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-05 16:46:58 +08:00
fix: rtp relay
This commit is contained in:
@@ -121,7 +121,7 @@ type TrackPlayer struct {
|
|||||||
type Subscriber struct {
|
type Subscriber struct {
|
||||||
IO
|
IO
|
||||||
Config *config.Subscribe
|
Config *config.Subscribe
|
||||||
readers []*track.AVRingReader
|
readers []*track.AVRingReader
|
||||||
TrackPlayer `json:"-" yaml:"-"`
|
TrackPlayer `json:"-" yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ func (s *Subscriber) PlayBlock(subType byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendAudioFrame = func(frame *AVFrame) {
|
sendAudioFrame = func(frame *AVFrame) {
|
||||||
// fmt.Println("a", frame.Sequence, frame.AbsTime, s.AudioReader.AbsTime)
|
// fmt.Println("a", frame.Sequence, frame.Timestamp, s.AudioReader.AbsTime)
|
||||||
delta := uint32(s.AudioReader.SkipTs / time.Millisecond * time.Duration(s.AudioReader.Track.SampleRate) / 1000)
|
delta := uint32(s.AudioReader.SkipTs / time.Millisecond * time.Duration(s.AudioReader.Track.SampleRate) / 1000)
|
||||||
frame.RTP.Range(func(ap RTPFrame) bool {
|
frame.RTP.Range(func(ap RTPFrame) bool {
|
||||||
audioSeq++
|
audioSeq++
|
||||||
|
@@ -60,6 +60,7 @@ func (g711 *G711) WriteAVCC(ts uint32, frame *util.BLL) error {
|
|||||||
|
|
||||||
func (g711 *G711) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
|
func (g711 *G711) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
|
||||||
frame := &rtpItem.Value
|
frame := &rtpItem.Value
|
||||||
|
g711.Value.RTP.Push(rtpItem)
|
||||||
if g711.SampleRate != 90000 {
|
if g711.SampleRate != 90000 {
|
||||||
g711.generateTimestamp(uint32(uint64(frame.Timestamp) * 90000 / uint64(g711.SampleRate)))
|
g711.generateTimestamp(uint32(uint64(frame.Timestamp) * 90000 / uint64(g711.SampleRate)))
|
||||||
}
|
}
|
||||||
|
@@ -139,6 +139,7 @@ func (vt *H265) WriteAVCC(ts uint32, frame *util.BLL) (err error) {
|
|||||||
func (vt *H265) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
|
func (vt *H265) WriteRTPFrame(rtpItem *util.ListItem[RTPFrame]) {
|
||||||
frame := &rtpItem.Value
|
frame := &rtpItem.Value
|
||||||
rv := vt.Value
|
rv := vt.Value
|
||||||
|
rv.RTP.Push(rtpItem)
|
||||||
// TODO: DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
|
// TODO: DONL may need to be parsed if `sprop-max-don-diff` is greater than 0 on the RTP stream.
|
||||||
var usingDonlField bool
|
var usingDonlField bool
|
||||||
var buffer = util.Buffer(frame.Payload)
|
var buffer = util.Buffer(frame.Payload)
|
||||||
|
Reference in New Issue
Block a user