headers

package
v4.16.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package headers contains various RTSP headers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthAlgorithm

type AuthAlgorithm int

AuthAlgorithm is a digest algorithm.

const (
	AuthAlgorithmMD5 AuthAlgorithm = iota
	AuthAlgorithmSHA256
)

digest algorithms.

type AuthMethod

type AuthMethod int

AuthMethod is an authentication method.

const (
	AuthMethodBasic AuthMethod = iota
	AuthMethodDigest
)

authentication methods.

type Authenticate

type Authenticate struct {
	// authentication method
	Method AuthMethod

	// realm
	Realm string

	// nonce
	Nonce string

	// opaque
	Opaque *string

	// stale
	Stale *string

	// algorithm
	Algorithm *AuthAlgorithm
}

Authenticate is a WWW-Authenticate header.

func (Authenticate) Marshal

func (h Authenticate) Marshal() base.HeaderValue

Marshal encodes a WWW-Authenticate header.

func (*Authenticate) Unmarshal

func (h *Authenticate) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a WWW-Authenticate header.

type Authorization

type Authorization struct {
	// authentication method
	Method AuthMethod

	// username
	Username string

	// user
	//
	// Deprecated: replaced by Username.
	BasicUser string

	// password
	BasicPass string

	// realm
	Realm string

	// nonce
	Nonce string

	// URI
	URI string

	// response
	Response string

	// opaque
	Opaque *string

	// algorithm
	Algorithm *AuthAlgorithm
}

Authorization is an Authorization header.

func (Authorization) Marshal

func (h Authorization) Marshal() base.HeaderValue

Marshal encodes an Authorization header.

func (*Authorization) Unmarshal

func (h *Authorization) Unmarshal(v base.HeaderValue) error

Unmarshal decodes an Authorization header.

type KeyMgmt

type KeyMgmt struct {
	URL          string
	MikeyMessage *mikey.Message
}

KeyMgmt is a KeyMgmt header.

func (KeyMgmt) Marshal

func (h KeyMgmt) Marshal() (base.HeaderValue, error)

Marshal encodes a KeyMgmt header.

func (*KeyMgmt) Unmarshal

func (h *KeyMgmt) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a KeyMgmt header.

type RTPInfo

type RTPInfo []*RTPInfoEntry

RTPInfo is a RTP-Info header.

func (RTPInfo) Marshal

func (h RTPInfo) Marshal() base.HeaderValue

Marshal encodes a RTP-Info header.

func (*RTPInfo) Unmarshal

func (h *RTPInfo) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a RTP-Info header.

type RTPInfoEntry

type RTPInfoEntry struct {
	URL            string
	SequenceNumber *uint16
	Timestamp      *uint32
}

RTPInfoEntry is an entry of a RTP-Info header.

type Range

type Range struct {
	// range expressed in some measurement units.
	Value RangeValue

	// time at which the operation is to be made effective.
	Time *time.Time
}

Range is a Range header.

func (Range) Marshal

func (h Range) Marshal() base.HeaderValue

Marshal encodes a Range header.

func (*Range) Unmarshal

func (h *Range) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a Range header.

type RangeNPT

type RangeNPT struct {
	Start time.Duration
	End   *time.Duration
}

RangeNPT is a range expressed in NPT units.

type RangeSMPTE

type RangeSMPTE struct {
	Start RangeSMPTETime
	End   *RangeSMPTETime
}

RangeSMPTE is a range expressed in SMPTE unit.

type RangeSMPTETime

type RangeSMPTETime struct {
	Time     time.Duration
	Frame    uint
	Subframe uint
}

RangeSMPTETime is a time expressed in SMPTE unit.

type RangeUTC

type RangeUTC struct {
	Start time.Time
	End   *time.Time
}

RangeUTC is a range expressed in UTC units.

type RangeValue

type RangeValue interface {
	// contains filtered or unexported methods
}

RangeValue can be - RangeSMPTE - RangeNPT - RangeUTC

type Session

type Session struct {
	// session id
	Session string

	// (optional) timeout
	Timeout *uint
}

Session is a Session header.

func (Session) Marshal

func (h Session) Marshal() base.HeaderValue

Marshal encodes a Session header.

func (*Session) Unmarshal

func (h *Session) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a Session header.

type Transport

type Transport struct {
	// protocol of the stream.
	Protocol TransportProtocol

	// Whether the secure variant is active.
	Secure bool

	// (optional) delivery method of the stream.
	Delivery *TransportDelivery

	// (optional) Source IP.
	Source *net.IP

	// (optional) destination IP.
	Destination *net.IP

	// (optional) interleaved frame IDs.
	InterleavedIDs *[2]int

	// (optional) TTL.
	TTL *uint

	// (optional) ports.
	Ports *[2]int

	// (optional) client ports.
	ClientPorts *[2]int

	// (optional) server ports.
	ServerPorts *[2]int

	// (optional) SSRC of the packets of the stream.
	SSRC *uint32

	// (optional) mode.
	Mode *TransportMode
}

Transport is a Transport header.

func (Transport) Marshal

func (h Transport) Marshal() base.HeaderValue

Marshal encodes a Transport header.

func (*Transport) Unmarshal

func (h *Transport) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a Transport header.

type TransportDelivery

type TransportDelivery int

TransportDelivery is a delivery method.

const (
	TransportDeliveryUnicast TransportDelivery = iota
	TransportDeliveryMulticast
)

transport delivery methods.

func (TransportDelivery) String deprecated

func (d TransportDelivery) String() string

String implements fmt.Stringer.

Deprecated: not used anymore.

type TransportMode

type TransportMode int

TransportMode is a transport mode.

const (
	// TransportModePlay is the "play" transport mode
	TransportModePlay TransportMode = iota

	// TransportModeRecord is the "record" transport mode
	TransportModeRecord
)

func (TransportMode) String

func (m TransportMode) String() string

String implements fmt.Stringer.

type TransportProtocol

type TransportProtocol int

TransportProtocol is a transport protocol.

const (
	TransportProtocolUDP TransportProtocol = iota
	TransportProtocolTCP
)

transport protocols.

func (TransportProtocol) String deprecated

func (p TransportProtocol) String() string

String implements fmt.Stringer.

Deprecated: not used anymore.

type Transports

type Transports []Transport

Transports is a Transport header with multiple transports.

func (Transports) Marshal

func (ts Transports) Marshal() base.HeaderValue

Marshal encodes a Transport header.

func (*Transports) Unmarshal

func (ts *Transports) Unmarshal(v base.HeaderValue) error

Unmarshal decodes a Transport header.

Jump to

Keyboard shortcuts

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