Skip to content

Commit

Permalink
Fix H265 support from OpenIPC project
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Dec 15, 2023
1 parent d3bc18c commit 7036d19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/h265/rtp.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ func RTPDepay(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc {
case 1: // end
buf = append(buf, data[3:]...)
binary.BigEndian.PutUint32(buf[nuStart:], uint32(len(buf)-nuStart-4))
case 3: // wrong RFC 7798 realisation from OpenIPC project
// A non-fragmented NAL unit MUST NOT be transmitted in one FU; i.e.,
// the Start bit and End bit must not both be set to 1 in the same FU
// header.
nuType = data[2] & 0x3F
buf = binary.BigEndian.AppendUint32(buf, uint32(len(data))-1) // NAL unit size
buf = append(buf, (data[0]&0x81)|(nuType<<1), data[1])
buf = append(buf, data[3:]...)
}
} else {
nuStart = len(buf)
Expand Down

0 comments on commit 7036d19

Please sign in to comment.