Rewrite AnnexB/AVCC parsers
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
package mpegts
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/AlexxIT/go2rtc/pkg/core"
|
||||
"github.com/AlexxIT/go2rtc/pkg/h264"
|
||||
"github.com/AlexxIT/go2rtc/pkg/h264/annexb"
|
||||
"github.com/AlexxIT/go2rtc/pkg/h265"
|
||||
"github.com/pion/rtp"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -113,7 +115,7 @@ func (p *PES) GetPacket() (pkt *rtp.Packet) {
|
||||
PayloadType: p.StreamType,
|
||||
Timestamp: ts,
|
||||
},
|
||||
Payload: h264.AnnexB2AVC(payload),
|
||||
Payload: annexb.EncodeToAVCC(payload, false),
|
||||
}
|
||||
|
||||
case StreamTypePCMATapo:
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ func (c *Consumer) AddTrack(media *core.Media, _ *core.Codec, track *core.Receiv
|
||||
if track.Codec.IsRTP() {
|
||||
handler.Handler = h264.RTPDepay(track.Codec, handler.Handler)
|
||||
} else {
|
||||
handler.Handler = h264.RepairAVC(track.Codec, handler.Handler)
|
||||
handler.Handler = h264.RepairAVCC(track.Codec, handler.Handler)
|
||||
}
|
||||
|
||||
case core.CodecAAC:
|
||||
|
||||
Reference in New Issue
Block a user