sdp

package
v0.24.28 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ARtpMapEncodingNameH265 = "H265"
	ARtpMapEncodingNameH264 = "H264"
	ARtpMapEncodingNameAac  = "MPEG4-GENERIC"
)

Variables

View Source
var ErrSdp = errors.New("lal.sdp: fxxk")

Functions

func ParseAsc added in v0.24.1

func ParseAsc(a *AFmtPBase) ([]byte, error)

func ParseSpsPps added in v0.24.1

func ParseSpsPps(a *AFmtPBase) (sps, pps []byte, err error)

解析AVC/H264的sps,pps 例子见单元测试

func ParseVpsSpsPps added in v0.24.1

func ParseVpsSpsPps(a *AFmtPBase) (vps, sps, pps []byte, err error)

Types

type AControl

type AControl struct {
	Value string
}

func ParseAControl

func ParseAControl(s string) (ret AControl, err error)

type AFmtPBase

type AFmtPBase struct {
	Format     int               // same as PayloadType
	Parameters map[string]string // name -> value
}

func ParseAFmtPBase

func ParseAFmtPBase(s string) (ret AFmtPBase, err error)

例子见单元测试

type ARtpMap added in v0.24.1

type ARtpMap struct {
	PayloadType        int
	EncodingName       string
	ClockRate          int
	EncodingParameters string
}

func ParseARtpMap added in v0.24.1

func ParseARtpMap(s string) (ret ARtpMap, err error)

例子见单元测试

type LogicContext

type LogicContext struct {
	RawSdp []byte

	AudioClockRate int
	VideoClockRate int

	Asc []byte
	Vps []byte
	Sps []byte
	Pps []byte
	// contains filtered or unexported fields
}

func Pack added in v0.24.1

func Pack(vps, sps, pps, asc []byte) (ctx LogicContext, err error)

func ParseSdp2LogicContext added in v0.24.1

func ParseSdp2LogicContext(b []byte) (LogicContext, error)

func (*LogicContext) GetAudioPayloadTypeBase

func (lc *LogicContext) GetAudioPayloadTypeBase() base.AvPacketPt

func (*LogicContext) GetVideoPayloadTypeBase

func (lc *LogicContext) GetVideoPayloadTypeBase() base.AvPacketPt

func (*LogicContext) HasAudioAControl

func (lc *LogicContext) HasAudioAControl() bool

func (*LogicContext) HasVideoAControl

func (lc *LogicContext) HasVideoAControl() bool

func (*LogicContext) IsAudioPayloadTypeOrigin

func (lc *LogicContext) IsAudioPayloadTypeOrigin(t int) bool

func (*LogicContext) IsAudioUnpackable

func (lc *LogicContext) IsAudioUnpackable() bool

func (*LogicContext) IsAudioUri added in v0.24.1

func (lc *LogicContext) IsAudioUri(uri string) bool

func (*LogicContext) IsPayloadTypeOrigin

func (lc *LogicContext) IsPayloadTypeOrigin(t int) bool

func (*LogicContext) IsVideoPayloadTypeOrigin

func (lc *LogicContext) IsVideoPayloadTypeOrigin(t int) bool

func (*LogicContext) IsVideoUnpackable

func (lc *LogicContext) IsVideoUnpackable() bool

func (*LogicContext) IsVideoUri added in v0.24.1

func (lc *LogicContext) IsVideoUri(uri string) bool

func (*LogicContext) MakeAudioSetupUri added in v0.24.1

func (lc *LogicContext) MakeAudioSetupUri(uri string) string

func (*LogicContext) MakeVideoSetupUri added in v0.24.1

func (lc *LogicContext) MakeVideoSetupUri(uri string) string

type M

type M struct {
	Media string
}

func ParseM

func ParseM(s string) (ret M, err error)

type MediaDesc

type MediaDesc struct {
	M         M
	ARtpMap   ARtpMap
	AFmtPBase *AFmtPBase
	AControl  AControl
}

type RawContext

type RawContext struct {
	MediaDescList []MediaDesc
}

func ParseSdp2RawContext added in v0.24.1

func ParseSdp2RawContext(b []byte) (RawContext, error)

例子见单元测试

Jump to

Keyboard shortcuts

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