add packet PT type h264 support

This commit is contained in:
wangbaoqiang
2021-02-24 09:40:37 +08:00
parent 04cae8469e
commit b7ec44211a
2 changed files with 12 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
*.exe
.vscode
.idea
+9
View File
@@ -16,6 +16,11 @@ const (
RTP_TYPE_VIDEOCONTROL
)
const (
RTP_PT_PS = 96
RTP_PT_H264 = 98
)
type RTPPack struct {
Type RTPType
rtp.Packet
@@ -49,6 +54,10 @@ func (rtp *RTP_PS) PushPS(ps []byte) {
if err := rtp.Unmarshal(ps); err != nil {
Println(err)
}
if rtp.Packet.PayloadType == RTP_PT_H264 {
rtp.WriteNALU(rtp.Timestamp, rtp.Payload)
return
}
if len(rtp.Payload) >= 4 && util.BigEndian.Uint32(rtp.Payload) == StartCodePS {
if rtp.psPacket != nil {
if err := rtp.parser.Read(rtp.psPacket); err == nil {