func (p Packet) P() bool {
	return (p.VPXCC & 0x20) != 0
}
P returns Padding flag value of the packet.
package rtp
import (
	"encoding/binary"
	"errors"
)
const (
	RtpVersion = 2 << 6
	HeaderSize = 12
)
var (
	errInvalidVersion = errors.New("Invalid version of RTP packet")
)
var be = binary.BigEndian
type (
	Packet struct {
		VPXCC byte      
		MPT   byte      
		SN    uint16    
		TS    uint32    
		SSRC  uint32    
		CSRC  []uint32  
		XH    uint16    
		XL    uint16    
		XD    []byte    
		PL    []byte    
	}
)
func Unpack(buf []byte) (*Packet, error) {
	if (buf[0] & 0xC0) != RtpVersion {
		return nil, errInvalidVersion
	}
	packet := &Packet{
		VPXCC: buf[0],
		MPT:   buf[1],
		SN:    be.Uint16(buf[2:]),
		TS:    be.Uint32(buf[4:]),
		SSRC:  be.Uint32(buf[8:]),
	}
	off := HeaderSize
	packet.CSRC = make([]uint32, packet.CC())
	for i := range packet.CSRC {
		packet.CSRC[i] = be.Uint32(buf[off:])
		off += 4
	}
	if packet.X() {
		packet.XH = be.Uint16(buf[off:])
		packet.XL = be.Uint16(buf[off+2:])
		off += 4
		if packet.XL > 0 {
			packet.XD = buf[off : off+int(packet.XL)*4]
			off += int(packet.XL) * 4
		}
	}
	packet.PL = buf[off:]
	return packet, nil
}