sdp

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AACFmtpParam

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

m=audio 49230 RTP/AVP 96 a=rtpmap:96 mpeg4-generic/48000/6 a=fmtp:96 streamtype=5; profile-level-id=16; mode=AAC-hbr; config=11B0; sizeLength=13; indexLength=3;indexDeltaLength=3

func NewAACFmtpParam

func NewAACFmtpParam(opt ...AACFmtpParamOption) *AACFmtpParam

func (*AACFmtpParam) AudioSpecificConfig

func (param *AACFmtpParam) AudioSpecificConfig() []byte

func (*AACFmtpParam) IndexDeltaLength

func (param *AACFmtpParam) IndexDeltaLength() int

func (*AACFmtpParam) IndexLength

func (param *AACFmtpParam) IndexLength() int

func (*AACFmtpParam) Load

func (param *AACFmtpParam) Load(fmtp string)

func (*AACFmtpParam) Save

func (param *AACFmtpParam) Save() string

func (*AACFmtpParam) SizeLength

func (param *AACFmtpParam) SizeLength() int

type AACFmtpParamOption

type AACFmtpParamOption func(extra *AACFmtpParam)

func WithAudioSpecificConfig

func WithAudioSpecificConfig(asc []byte) AACFmtpParamOption

type Connection

type Connection struct {
	Nettype  string
	Addrtype string
	Address  string
}

c=<nettype> <addrtype> <connection-address> c=IN IP4 224.2.36.42/127

func (*Connection) Decode

func (c *Connection) Decode(connectionData string) error

type FmtpCodecParamParser

type FmtpCodecParamParser interface {
	Load(fmtp string)
	Save() string
}

func CreateFmtpParamParser

func CreateFmtpParamParser(name string) FmtpCodecParamParser

type H264ExtraOption

type H264ExtraOption func(param *H264FmtpParam)

func WithH264PPS

func WithH264PPS(pps []byte) H264ExtraOption

func WithH264SPS

func WithH264SPS(sps []byte) H264ExtraOption

func WithPacketizationMode

func WithPacketizationMode(mode int) H264ExtraOption

func WithProfileLevelId

func WithProfileLevelId(profileLevel []byte) H264ExtraOption

type H264FmtpParam

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

func NewH264FmtpParam

func NewH264FmtpParam(opt ...H264ExtraOption) *H264FmtpParam

a=fmtp:98 profile-level-id=42A01E;

packetization-mode=1;
sprop-parameter-sets=<parameter sets data>

func (*H264FmtpParam) GetSpsPps

func (param *H264FmtpParam) GetSpsPps() ([]byte, []byte)

func (*H264FmtpParam) Load

func (param *H264FmtpParam) Load(fmtp string)

func (*H264FmtpParam) Save

func (param *H264FmtpParam) Save() string

type H265FmtpParam

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

func NewH265FmtpParam

func NewH265FmtpParam(opt ...H265FmtpPramOption) *H265FmtpParam

a=fmtp:96 sprop-vps=QAEMAfAIAAAAMAAAMAAAMAAAMAALUCQA==;sprop-sps=QgEBAIAAAAMAAAMAAAMAAAMAAKACgIAtH+W1kkbQzkkktySqSfKSyA==;sprop-pps=RAHBpVgeSA==

func (*H265FmtpParam) GetVpsSpsPps

func (param *H265FmtpParam) GetVpsSpsPps() ([]byte, []byte, []byte)

func (*H265FmtpParam) Load

func (param *H265FmtpParam) Load(fmtp string)

func (*H265FmtpParam) Save

func (param *H265FmtpParam) Save() string

type H265FmtpPramOption

type H265FmtpPramOption func(extra *H265FmtpParam)

func WithH265PPS

func WithH265PPS(pps []byte) H265FmtpPramOption

func WithH265SPS

func WithH265SPS(sps []byte) H265FmtpPramOption

func WithH265VPS

func WithH265VPS(vps []byte) H265FmtpPramOption

type Media

type Media struct {
	MediaType    string
	Ports        []uint16
	Proto        string
	Fmts         []uint8
	PayloadType  int
	EncodeName   string
	ClockRate    int
	ChannelCount int
	ControlUrl   string
	Attrs        map[string]string
}

func (*Media) Encode

func (m *Media) Encode() string

func (*Media) ParseMLine

func (m *Media) ParseMLine(mediaLine string) error

type RtpMap

type RtpMap struct {
	PayloadType int
	EncodeName  string
	ClockRate   int
	EncodParam  string
}

func (*RtpMap) Decode

func (r *RtpMap) Decode(rtpmap string) error

type Sdp

type Sdp struct {
	SessionName    string
	SessionInfo    string
	ControlUrl     string
	ConnectionData Connection
	Attrs          map[string]string
	Medias         []*Media
}

func (*Sdp) Encode

func (sdp *Sdp) Encode() string

func (*Sdp) ParserSdp

func (sdp *Sdp) ParserSdp(sdpContent string) error

Jump to

Keyboard shortcuts

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