mirror of
https://github.com/Monibuca/plugin-rtp.git
synced 2026-04-23 00:27:04 +08:00
add packet PT type h264 support
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
*.exe
|
||||||
|
.vscode
|
||||||
|
.idea
|
||||||
@@ -16,6 +16,11 @@ const (
|
|||||||
RTP_TYPE_VIDEOCONTROL
|
RTP_TYPE_VIDEOCONTROL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
RTP_PT_PS = 96
|
||||||
|
RTP_PT_H264 = 98
|
||||||
|
)
|
||||||
|
|
||||||
type RTPPack struct {
|
type RTPPack struct {
|
||||||
Type RTPType
|
Type RTPType
|
||||||
rtp.Packet
|
rtp.Packet
|
||||||
@@ -49,6 +54,10 @@ func (rtp *RTP_PS) PushPS(ps []byte) {
|
|||||||
if err := rtp.Unmarshal(ps); err != nil {
|
if err := rtp.Unmarshal(ps); err != nil {
|
||||||
Println(err)
|
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 len(rtp.Payload) >= 4 && util.BigEndian.Uint32(rtp.Payload) == StartCodePS {
|
||||||
if rtp.psPacket != nil {
|
if rtp.psPacket != nil {
|
||||||
if err := rtp.parser.Read(rtp.psPacket); err == nil {
|
if err := rtp.parser.Read(rtp.psPacket); err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user