internal

package
v0.0.0-...-b8abd31 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectAlgorithm

func DetectAlgorithm(cpu *pem.Block, pu *pem.Block, sig []byte) *channel.HashAlgorithm

func DownloadManifest

func DownloadManifest(log hclog.Logger, certService string, certServiceSalt string) (map[string]string, error)

func GetPort

func GetPort(addr net.Addr) int

func MakeCertManifestPath

func MakeCertManifestPath(certManifestDir string, timestamp string) (*string, error)

func NewLogger

func NewLogger(name string) hclog.Logger

func PrintCertificate

func PrintCertificate(bytes []byte)

func PrintManifest

func PrintManifest(manifest map[string]string)

func ReadManifest

func ReadManifest(log hclog.Logger, certManifest string, fixNewlines bool) (map[string]string, error)

func VerifySignature

func VerifySignature(manifest map[string]string, useSha256 bool)

Types

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

func NewAdvertisement

func NewAdvertisement(device *Device, port int) *Advertisement

func (*Advertisement) Stop

func (advertisement *Advertisement) Stop()

type Answer

type Answer struct {
	CastMode             string   `json:"castMode"`
	ReceiverGetStatus    bool     `json:"receiverGetStatus"`
	ReceiverRtcpEventLog []int    `json:"receiverRtcpEventLog"`
	SendIndexes          []int    `json:"sendIndexes"`
	Ssrcs                []uint32 `json:"ssrcs"`
	UdpPort              int      `json:"udpPort"`
}

type Application

type Application struct {
	AppId        string      `json:"appId"`
	DisplayName  string      `json:"displayName"`
	IsIdleScreen bool        `json:"isIdleScreen"`
	Namespaces   []Namespace `json:"namespaces"`
	SessionId    string      `json:"sessionId"`
	StatusText   string      `json:"statusText"`
	TransportId  string      `json:"transportId"`
}

type Audio

type Audio struct {
	MaxSampleRate int `json:"maxSampleRate"`
	MaxChannels   int `json:"maxChannels"`
	MinBitRate    int `json:"minBitRate"`
	MaxBitRate    int `json:"maxBitRate"`
	MaxDelay      int `json:"maxDelay"`
}

type CastChannel

type CastChannel struct {
	Messages chan *channel.CastMessage
	// contains filtered or unexported fields
}

func CreateCastChannel

func CreateCastChannel(conn net.Conn, log hclog.Logger) CastChannel

func (*CastChannel) Send

func (castChannel *CastChannel) Send(castMessage *channel.CastMessage) bool

type CastFeedback

type CastFeedback struct {
	ReceiverSSRC        uint32
	SenderSSRC          uint32
	CkPtFrameId         uint8
	LossFields          uint8
	CurrentPlayoutDelay uint16
}

func (*CastFeedback) Header

func (feedback *CastFeedback) Header() rtcp.Header

func (*CastFeedback) Marshal

func (feedback *CastFeedback) Marshal() ([]byte, error)

func (*CastFeedback) String

func (feedback *CastFeedback) String() string

func (*CastFeedback) Unmarshal

func (feedback *CastFeedback) Unmarshal(rawPacket []byte) error

type CastTransport

type CastTransport interface {
	HandleCastMessage(message *channel.CastMessage)
	TransportId() string
}

type Client

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

func NewClient

func NewClient(hostname string, port uint, authChallenge bool, wg *sync.WaitGroup) *Client

func (*Client) SendMessage

func (client *Client) SendMessage(castMessage *channel.CastMessage)

type ClientConnection

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

func NewClientConnection

func NewClientConnection(
	device *Device,
	conn net.Conn,
	id int,
	manifest map[string]string,
) *ClientConnection

type Constraints

type Constraints struct {
	Audio *Audio `json:"audio"`
	Video *Video `json:"video"`
}

type Decrypter

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

func NewDecrypter

func NewDecrypter(aesKey []byte, aesIvMask []byte) *Decrypter

func (*Decrypter) Decrypt

func (decrypter *Decrypter) Decrypt(payload []byte, output []byte)

func (*Decrypter) Reset

func (decrypter *Decrypter) Reset(frameNumber int)

type Device

