rtp

package
v0.0.0-...-873f54d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2016 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RTCP_SR   = 200
	RTCP_RR   = 201
	RTCP_SDES = 202
	RTCP_BYE  = 203
	RTCP_APP  = 204
)

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(addr string, port int)

Types

type Payload

type Payload []byte

type RtcpHeader

type RtcpHeader struct {
	V      byte   //2bit,版本号,0x2
	P      byte   //1bit,填充标志,值为0
	RC     byte   //接收报告计数,5bit
	PT     byte   //包类型,8bit
	Length uint32 //包长度
}

type RtcpRRPacket

type RtcpRRPacket struct {
}

type RtcpSRPacket

type RtcpSRPacket struct {
}

type RtpHeader

type RtpHeader struct {
	V         byte   //2bit,版本号,0x2
	P         byte   //1bit,填充标志,值为0
	X         byte   //1bit,扩充标识,值为0
	CC        byte   //4bit,CSRC计数,值为0
	M         byte   //1bit,标识位
	PT        byte   //载荷类型 7bit
	Seq       uint16 //序列号
	Timestamp uint32 //时间戳
	SSRC      uint32 //同步源标识符

}

func NewRtpHeader

func NewRtpHeader(ssrc uint32, seq uint16, pt byte, timestamp uint32) *RtpHeader

func (*RtpHeader) Encode

func (h *RtpHeader) Encode() []byte

type RtpPacket

type RtpPacket struct {
	Header        RtpHeader
	PayloadType   byte
	PayloadLength uint32
	Packet        Payload
	PacketLength  uint32
}

func PacketAVC

func PacketAVC(h264 Payload, timestamp uint32) *RtpPacket

func (*RtpPacket) Fragment

func (rtp *RtpPacket) Fragment() ([]Payload, error)

type RtpSession

type RtpSession struct {
	// contains filtered or unexported fields
}

func NewRtpSession

func NewRtpSession(conn *net.UDPConn) *RtpSession

func (*RtpSession) Send

func (s *RtpSession) Send(packet *RtpPacket) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL