description

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package description contains objects to describe streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Media

type Media struct {
	// Media type.
	Type MediaType

	// Media ID (optional).
	ID string

	// Direction of the stream (optional).
	Direction MediaDirection

	// Control attribute.
	Control string

	// Formats contained into the media.
	Formats []format.Format
}

Media is a media stream. It contains one or more formats.

func (Media) FindFormat

func (m Media) FindFormat(forma interface{}) bool

FindFormat finds a certain format among all the formats in the media.

func (Media) Marshal

func (m Media) Marshal() *psdp.MediaDescription

Marshal encodes the media in SDP format.

func (Media) URL

func (m Media) URL(contentBase *url.URL) (*url.URL, error)

URL returns the absolute URL of the media.

func (*Media) Unmarshal

func (m *Media) Unmarshal(md *psdp.MediaDescription) error

Unmarshal decodes the media from the SDP format.

type MediaDirection

type MediaDirection string

MediaDirection is the direction of a media stream.

const (
	MediaDirectionSendonly MediaDirection = "sendonly"
	MediaDirectionRecvonly MediaDirection = "recvonly"
	MediaDirectionSendrecv MediaDirection = "sendrecv"
)

standard directions.

type MediaType

type MediaType string

MediaType is the type of a media stream.

const (
	MediaTypeVideo       MediaType = "video"
	MediaTypeAudio       MediaType = "audio"
	MediaTypeApplication MediaType = "application"
)

standard media stream types.

type Session

type Session struct {
	// Base URL of the stream (read only).
	BaseURL *url.URL

	// Title of the stream (optional).
	Title string

	// FEC groups (RFC5109).
	FECGroups []SessionFECGroup

	// Media streams.
	Medias []*Media
}

Session is the description of a RTSP stream.

func (*Session) FindFormat

func (d *Session) FindFormat(forma interface{}) *Media

FindFormat finds a certain format among all the formats in all the medias of the stream. If the format is found, it is inserted into forma, and its media is returned.

func (Session) Marshal

func (d Session) Marshal(multicast bool) ([]byte, error)

Marshal encodes the description in SDP.

func (*Session) Unmarshal

func (d *Session) Unmarshal(ssd *sdp.SessionDescription) error

Unmarshal decodes the description from SDP.

type SessionFECGroup

type SessionFECGroup []string

SessionFECGroup is a FEC group.

Jump to

Keyboard shortcuts

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