type Device struct {
	AvailableApps []string
	DeviceModel   string
	FriendlyName  string
	Id            string
	Sessions      map[string]*Session
	Udn           string
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(images chan *image.RGBA, deviceModel string, friendlyName string, id string, jpegOutput bool, udn string) *Device

func (*Device) DisplayImage

func (device *Device) DisplayImage(image *image.RGBA)

type DeviceInfoResponse

type DeviceInfoResponse struct {
	*DiscoveryMessage

	ControlNotifications int    `json:"controlNotifications"`
	DeviceCapabilities   int    `json:"deviceCapabilities"`
	DeviceIconUrl        string `json:"deviceIconUrl"`
	DeviceId             string `json:"deviceId"`
	DeviceModel          string `json:"deviceModel"`
	FriendlyName         string `json:"friendlyName"`
	ReceiverMetricsId    string `json:"receiverMetricsId"`
	WifiProximityId      string `json:"wifiProximityId"`
}

type Dimensions

type Dimensions struct {
	Width     uint   `json:"width"`
	Height    uint   `json:"height"`
	FrameRate string `json:"frameRate"`
}

type DiscoveryMessage

type DiscoveryMessage struct {
	RequestId int    `json:"requestId"`
	Type      string `json:"type"`
}

type Display

type Display struct {
	Dimensions  Dimensions `json:"dimensions"`
	AspectRatio string     `json:"aspectRatio"`
	Scaling     string     `json:"scaling"`
}

type GetAppAvailabilityRequest

type GetAppAvailabilityRequest struct {
	*ReceiverMessage

	AppId []string `json:"appId"`
}

type GetAppAvailabilityResponse

type GetAppAvailabilityResponse struct {
	*ReceiverMessage

	Availability map[string]string `json:"availability"`
}

type GetStatusResponse

type GetStatusResponse struct {
	*ReceiverMessage

	Status Status `json:"status"`
}

type Namespace

type Namespace struct {
	Name string `json:"name"`
}

type Offer

type Offer struct {
	CastMode          string            `json:"castMode"`
	ReceiverGetStatus bool              `json:"receiverGetStatus"`
	SupportedStreams  []SupportedStream `json:"supportedStreams"`
}

type Receiver

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

func NewReceiver

func NewReceiver(device *Device, id string, clientId int) *Receiver

func (*Receiver) HandleCastMessage

func (receiver *Receiver) HandleCastMessage(castMessage *channel.CastMessage)

func (*Receiver) TransportId

func (receiver *Receiver) TransportId() string

type ReceiverMessage

type ReceiverMessage struct {
	RequestId int    `json:"requestId"`
	Type      string `json:"type"`
}

type Server

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

func NewServer

func NewServer(
	device *Device,
	manifest map[string]string,
	clientPrefix *string,
	iface *string,
	port int,
	wg *sync.WaitGroup,
) *Server

func (*Server) StopListening

func (server *Server) StopListening()

type Session

type Session struct {
	AppId       string
	DisplayName string
	SessionId   string
	StatusText  string
	// contains filtered or unexported fields
}

func NewSession

func NewSession(appId string, clientId int, device *Device, displayName string, jpegOutput bool, sessionId string, transportId string) *Session

func (*Session) GetPort

func (session *Session) GetPort() int

func (*Session) HandleCastMessage

func (session *Session) HandleCastMessage(castMessage *channel.CastMessage)

func (*Session) Namespaces

func (session *Session) Namespaces() []string

func (*Session) Start

func (session *Session) Start()

func (*Session) Stop

func (session *Session) Stop()

func (*Session) TransportId

func (session *Session) TransportId() string

type SetupData

type SetupData struct {
	DeviceInfo SetupDeviceInfo `json:"device_info"`
	Name       string          `json:"name"`
	Version    int             `json:"version"`
}

type SetupDeviceInfo

type SetupDeviceInfo struct {
	SsdpUdn string `json:"ssdp_udn"`
}

type SetupMessage

type SetupMessage struct {
	RequestId int    `json:"request_id"`
	Type      string `json:"type"`
}

type SetupResponse

type SetupResponse struct {
	*SetupMessage

	Data           SetupData `json:"data"`
	ResponseCode   int       `json:"response_code"`
	ResponseString string    `json:"response_string"`
}

type Status

type Status struct {
	Applications  []Application `json:"applications"`
	IsActiveInput bool          `json:"isActiveInput"`
	Volume        Volume        `json:"volume"`
}

type Stream

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

func NewStream

func NewStream(decode func([]byte, int), log hclog.Logger, sendRtcp func([]byte, net.Addr), receiverSsrc uint32, senderSsrc uint32) *Stream

type Subscription

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

type SupportedStream

type SupportedStream struct {
	AesIvMask string `json:"aesIvMask"`
	AesKey    string `json:"aesKey"`
	Index     int    `json:"index"`
	Ssrc      uint32 `json:"ssrc"`
	Type      string `json:"type"`
}

type Transport

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

type Video

type Video struct {
	MaxDimensions *Dimensions `json:"maxDimensions"`
	MinDimensions *Dimensions `json:"minDimensions"`
}

type Volume

type Volume struct {
	Level float32 `json:"level"`
	Muted bool    `json:"muted"`
}

type WebrtcMessage

type WebrtcMessage struct {
	SeqNum uint32 `json:"seqNum"`
	Type   string `json:"type"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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