Documentation ¶
Index ¶
- Constants
- Variables
- func Bool(b bool) *bool
- func NewInvalidStateError(format string, args ...interface{}) error
- func NewTypeError(format string, args ...interface{}) error
- func NewUnsupportedError(format string, args ...interface{}) error
- type AudioLevelObserver
- type AudioLevelObserverOptions
- type AudioLevelObserverVolume
- type Channel
- type Consumer
- func (consumer *Consumer) AppData() interface{}
- func (consumer *Consumer) Close() (err error)
- func (consumer *Consumer) Closed() bool
- func (consumer *Consumer) ConsumerId() string
- func (consumer *Consumer) CurrentLayers() *ConsumerLayers
- func (consumer *Consumer) Dump() (dump *ConsumerDump, err error)
- func (consumer *Consumer) EnableTraceEvent(types ...ConsumerTraceEventType) error
- func (consumer *Consumer) GetStats() (stats []*ConsumerStat, err error)
- func (consumer *Consumer) Id() string
- func (consumer *Consumer) Kind() MediaKind
- func (consumer *Consumer) Observer() IEventEmitter
- func (consumer *Consumer) Pause() (err error)
- func (consumer *Consumer) Paused() bool
- func (consumer *Consumer) PreferredLayers() *ConsumerLayers
- func (consumer *Consumer) Priority() uint32
- func (consumer *Consumer) ProducerId() string
- func (consumer *Consumer) ProducerPaused() bool
- func (consumer *Consumer) RequestKeyFrame() error
- func (consumer *Consumer) Resume() (err error)
- func (consumer *Consumer) RtpParameters() RtpParameters
- func (consumer *Consumer) Score() ConsumerScore
- func (consumer *Consumer) SetPreferredLayers(layers ConsumerLayers) (err error)
- func (consumer *Consumer) SetPriority(priority uint32) (err error)
- func (consumer *Consumer) Type() ConsumerType
- func (consumer *Consumer) UnsetPriority() (err error)
- type ConsumerDump
- type ConsumerLayers
- type ConsumerOptions
- type ConsumerScore
- type ConsumerStat
- type ConsumerTraceEventData
- type ConsumerTraceEventType
- type ConsumerType
- type DataConsumer
- func (c *DataConsumer) AppData() interface{}
- func (c *DataConsumer) Close() (err error)
- func (c *DataConsumer) Closed() bool
- func (c *DataConsumer) DataProducerId() string
- func (c *DataConsumer) Dump() (data DataConsumerDump, err error)
- func (c *DataConsumer) GetBufferedAmount() (bufferedAmount int64, err error)
- func (c *DataConsumer) GetStats() (stats []*DataConsumerStat, err error)
- func (c *DataConsumer) Id() string
- func (c *DataConsumer) Label() string
- func (c *DataConsumer) Observer() IEventEmitter
- func (c *DataConsumer) Protocol() string
- func (c *DataConsumer) SctpStreamParameters() *SctpStreamParameters
- func (c *DataConsumer) Send(data []byte, ppid ...int) (err error)
- func (c *DataConsumer) SendText(message string) error
- func (c *DataConsumer) SetBufferedAmountLowThreshold(threshold int) error
- func (c *DataConsumer) Type() DataConsumerType
- type DataConsumerDump
- type DataConsumerOptions
- type DataConsumerStat
- type DataConsumerType
- type DataProducer
- func (p *DataProducer) AppData() interface{}
- func (p *DataProducer) Close() (err error)
- func (p *DataProducer) Closed() bool
- func (p *DataProducer) Dump() (dump DataProducerDump, err error)
- func (p *DataProducer) GetStats() (stats []*DataProducerStat, err error)
- func (p *DataProducer) Id() string
- func (p *DataProducer) Label() string
- func (p *DataProducer) Observer() IEventEmitter
- func (p *DataProducer) Protocol() string
- func (p *DataProducer) SctpStreamParameters() SctpStreamParameters
- func (p *DataProducer) Send(data []byte, ppid ...int) (err error)
- func (p *DataProducer) SendText(message string) error
- func (p *DataProducer) Type() DataConsumerType
- type DataProducerDump
- type DataProducerOptions
- type DataProducerStat
- type DataProducerType
- type DirectTransport
- type DirectTransportOptions
- type DtlsFingerprint
- type DtlsParameters
- type DtlsRole
- type DtlsState
- type H
- type IEventEmitter
- type IRtpObserver
- type ITransport
- type IceCandidate
- type IceParameters
- type IceState
- type InvalidStateError
- type Logger
- type MediaKind
- type NumSctpStreams
- type Option
- func WithCustomOption(key string, value interface{}) Option
- func WithDtlsCert(dtlsCertificateFile, dtlsPrivateKeyFile string) Option
- func WithLogLevel(logLevel WorkerLogLevel) Option
- func WithLogTags(logTags []WorkerLogTag) Option
- func WithRtcMaxPort(rtcMaxPort uint16) Option
- func WithRtcMinPort(rtcMinPort uint16) Option
- type PayloadChannel
- func (c *PayloadChannel) Close()
- func (c *PayloadChannel) Closed() bool
- func (c *PayloadChannel) Notify(event string, internal interface{}, data interface{}, payload []byte) (err error)
- func (c *PayloadChannel) Request(method string, internal interface{}, data interface{}, payload []byte) (rsp workerResponse)
- type PipeToRouterOptions
- type PipeToRouterResult
- type PipeTransport
- func (transport *PipeTransport) Close()
- func (transport *PipeTransport) Connect(options TransportConnectOptions) (err error)
- func (transport *PipeTransport) Consume(options ConsumerOptions) (consumer *Consumer, err error)
- func (transport *PipeTransport) Observer() IEventEmitter
- func (t PipeTransport) SctpParameters() SctpParameters
- func (t PipeTransport) SctpState() SctpState
- func (t PipeTransport) SrtpParameters() *SrtpParameters
- func (t PipeTransport) Tuple() TransportTuple
- type PipeTransportOptions
- type PlainTransport
- func (transport *PlainTransport) Close()
- func (transport *PlainTransport) Connect(options TransportConnectOptions) (err error)
- func (transport *PlainTransport) Observer() IEventEmitter
- func (t PlainTransport) RtcpTuple() *TransportTuple
- func (t PlainTransport) SctpParameters() SctpParameters
- func (t PlainTransport) SctpState() SctpState
- func (t PlainTransport) SrtpParameters() *SrtpParameters
- func (t PlainTransport) Tuple() *TransportTuple
- type PlainTransportDump
- type PlainTransportOptions
- type PlainTransportSpecificStat
- type Producer
- func (producer *Producer) AppData() interface{}
- func (producer *Producer) Close() (err error)
- func (producer *Producer) Closed() bool
- func (producer *Producer) ConsumableRtpParameters() RtpParameters
- func (producer *Producer) Dump() (dump ProducerDump, err error)
- func (producer *Producer) EnableTraceEvent(types ...ProducerTraceEventType) error
- func (producer *Producer) GetStats() (stats []*ProducerStat, err error)
- func (producer *Producer) Id() string
- func (producer *Producer) Kind() MediaKind
- func (producer *Producer) Observer() IEventEmitter
- func (producer *Producer) Pause() (err error)
- func (producer *Producer) Paused() bool
- func (producer *Producer) Resume() (err error)
- func (producer *Producer) RtpParameters() RtpParameters
- func (producer *Producer) Score() []ProducerScore
- func (producer *Producer) Send(rtpPacket []byte) error
- func (producer *Producer) Type() ProducerType
- type ProducerDump
- type ProducerOptions
- type ProducerScore
- type ProducerStat
- type ProducerTraceEventData
- type ProducerTraceEventType
- type ProducerType
- type ProducerVideoOrientation
- type RecvRtpHeaderExtensions
- type Router
- func (router *Router) CanConsume(producerId string, rtpCapabilities RtpCapabilities) bool
- func (router *Router) Close()
- func (router *Router) Closed() bool
- func (router *Router) CreateAudioLevelObserver(options ...func(o *AudioLevelObserverOptions)) (rtpObserver IRtpObserver, err error)
- func (router *Router) CreateDirectTransport(params ...DirectTransportOptions) (transport *DirectTransport, err error)
- func (router *Router) CreatePipeTransport(option PipeTransportOptions) (transport *PipeTransport, err error)
- func (router *Router) CreatePlainTransport(option PlainTransportOptions) (transport *PlainTransport, err error)
- func (router *Router) CreateWebRtcTransport(option WebRtcTransportOptions) (transport *WebRtcTransport, err error)
- func (router *Router) Dump() (data *RouterDump, err error)
- func (router *Router) Id() string
- func (router *Router) Observer() IEventEmitter
- func (router *Router) PipeToRouter(option PipeToRouterOptions) (result *PipeToRouterResult, err error)
- func (router *Router) RtpCapabilities() RtpCapabilities
- type RouterDump
- type RouterOptions
- type RtcpFeedback
- type RtcpParameters
- type RtpCapabilities
- type RtpCodecCapability
- type RtpCodecParameters
- type RtpCodecSpecificParameters
- type RtpEncodingParameters
- type RtpEncodingRtx
- type RtpHeaderExtension
- type RtpHeaderExtensionDirection
- type RtpHeaderExtensionParameters
- type RtpListener
- type RtpMapping
- type RtpMappingCodec
- type RtpMappingEncoding
- type RtpObserver
- func (o *RtpObserver) AddProducer(producerId string)
- func (o *RtpObserver) AppData() interface{}
- func (o *RtpObserver) Close()
- func (o *RtpObserver) Closed() bool
- func (o *RtpObserver) Id() string
- func (o *RtpObserver) Observer() IEventEmitter
- func (o *RtpObserver) Pause()
- func (o *RtpObserver) Paused() bool
- func (o *RtpObserver) RemoveProducer(producerId string)
- func (o *RtpObserver) Resume()
- type RtpParameters
- type RtpStream
- type RtpStreamParams
- type ScalabilityMode
- type SctpCapabilities
- type SctpListener
- type SctpParameters
- type SctpState
- type SctpStreamParameters
- type SimulcastConsumerDump
- type SrtpCryptoSuite
- type SrtpParameters
- type Transport
- func (transport *Transport) AppData() interface{}
- func (transport *Transport) Close()
- func (transport *Transport) Closed() bool
- func (transport *Transport) Connect(TransportConnectOptions) error
- func (transport *Transport) Consume(options ConsumerOptions) (consumer *Consumer, err error)
- func (transport *Transport) ConsumeData(options DataConsumerOptions) (dataConsumer *DataConsumer, err error)
- func (transport *Transport) Dump() (data *TransportDump, err error)
- func (transport *Transport) EnableTraceEvent(types ...TransportTraceEventType) error
- func (transport *Transport) GetStats() (stat []*TransportStat, err error)
- func (transport *Transport) Id() string
- func (transport *Transport) Observer() IEventEmitter
- func (transport *Transport) Produce(options ProducerOptions) (producer *Producer, err error)
- func (transport *Transport) ProduceData(options DataProducerOptions) (dataProducer *DataProducer, err error)
- func (transport *Transport) SetMaxIncomingBitrate(bitrate int) error
- type TransportConnectOptions
- type TransportDump
- type TransportListenIp
- type TransportProtocol
- type TransportStat
- type TransportTraceEventData
- type TransportTraceEventType
- type TransportTuple
- type TransportType
- type TypeError
- type UnsupportedError
- type WebRtcTransport
- func (transport *WebRtcTransport) Close()
- func (transport *WebRtcTransport) Connect(options TransportConnectOptions) (err error)
- func (t WebRtcTransport) DtlsParameters() DtlsParameters
- func (t WebRtcTransport) DtlsRemoteCert() string
- func (t WebRtcTransport) DtlsState() DtlsState
- func (t WebRtcTransport) IceCandidates() []IceCandidate
- func (t WebRtcTransport) IceParameters() IceParameters
- func (t WebRtcTransport) IceRole() string
- func (t WebRtcTransport) IceSelectedTuple() *TransportTuple
- func (t WebRtcTransport) IceState() IceState
- func (transport *WebRtcTransport) Observer() IEventEmitter
- func (transport *WebRtcTransport) RestartIce() (iceParameters IceParameters, err error)
- func (t WebRtcTransport) SctpParameters() SctpParameters
- func (t WebRtcTransport) SctpState() SctpState
- type WebRtcTransportDump
- type WebRtcTransportOptions
- type WebRtcTransportSpecificStat
- type Worker
- func (w *Worker) AppData() interface{}
- func (w *Worker) Close()
- func (w *Worker) Closed() bool
- func (w *Worker) CreateRouter(options RouterOptions, roomId string) (router *Router, err error)
- func (w *Worker) Dump() (dump WorkerDump, err error)
- func (w *Worker) GetResourceUsage() (usage WorkerResourceUsage, err error)
- func (w *Worker) Observer() IEventEmitter
- func (w *Worker) Pid() int
- func (w *Worker) UpdateSettings(settings WorkerUpdateableSettings) error
- type WorkerDump
- type WorkerLogLevel
- type WorkerLogTag
- type WorkerResourceUsage
- type WorkerSettings
- type WorkerUpdateableSettings
Constants ¶
const ( // netstring length for a 4194304 bytes payload. NS_MESSAGE_MAX_LEN = 4194313 NS_PAYLOAD_MAX_LEN = 4194304 )
const ( ConsumerTraceEventType_Rtp ConsumerTraceEventType = "rtp" ConsumerTraceEventType_Keyframe = "keyframe" ConsumerTraceEventType_Nack = "nack" ConsumerTraceEventType_Pli = "pli" ConsumerTraceEventType_Fir = "fir" )
const ( ConsumerType_Simple ConsumerType = "simple" ConsumerType_Simulcast = "simulcast" ConsumerType_Svc = "svc" ConsumerType_Pipe = "pipe" )
const ( PPID_WEBRTC_STRING int = 51 PPID_WEBRTC_BINARY = 53 )
const ( // DebugLevel defines debug log level. DebugLevel = zerolog.DebugLevel // InfoLevel defines info log level. InfoLevel = zerolog.InfoLevel // WarnLevel defines warn log level. WarnLevel = zerolog.WarnLevel // ErrorLevel defines error log level. ErrorLevel = zerolog.ErrorLevel // Disabled disables the logger. Disabled = zerolog.Disabled )
const ( ProducerTraceEventType_Rtp ProducerTraceEventType = "rtp" ProducerTraceEventType_Keyframe = "keyframe" ProducerTraceEventType_Nack = "nack" ProducerTraceEventType_Pli = "pli" ProducerTraceEventType_Fir = "fir" )
const ( ProducerType_Simple ProducerType = ConsumerType_Simple ProducerType_Simulcast = ConsumerType_Simulcast ProducerType_Svc = ConsumerType_Svc )
const ( Direction_Sendrecv RtpHeaderExtensionDirection = "sendrecv" Direction_Sendonly = "sendonly" Direction_Recvonly = "recvonly" Direction_Inactive = "inactive" )
const ( SctpState_New = "new" SctpState_Connecting = "connecting" SctpState_Connected = "connected" SctpState_Failed = "failed" SctpState_Closed = "closed" )
const ( TransportType_Direct TransportType = "DirectTransport" TransportType_Plain = "PlainTransport" TransportType_Pipe = "PipeTransport" TransportType_Webrtc = "WebrtcTransport" )
const ( IceState_New IceState = "new" IceState_Connected = "connected" IceState_Completed = "completed" IceState_Disconnected = "disconnected" IceState_Closed = "closed" )
const ( DtlsRole_Auto DtlsRole = "auto" DtlsRole_Client = "client" DtlsRole_Server = "server" )
const ( DtlsState_New = "new" DtlsState_Connecting = "connecting" DtlsState_Connected = "connected" DtlsState_Failed = "failed" DtlsState_Closed = "closed" )
const ( WorkerLogLevel_Debug WorkerLogLevel = "debug" WorkerLogLevel_Warn = "warn" WorkerLogLevel_Error = "error" WorkerLogLevel_None = "none" )
const ( WorkerLogTag_INFO WorkerLogTag = "info" WorkerLogTag_ICE = "ice" WorkerLogTag_DTLS = "dtls" WorkerLogTag_RTP = "rtp" WorkerLogTag_SRTP = "srtp" WorkerLogTag_RTCP = "rtcp" WorkerLogTag_RTX = "rtx" WorkerLogTag_BWE = "bwe" WorkerLogTag_Score = "score" WorkerLogTag_Simulcast = "simulcast" WorkerLogTag_SVC = "svc" WorkerLogTag_SCTP = "sctp" WorkerLogTag_Message = "message" )
const VERSION = "3.7.17"
Variables ¶
var ( // DefaultLevel defines default log level. DefaultLevel = DebugLevel // NewLogger defines function to create logger instance. NewLogger = newDefaultLogger // NewLoggerWriter defines function to create logger writer. NewLoggerWriter = func() io.Writer { writer := zerolog.ConsoleWriter{ Out: os.Stdout, TimeFormat: time.RFC3339, } if hideDate := os.Getenv("DEBUG_HIDE_DATE"); len(hideDate) > 0 { val, err := strconv.ParseBool(hideDate) if err == nil && val { writer.FormatTimestamp = func(interface{}) string { return "" } } } if color := os.Getenv("DEBUG_COLORS"); len(color) > 0 { val, err := strconv.ParseBool(color) if err == nil { writer.NoColor = !val } } return writer } )
var DYNAMIC_PAYLOAD_TYPES = [...]byte{
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115,
116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 96, 97, 98, 99, 77,
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
}
var WorkerBin string = os.Getenv("MEDIASOUP_WORKER_BIN")
Functions ¶
func NewInvalidStateError ¶
func NewTypeError ¶
func NewUnsupportedError ¶
Types ¶
type AudioLevelObserver ¶
type AudioLevelObserver struct { IRtpObserver // contains filtered or unexported fields }
func (*AudioLevelObserver) Observer ¶
func (o *AudioLevelObserver) Observer() IEventEmitter
*
- Observer. *
- @emits close
- @emits pause
- @emits resume
- @emits addproducer - (producer: Producer)
- @emits removeproducer - (producer: Producer)
- @emits volumes - (volumes: AudioLevelObserverVolume[])
- @emits silence
type AudioLevelObserverOptions ¶
type AudioLevelObserverOptions struct { /** * Maximum int of entries in the 'volumes”' event. Default 1. */ MaxEntries int `json:"maxEntries"` /** * Minimum average volume (in dBvo from -127 to 0) for entries in the * 'volumes' event. Default -80. */ Threshold int `json:"threshold"` /** * Interval in ms for checking audio volumes. Default 1000. */ Interval int `json:"interval"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
func NewAudioLevelObserverOptions ¶
func NewAudioLevelObserverOptions() AudioLevelObserverOptions
type Channel ¶
type Channel struct { IEventEmitter // contains filtered or unexported fields }
type Consumer ¶
type Consumer struct { IEventEmitter // contains filtered or unexported fields }
*
- Consumer
- @emits transportclose
- @emits producerclose
- @emits producerpause
- @emits producerresume
- @emits score - (score: ConsumerScore)
- @emits layerschange - (layers: ConsumerLayers | undefined)
- @emits rtp - (packet: Buffer)
- @emits trace - (trace: ConsumerTraceEventData)
- @emits @close
- @emits @producerclose
func (*Consumer) CurrentLayers ¶
func (consumer *Consumer) CurrentLayers() *ConsumerLayers
Current video layers.
func (*Consumer) Dump ¶
func (consumer *Consumer) Dump() (dump *ConsumerDump, err error)
Dump Consumer.
func (*Consumer) EnableTraceEvent ¶
func (consumer *Consumer) EnableTraceEvent(types ...ConsumerTraceEventType) error
*
- Enable 'trace' event.
func (*Consumer) GetStats ¶
func (consumer *Consumer) GetStats() (stats []*ConsumerStat, err error)
Get Consumer stats.
func (*Consumer) Observer ¶
func (consumer *Consumer) Observer() IEventEmitter
*
- Observer. *
- @emits close
- @emits pause
- @emits resume
- @emits score - (score: ConsumerScore)
- @emits layerschange - (layers: ConsumerLayers | undefined)
- @emits trace - (trace: ConsumerTraceEventData)
func (*Consumer) PreferredLayers ¶
func (consumer *Consumer) PreferredLayers() *ConsumerLayers
Preferred video layers.
func (*Consumer) ProducerPaused ¶
Whether the associate Producer is paused.
func (*Consumer) RequestKeyFrame ¶
Request a key frame to the Producer.
func (*Consumer) RtpParameters ¶
func (consumer *Consumer) RtpParameters() RtpParameters
RTP parameters.
func (*Consumer) Score ¶
func (consumer *Consumer) Score() ConsumerScore
Consumer score with consumer and consumer keys.
func (*Consumer) SetPreferredLayers ¶
func (consumer *Consumer) SetPreferredLayers(layers ConsumerLayers) (err error)
Set preferred video layers.
func (*Consumer) SetPriority ¶
Set priority.
func (*Consumer) UnsetPriority ¶
Unset priority.
type ConsumerDump ¶
type ConsumerDump struct { Id string `json:"id,omitempty"` ProducerId string `json:"producerId,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` RtpParameters RtpParameters `json:"rtpParameters,omitempty"` ConsumableRtpEncodings []RtpMappingEncoding `json:"consumableRtpEncodings,omitempty"` SupportedCodecPayloadTypes []uint32 `json:"supportedCodecPayloadTypes,omitempty"` Paused bool `json:"paused,omitempty"` ProducerPaused bool `json:"producerPaused,omitempty"` Priority uint8 `json:"priority,omitempty"` TraceEventTypes string `json:"traceEventTypes,omitempty"` RtpStreams []RtpStream `json:"rtpStreams,omitempty"` RtpStream *RtpStream `json:"rtpStream,omitempty"` // dump by SvcConsumer *SimulcastConsumerDump }
type ConsumerLayers ¶
type ConsumerOptions ¶
type ConsumerOptions struct { /** * The id of the Producer to consume. */ ProducerId string `json:"producerId,omitempty"` /** * RTP capabilities of the consuming endpoint. */ RtpCapabilities RtpCapabilities `json:"rtpCapabilities,omitempty"` /** * Whether the Consumer must start in paused mode. Default false. * * When creating a video Consumer, it's recommended to set paused to true, * then transmit the Consumer parameters to the consuming endpoint and, once * the consuming endpoint has created its local side Consumer, unpause the * server side Consumer using the resume() method. This is an optimization * to make it possible for the consuming endpoint to render the video as far * as possible. If the server side Consumer was created with paused false, * mediasoup will immediately request a key frame to the remote Producer and * suych a key frame may reach the consuming endpoint even before it's ready * to consume it, generating “black” video until the device requests a keyframe * by itself. */ Paused bool `json:"paused,omitempty"` /** * The MID for the Consumer. If not specified, a sequentially growing * number will be assigned. */ Mid string `json:"mid,omitempty"` /** * Preferred spatial and temporal layer for simulcast or SVC media sources. * If unset, the highest ones are selected. */ PreferredLayers *ConsumerLayers `json:"preferredLayers,omitempty"` /** * Whether this Consumer should consume all RTP streams generated by the * Producer. */ Pipe bool /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type ConsumerScore ¶
type ConsumerScore struct { /** * The score of the RTP stream of the consumer. */ Score uint16 `json:"score"` /** * The score of the currently selected RTP stream of the producer. */ ProducerScore uint16 `json:"producerScore"` /** * The scores of all RTP streams in the producer ordered by encoding (just * useful when the producer uses simulcast). */ ProducerScores []uint16 `json:"producerScores,omitempty"` }
type ConsumerStat ¶
type ConsumerStat = ProducerStat
type ConsumerTraceEventData ¶
type ConsumerTraceEventData struct { /** * Trace type. */ Type ConsumerTraceEventType `json:"type,omitempty"` /** * Event timestamp. */ Timestamp int64 `json:"timestamp,omitempty"` /** * Event direction, "in" | "out". */ Direction string `json:"direction,omitempty"` /** * Per type information. */ Info H `json:"info,omitempty"` }
*
- 'trace' event data.
type DataConsumer ¶
type DataConsumer struct { IEventEmitter // contains filtered or unexported fields }
*
- DataConsumer
- @emits transportclose
- @emits dataproducerclose
- @emits message - (message: Buffer, ppid: number)
- @emits sctpsendbufferfull
- @emits bufferedamountlow - (bufferedAmount: number)
- @emits @close
- @emits @dataproducerclose
func (*DataConsumer) Closed ¶
func (c *DataConsumer) Closed() bool
Whether the DataConsumer is closed.
func (*DataConsumer) DataProducerId ¶
func (c *DataConsumer) DataProducerId() string
Associated DataProducer id.
func (*DataConsumer) Dump ¶
func (c *DataConsumer) Dump() (data DataConsumerDump, err error)
Dump DataConsumer.
func (*DataConsumer) GetBufferedAmount ¶
func (c *DataConsumer) GetBufferedAmount() (bufferedAmount int64, err error)
*
- Get buffered amount size.
func (*DataConsumer) GetStats ¶
func (c *DataConsumer) GetStats() (stats []*DataConsumerStat, err error)
Get DataConsumer stats.
func (*DataConsumer) Observer ¶
func (c *DataConsumer) Observer() IEventEmitter
*
- Observer. *
- @emits close
func (*DataConsumer) SctpStreamParameters ¶
func (c *DataConsumer) SctpStreamParameters() *SctpStreamParameters
*
- SCTP stream parameters.
func (*DataConsumer) Send ¶
func (c *DataConsumer) Send(data []byte, ppid ...int) (err error)
*
- Send data.
func (*DataConsumer) SetBufferedAmountLowThreshold ¶
func (c *DataConsumer) SetBufferedAmountLowThreshold(threshold int) error
*
- Set buffered amount low threshold.
type DataConsumerDump ¶
type DataConsumerDump struct { Id string `json:"id,omitempty"` DataProducerId string `json:"dataProducerId,omitempty"` Type string `json:"type,omitempty"` SctpStreamParameters *SctpStreamParameters `json:"sctpStreamParameters,omitempty"` Label string `json:"label,omitempty"` Protocol string `json:"protocol,omitempty"` BufferedAmount uint32 `json:"bufferedAmount,omitempty"` BufferedAmountLowThreshold uint32 `json:"bufferedAmountLowThreshold,omitempty"` }
type DataConsumerOptions ¶
type DataConsumerOptions struct { /** * The id of the DataProducer to consume. */ DataProducerId string `json:"dataProducerId,omitempty"` /** * Just if consuming over SCTP. * Whether data messages must be received in order. If true the messages will * be sent reliably. Defaults to the value in the DataProducer if it has type * 'sctp' or to true if it has type 'direct'. */ Ordered *bool `json:"ordered,omitempty"` /** * Just if consuming over SCTP. * When ordered is false indicates the time (in milliseconds) after which a * SCTP packet will stop being retransmitted. Defaults to the value in the * DataProducer if it has type 'sctp' or unset if it has type 'direct'. */ MaxPacketLifeTime uint16 `json:"maxPacketLifeTime,omitempty"` /** * Just if consuming over SCTP. * When ordered is false indicates the maximum number of times a packet will * be retransmitted. Defaults to the value in the DataProducer if it has type * 'sctp' or unset if it has type 'direct'. */ MaxRetransmits uint16 `json:"maxRetransmits,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type DataConsumerStat ¶
type DataConsumerStat struct { Type string `json:"type,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Label string `json:"label,omitempty"` Protocol string `json:"protocol,omitempty"` MessagesSent int64 `json:"messagesSent,omitempty"` BytesSent int64 `json:"bytesSent,omitempty"` BufferedAmount uint32 `json:"bufferedAmount,omitempty"` }
type DataConsumerType ¶
type DataConsumerType string
*
- DataConsumer type.
const ( DataConsumerType_Sctp DataConsumerType = "sctp" DataConsumerType_Direct = "direct" )
type DataProducer ¶
type DataProducer struct { IEventEmitter // contains filtered or unexported fields }
*
- DataProducer
- @emits transportclose
- @emits @close
func (*DataProducer) Closed ¶
func (p *DataProducer) Closed() bool
Whether the DataProducer is closed.
func (*DataProducer) Dump ¶
func (p *DataProducer) Dump() (dump DataProducerDump, err error)
Dump DataConsumer.
func (*DataProducer) GetStats ¶
func (p *DataProducer) GetStats() (stats []*DataProducerStat, err error)
Get DataConsumer stats.
func (*DataProducer) Observer ¶
func (p *DataProducer) Observer() IEventEmitter
*
- Observer. *
- @emits close
func (*DataProducer) SctpStreamParameters ¶
func (p *DataProducer) SctpStreamParameters() SctpStreamParameters
*
- SCTP stream parameters.
type DataProducerDump ¶
type DataProducerDump struct { Id string `json:"id,omitempty"` Type string `json:"type,omitempty"` SctpStreamParameters *SctpStreamParameters `json:"sctpStreamParameters,omitempty"` Label string `json:"label,omitempty"` Protocol string `json:"protocol,omitempty"` }
type DataProducerOptions ¶
type DataProducerOptions struct { /** * DataProducer id (just for Router.pipeToRouter() method). */ Id string `json:"id,omitempty"` /** * SCTP parameters defining how the endpoint is sending the data. * Just if messages are sent over SCTP. */ SctpStreamParameters *SctpStreamParameters `json:"sctpStreamParameters,omitempty"` /** * A label which can be used to distinguish this DataChannel from others. */ Label string `json:"label,omitempty"` /** * Name of the sub-protocol used by this DataChannel. */ Protocol string `json:"protocol,omitempty"` /** * Custom application data. */ AppData interface{} `json:"app_data,omitempty"` }
type DataProducerStat ¶
type DataProducerType ¶
type DataProducerType = DataConsumerType
*
- DataProducer type.
const ( DataProducerType_Sctp DataProducerType = DataConsumerType_Sctp DataProducerType_Direct = DataConsumerType_Direct )
type DirectTransport ¶
type DirectTransport struct { ITransport // contains filtered or unexported fields }
*
- DirectTransport
- @emits rtcp - (packet: []byte)
- @emits trace - (trace: TransportTraceEventData)
func (*DirectTransport) Connect ¶
func (transport *DirectTransport) Connect(TransportConnectOptions) error
*
- NO-OP method in DirectTransport. *
- @override
func (*DirectTransport) Observer ¶
func (transport *DirectTransport) Observer() IEventEmitter
*
- Observer. *
- @override
- @emits close
- @emits newdataproducer - (dataProducer: DataProducer)
- @emits newdataconsumer - (dataProducer: DataProducer)
- @emits trace - (trace: TransportTraceEventData)
func (*DirectTransport) SendRtcp ¶
func (transport *DirectTransport) SendRtcp(rtcpPacket []byte) error
*
- Send RTCP packet.
type DirectTransportOptions ¶
type DirectTransportOptions struct { /** * Maximum allowed size for direct messages sent from DataProducers. * Default 262144. */ MaxMessageSize uint32 `json:"maxMessageSize,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type DtlsFingerprint ¶
*
- The hash function algorithm (as defined in the "Hash function Textual Names"
- registry initially specified in RFC 4572 Section 8) and its corresponding
- certificate fingerprint value (in lowercase hex string as expressed utilizing
- the syntax of "fingerprint" in RFC 4572 Section 5).
type DtlsParameters ¶
type DtlsParameters struct { Role DtlsRole `json:"role,omitempty"` Fingerprints []DtlsFingerprint `json:"fingerprints"` }
type IEventEmitter ¶
type IEventEmitter = eventemitter.IEventEmitter
func NewEventEmitter ¶
func NewEventEmitter() IEventEmitter
type IRtpObserver ¶
type IRtpObserver interface { IEventEmitter Id() string Closed() bool Paused() bool Observer() IEventEmitter Close() Pause() Resume() AddProducer(producerId string) RemoveProducer(producerId string) // contains filtered or unexported methods }
type ITransport ¶
type ITransport interface { IEventEmitter Id() string Closed() bool AppData() interface{} Observer() IEventEmitter Close() Dump() (*TransportDump, error) GetStats() ([]*TransportStat, error) Connect(TransportConnectOptions) error SetMaxIncomingBitrate(bitrate int) error Produce(ProducerOptions) (*Producer, error) Consume(ConsumerOptions) (*Consumer, error) ProduceData(DataProducerOptions) (*DataProducer, error) ConsumeData(DataConsumerOptions) (*DataConsumer, error) EnableTraceEvent(types ...TransportTraceEventType) error // contains filtered or unexported methods }
type IceCandidate ¶
type IceCandidate struct { Foundation string `json:"foundation"` Priority uint32 `json:"priority"` Ip string `json:"ip"` Protocol TransportProtocol `json:"protocol"` Port uint32 `json:"port"` // alway "host" Type string `json:"type,omitempty"` // "passive" | undefined TcpType string `json:"tcpType,omitempty"` }
type IceParameters ¶
type InvalidStateError ¶
type InvalidStateError struct {
// contains filtered or unexported fields
}
InvalidStateError produced when calling a method in an invalid state.
func (InvalidStateError) Error ¶
func (e InvalidStateError) Error() string
type MediaKind ¶
type MediaKind string
*
- Media kind ('audio' or 'video').
const ( MediaKind_Audio MediaKind = "audio" MediaKind_Video = "video" )
type NumSctpStreams ¶
type NumSctpStreams struct { /** * Initially requested int of outgoing SCTP streams. */ OS uint16 `json:"OS"` /** * Maximum int of incoming SCTP streams. */ MIS uint16 `json:"MIS"` }
*
- Both OS and MIS are part of the SCTP INIT+ACK handshake. OS refers to the
- initial int of outgoing SCTP streams that the server side transport creates
- (to be used by DataConsumers), while MIS refers to the maximum int of
- incoming SCTP streams that the server side transport can receive (to be used
- by DataProducers). So, if the server side transport will just be used to
- create data producers (but no data consumers), OS can be low (~1). However,
- if data consumers are desired on the server side transport, OS must have a
- proper value and such a proper value depends on whether the remote endpoint
- supports SCTP_ADD_STREAMS extension or not. *
- libwebrtc (Chrome, Safari, etc) does not enable SCTP_ADD_STREAMS so, if data
- consumers are required, OS should be 1024 (the maximum int of DataChannels
- that libwebrtc enables). *
- Firefox does enable SCTP_ADD_STREAMS so, if data consumers are required, OS
- can be lower (16 for instance). The mediasoup transport will allocate and
- announce more outgoing SCTM streams when needed. *
- mediasoup-client provides specific per browser/version OS and MIS values via
- the device.sctpCapabilities getter.
type Option ¶
type Option func(w *WorkerSettings)
func WithCustomOption ¶
func WithDtlsCert ¶
func WithLogLevel ¶
func WithLogLevel(logLevel WorkerLogLevel) Option
func WithLogTags ¶
func WithLogTags(logTags []WorkerLogTag) Option
func WithRtcMaxPort ¶
func WithRtcMinPort ¶
type PayloadChannel ¶
type PayloadChannel struct { IEventEmitter // contains filtered or unexported fields }
func (*PayloadChannel) Close ¶
func (c *PayloadChannel) Close()
func (*PayloadChannel) Closed ¶
func (c *PayloadChannel) Closed() bool
func (*PayloadChannel) Notify ¶
func (c *PayloadChannel) Notify(event string, internal interface{}, data interface{}, payload []byte) (err error)
func (*PayloadChannel) Request ¶
func (c *PayloadChannel) Request(method string, internal interface{}, data interface{}, payload []byte) (rsp workerResponse)
type PipeToRouterOptions ¶
type PipeToRouterOptions struct { /** * The id of the Producer to consume. */ ProducerId string `json:"producerId,omitempty"` /** * The id of the DataProducer to consume. */ DataProducerId string `json:"dataProducerId,omitempty"` /** * Target Router instance. */ Router *Router `json:"router,omitempty"` /** * IP used in the PipeTransport pair. Default '127.0.0.1'. */ ListenIp TransportListenIp `json:"listenIp,omitempty"` /** * Create a SCTP association. Default false. */ EnableSctp bool `json:"enableSctp,omitempty"` /** * SCTP streams number. */ NumSctpStreams NumSctpStreams `json:"numSctpStreams,omitempty"` /** * Enable RTX and NACK for RTP retransmission. */ EnableRtx bool `json:"enableRtx,omitempty"` /** * Enable SRTP. */ EnableSrtp bool `json:"enableSrtp,omitempty"` }
type PipeToRouterResult ¶
type PipeToRouterResult struct { /** * The Consumer created in the current Router. */ PipeConsumer *Consumer /** * The Producer created in the target Router. */ PipeProducer *Producer /** * The DataConsumer created in the current Router. */ PipeDataConsumer *DataConsumer /** * The DataProducer created in the target Router. */ PipeDataProducer *DataProducer }
type PipeTransport ¶
type PipeTransport struct { ITransport // contains filtered or unexported fields }
*
- PipeTransport
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (*PipeTransport) Close ¶
func (transport *PipeTransport) Close()
*
- Close the PipeTransport. *
- @override
func (*PipeTransport) Connect ¶
func (transport *PipeTransport) Connect(options TransportConnectOptions) (err error)
*
- Provide the PlainTransport remote parameters. *
- @override
func (*PipeTransport) Consume ¶
func (transport *PipeTransport) Consume(options ConsumerOptions) (consumer *Consumer, err error)
*
- Create a pipe Consumer. *
- @override
func (*PipeTransport) Observer ¶
func (transport *PipeTransport) Observer() IEventEmitter
*
- Observer. *
- @override
- @emits close
- @emits newproducer - (producer: Producer)
- @emits newconsumer - (consumer: Consumer)
- @emits newdataproducer - (dataProducer: DataProducer)
- @emits newdataconsumer - (dataConsumer: DataConsumer)
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (PipeTransport) SctpParameters ¶
func (t PipeTransport) SctpParameters() SctpParameters
*
- SCTP parameters.
func (PipeTransport) SrtpParameters ¶
func (t PipeTransport) SrtpParameters() *SrtpParameters
*
- SRTP parameters.
type PipeTransportOptions ¶
type PipeTransportOptions struct { /** * Listening IP address. */ ListenIp TransportListenIp `json:"listenIp,omitempty"` /** * Create a SCTP association. Default false. */ EnableSctp bool `json:"enableSctp,omitempty"` /** * SCTP streams number. */ NumSctpStreams NumSctpStreams `json:"numSctpStreams,omitempty"` /** * Maximum allowed size for SCTP messages sent by DataProducers. * Default 268435456. */ MaxSctpMessageSize int `json:"maxSctpMessageSize,omitempty"` /** * Maximum SCTP send buffer used by DataConsumers. * Default 268435456. */ SctpSendBufferSize int `json:"sctpSendBufferSize,omitempty"` /** * Enable RTX and NACK for RTP retransmission. Useful if both Routers are * located in different hosts and there is packet lost in the link. For this * to work, both PipeTransports must enable this setting. Default false. */ EnableRtx bool `json:"enableRtx,omitempty"` /** * Enable SRTP. Useful to protect the RTP and RTCP traffic if both Routers * are located in different hosts. For this to work, connect() must be called * with remote SRTP parameters. Default false. */ EnableSrtp bool `json:"enableSrtp,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type PlainTransport ¶
type PlainTransport struct { ITransport // contains filtered or unexported fields }
*
- PlainTransport
- @emits tuple - (tuple: TransportTuple)
- @emits rtcptuple - (rtcpTuple: TransportTuple)
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (*PlainTransport) Close ¶
func (transport *PlainTransport) Close()
*
- Close the PlainTransport. *
- @override
func (*PlainTransport) Connect ¶
func (transport *PlainTransport) Connect(options TransportConnectOptions) (err error)
*
- Provide the PlainTransport remote parameters. *
- @override
func (*PlainTransport) Observer ¶
func (transport *PlainTransport) Observer() IEventEmitter
*
- Observer. *
- @override
- @emits close
- @emits newproducer - (producer: Producer)
- @emits newconsumer - (consumer: Consumer)
- @emits newdataproducer - (dataProducer: DataProducer)
- @emits newdataconsumer - (dataConsumer: DataConsumer)
- @emits tuple - (tuple: TransportTuple)
- @emits rtcptuple - (rtcpTuple: TransportTuple)
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (PlainTransport) RtcpTuple ¶
func (t PlainTransport) RtcpTuple() *TransportTuple
*
- Transport RTCP tuple.
func (PlainTransport) SctpParameters ¶
func (t PlainTransport) SctpParameters() SctpParameters
*
- SCTP parameters.
func (PlainTransport) SrtpParameters ¶
func (t PlainTransport) SrtpParameters() *SrtpParameters
*
- SRTP parameters.
type PlainTransportDump ¶
type PlainTransportDump struct { RtcpMux bool `json:"rtcpMux,omitempty"` Comedia bool `json:"comedia,omitempty"` Tuple *TransportTuple `json:"tuple,omitempty"` RtcpTuple *TransportTuple `json:"rtcpTuple,omitempty"` SrtpParameters *SrtpParameters `json:"srtpParameters,omitempty"` }
type PlainTransportOptions ¶
type PlainTransportOptions struct { /** * Listening IP address. */ ListenIp TransportListenIp `json:"listenIp,omitempty"` /** * Use RTCP-mux (RTP and RTCP in the same port). Default true. */ RtcpMux *bool `json:"rtcpMux,omitempty"` /** * Whether remote IP:port should be auto-detected based on first RTP/RTCP * packet received. If enabled, connect() method must not be called unless * SRTP is enabled. If so, it must be called with just remote SRTP parameters. * Default false. */ Comedia bool `json:"comedia,omitempty"` /** * Create a SCTP association. Default false. */ EnableSctp bool `json:"enableSctp,omitempty"` /** * SCTP streams number. */ NumSctpStreams NumSctpStreams `json:"numSctpStreams,omitempty"` /** * Maximum allowed size for SCTP messages sent by DataProducers. * Default 262144. */ MaxSctpMessageSize int `json:"maxSctpMessageSize,omitempty"` /** * Maximum SCTP send buffer used by DataConsumers. * Default 262144. */ SctpSendBufferSize int `json:"sctpSendBufferSize,omitempty"` /** * Enable SRTP. For this to work, connect() must be called * with remote SRTP parameters. Default false. */ EnableSrtp bool `json:"enableSrtp,omitempty"` /** * The SRTP crypto suite to be used if enableSrtp is set. Default * 'AES_CM_128_HMAC_SHA1_80'. */ SrtpCryptoSuite SrtpCryptoSuite `json:"srtpCryptoSuite,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type PlainTransportSpecificStat ¶
type PlainTransportSpecificStat struct { RtcpMux bool `json:"rtcp_mux"` Comedia bool `json:"comedia"` Tuple TransportTuple `json:"tuple"` RtcpTuple *TransportTuple `json:"rtcpTuple,omitempty"` }
type Producer ¶
type Producer struct { IEventEmitter // contains filtered or unexported fields }
*
- Producer
- @emits transportclose
- @emits score - (score: ProducerScore[])
- @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation)
- @emits trace - (trace: ProducerTraceEventData)
- @emits @close
func (*Producer) ConsumableRtpParameters ¶
func (producer *Producer) ConsumableRtpParameters() RtpParameters
Consumable RTP parameters.
func (*Producer) Dump ¶
func (producer *Producer) Dump() (dump ProducerDump, err error)
Dump Producer.
func (*Producer) EnableTraceEvent ¶
func (producer *Producer) EnableTraceEvent(types ...ProducerTraceEventType) error
*
- Enable 'trace' event.
func (*Producer) GetStats ¶
func (producer *Producer) GetStats() (stats []*ProducerStat, err error)
Get Producer stats.
func (*Producer) Observer ¶
func (producer *Producer) Observer() IEventEmitter
*
- Observer. *
- @emits close
- @emits pause
- @emits resume
- @emits score - (score: ProducerScore[])
- @emits videoorientationchange - (videoOrientation: ProducerVideoOrientation)
- @emits trace - (trace: ProducerTraceEventData)
func (*Producer) RtpParameters ¶
func (producer *Producer) RtpParameters() RtpParameters
RTP parameters.
type ProducerDump ¶
type ProducerDump struct { Id string `json:"id,omitempty"` Kind string `json:"kind,omitempty"` Type string `json:"type,omitempty"` RtpParameters RtpParameters `json:"rtpParameters,omitempty"` RtpMapping RtpMapping `json:"rtpMapping,omitempty"` Encodings RtpMappingEncoding `json:"encodings,omitempty"` RtpStreams []RtpStream `json:"rtpStreams,omitempty"` Paused bool `json:"paused,omitempty"` TraceEventTypes string `json:"traceEventTypes,omitempty"` }
type ProducerOptions ¶
type ProducerOptions struct { /** * Producer id (just for Router.pipeToRouter() method). */ Id string `json:"id,omitempty"` /** * Media kind ('audio' or 'video'). */ Kind MediaKind `json:"kind,omitempty"` /** * RTP parameters defining what the endpoint is sending. */ RtpParameters RtpParameters `json:"rtpParameters,omitempty"` /** * Whether the producer must start in paused mode. Default false. */ Paused bool `json:"paused,omitempty"` /** * Just for video. Time (in ms) before asking the sender for a new key frame * after having asked a previous one. Default 0. */ KeyFrameRequestDelay uint32 `json:"keyFrameRequestDelay,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type ProducerScore ¶
type ProducerStat ¶
type ProducerStat struct { // Common to all RtpStreams. Type string `json:"type,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Ssrc uint32 `json:"ssrc,omitempty"` RtxSsrc uint32 `json:"rtxSsrc,omitempty"` Rid string `json:"rid,omitempty"` Kind string `json:"kind,omitempty"` MimeType string `json:"mimeType,omitempty"` PacketsLost uint32 `json:"packetsLost,omitempty"` FractionLost uint32 `json:"fractionLost,omitempty"` PacketsDiscarded uint32 `json:"packetsDiscarded,omitempty"` PacketsRetransmitted uint32 `json:"packetsRetransmitted,omitempty"` PacketsRepaired uint32 `json:"packetsRepaired,omitempty"` NackCount uint32 `json:"nackCount,omitempty"` NackPacketCount uint32 `json:"nackPacketCount,omitempty"` PliCount uint32 `json:"pliCount,omitempty"` FirCount uint32 `json:"firCount,omitempty"` Score uint32 `json:"score,omitempty"` PacketCount int64 `json:"packetCount,omitempty"` ByteCount int64 `json:"byteCount,omitempty"` Bitrate uint32 `json:"bitrate,omitempty"` RoundTripTime float32 `json:"roundTripTime,omitempty"` RtxPacketsDiscarded uint32 `json:"rtxPacketsDiscarded,omitempty"` // RtpStreamRecv specific. Jitter uint32 `json:"jitter,omitempty"` BitrateByLayer H `json:"bitrateByLayer,omitempty"` }
type ProducerTraceEventData ¶
type ProducerTraceEventData struct { /** * Trace type. */ Type ProducerTraceEventType `json:"type,omitempty"` /** * Event timestamp. */ Timestamp uint32 `json:"timestamp,omitempty"` /** * Event direction, "in" | "out". */ Direction string `json:"direction,omitempty"` /** * Per type information. */ Info H `json:"info,omitempty"` }
*
- 'trace' event data.
type RecvRtpHeaderExtensions ¶
type Router ¶
type Router struct { IEventEmitter // contains filtered or unexported fields }
*
- Router
- @emits workerclose
- @emits @close
func (*Router) CanConsume ¶
func (router *Router) CanConsume(producerId string, rtpCapabilities RtpCapabilities) bool
*
- Check whether the given RTP capabilities can consume the given Producer.
func (*Router) CreateAudioLevelObserver ¶
func (router *Router) CreateAudioLevelObserver(options ...func(o *AudioLevelObserverOptions)) (rtpObserver IRtpObserver, err error)
*
- Create an AudioLevelObserver.
func (*Router) CreateDirectTransport ¶
func (router *Router) CreateDirectTransport(params ...DirectTransportOptions) (transport *DirectTransport, err error)
*
- Create a DirectTransport.
func (*Router) CreatePipeTransport ¶
func (router *Router) CreatePipeTransport(option PipeTransportOptions) (transport *PipeTransport, err error)
*
- Create a PipeTransport.
func (*Router) CreatePlainTransport ¶
func (router *Router) CreatePlainTransport(option PlainTransportOptions) (transport *PlainTransport, err error)
*
- Create a PlainTransport.
func (*Router) CreateWebRtcTransport ¶
func (router *Router) CreateWebRtcTransport(option WebRtcTransportOptions) (transport *WebRtcTransport, err error)
*
- Create a WebRtcTransport.
func (*Router) Observer ¶
func (router *Router) Observer() IEventEmitter
func (*Router) PipeToRouter ¶
func (router *Router) PipeToRouter(option PipeToRouterOptions) (result *PipeToRouterResult, err error)
*
- Pipes the given Producer or DataProducer into another Router in same host.
func (*Router) RtpCapabilities ¶
func (router *Router) RtpCapabilities() RtpCapabilities
RTC capabilities of the Router.
type RouterDump ¶
type RouterDump struct { Id string `json:"id,omitempty"` TransportIds []string `json:"transportIds,omitempty"` RtpObserverIds []string `json:"rtpObserverIds,omitempty"` MapProducerIdConsumerIds map[string][]string `json:"mapProducerIdConsumerIds,omitempty"` MapConsumerIdProducerId map[string]string `json:"mapConsumerIdProducerId,omitempty"` MapProducerIdObserverIds map[string][]string `json:"mapProducerIdObserverIds,omitempty"` MapDataProducerIdDataConsumerIds map[string][]string `json:"mapDataProducerIdDataConsumerIds,omitempty"` MapDataConsumerIdDataProducerId map[string]string `json:"mapDataConsumerIdDataProducerId,omitempty"` }
type RouterOptions ¶
type RouterOptions struct { /** * Router media codecs. */ MediaCodecs []*RtpCodecCapability `json:"mediaCodecs,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type RtcpFeedback ¶
type RtcpFeedback struct { /** * RTCP feedback type. */ Type string `json:"type"` /** * RTCP feedback parameter. */ Parameter string `json:"parameter,omitempty"` }
*
- Provides information on RTCP feedback messages for a specific codec. Those
- messages can be transport layer feedback messages or codec-specific feedback
- messages. The list of RTCP feedbacks supported by mediasoup is defined in the
- supportedRtpCapabilities.ts file.
type RtcpParameters ¶
type RtcpParameters struct { /** * The Canonical Name (CNAME) used by RTCP (e.g. in SDES messages). */ Cname string `json:"cname,omitempty"` /** * Whether reduced size RTCP RFC 5506 is configured (if true) or compound RTCP * as specified in RFC 3550 (if false). Default true. */ ReducedSize *bool `json:"reducedSize,omitempty"` /** * Whether RTCP-mux is used. Default true. */ Mux *bool `json:"mux,omitempty"` }
*
- Provides information on RTCP settings within the RTP parameters. *
- If no cname is given in a producer's RTP parameters, the mediasoup transport
- will choose a random one that will be used into RTCP SDES messages sent to
- all its associated consumers. *
- mediasoup assumes reducedSize to always be true.
type RtpCapabilities ¶
type RtpCapabilities struct { /** * Supported media and RTX codecs. */ Codecs []*RtpCodecCapability `json:"codecs,omitempty"` /** * Supported RTP header extensions. */ HeaderExtensions []*RtpHeaderExtension `json:"headerExtensions,omitempty"` /** * Supported FEC mechanisms. */ FecMechanisms []string `json:"fecMechanisms,omitempty"` }
*
- The RTP capabilities define what mediasoup or an endpoint can receive at
- media level.
func GetSupportedRtpCapabilities ¶
func GetSupportedRtpCapabilities() (rtpCapabilities RtpCapabilities)
type RtpCodecCapability ¶
type RtpCodecCapability struct { /** * Media kind. */ Kind MediaKind `json:"kind"` /** * The codec MIME media type/subtype (e.g. 'audio/opus', 'video/VP8'). */ MimeType string `json:"mimeType"` /** * The preferred RTP payload type. */ PreferredPayloadType byte `json:"preferredPayloadType,omitempty"` /** * Codec clock rate expressed in Hertz. */ ClockRate int `json:"clockRate"` /** * The int of channels supported (e.g. two for stereo). Just for audio. * Default 1. */ Channels int `json:"channels,omitempty"` /** * Codec specific parameters. Some parameters (such as 'packetization-mode' * and 'profile-level-id' in H264 or 'profile-id' in VP9) are critical for * codec matching. */ Parameters RtpCodecSpecificParameters `json:"parameters,omitempty"` /** * Transport layer and codec-specific feedback messages for this codec. */ RtcpFeedback []RtcpFeedback `json:"rtcpFeedback,omitempty"` }
*
- Provides information on the capabilities of a codec within the RTP
- capabilities. The list of media codecs supported by mediasoup and their
- settings is defined in the supportedRtpCapabilities.ts file. *
- Exactly one RtpCodecCapability will be present for each supported combination
- of parameters that requires a distinct value of preferredPayloadType. For
- example *
- - Multiple H264 codecs, each with their own distinct 'packetization-mode' and
- 'profile-level-id' values.
- - Multiple VP9 codecs, each with their own distinct 'profile-id' value. *
- RtpCodecCapability entries in the mediaCodecs array of RouterOptions do not
- require preferredPayloadType field (if unset, mediasoup will choose a random
- one). If given, make sure it's in the 96-127 range.
type RtpCodecParameters ¶
type RtpCodecParameters struct { /** * The codec MIME media type/subtype (e.g. 'audio/opus', 'video/VP8'). */ MimeType string `json:"mimeType"` /** * The value that goes in the RTP Payload Type Field. Must be unique. */ PayloadType byte `json:"payloadType"` /** * Codec clock rate expressed in Hertz. */ ClockRate int `json:"clockRate"` /** * The int of channels supported (e.g. two for stereo). Just for audio. * Default 1. */ Channels int `json:"channels,omitempty"` /** * Codec-specific parameters available for signaling. Some parameters (such * as 'packetization-mode' and 'profile-level-id' in H264 or 'profile-id' in * VP9) are critical for codec matching. */ Parameters RtpCodecSpecificParameters `json:"parameters,omitempty"` /** * Transport layer and codec-specific feedback messages for this codec. */ RtcpFeedback []RtcpFeedback `json:"rtcpFeedback,omitempty"` }
*
- Provides information on codec settings within the RTP parameters. The list
- of media codecs supported by mediasoup and their settings is defined in the
- supportedRtpCapabilities.ts file.
type RtpCodecSpecificParameters ¶
type RtpCodecSpecificParameters struct { h264.RtpParameter // used by h264 codec ProfileId string `json:"profile-id,omitempty"` // used by vp9 Apt byte `json:"apt,omitempty"` // used by rtx codec SpropStereo uint8 `json:"sprop-stereo,omitempty"` // used by audio, 1 or 0 Useinbandfec uint8 `json:"useinbandfec,omitempty"` // used by audio, 1 or 0 Usedtx uint8 `json:"usedtx,omitempty"` // used by audio, 1 or 0 Maxplaybackrate uint32 `json:"maxplaybackrate,omitempty"` XGoogleMinBitrate uint32 `json:"x-google-min-bitrate,omitempty"` XGoogleMaxBitrate uint32 `json:"x-google-max-bitrate,omitempty"` XGoogleStartBitrate uint32 `json:"x-google-start-bitrate,omitempty"` }
*
- RtpCodecSpecificParameters the Codec-specific parameters available for signaling. Some parameters (such
- as 'packetization-mode' and 'profile-level-id' in H264 or 'profile-id' in
- VP9) are critical for codec matching.
type RtpEncodingParameters ¶
type RtpEncodingParameters struct { /** * The media SSRC. */ Ssrc uint32 `json:"ssrc,omitempty"` /** * The RID RTP extension value. Must be unique. */ Rid string `json:"rid,omitempty"` /** * Codec payload type this encoding affects. If unset, first media codec is * chosen. */ CodecPayloadType byte `json:"codecPayloadType,omitempty"` /** * RTX stream information. It must contain a numeric ssrc field indicating * the RTX SSRC. */ Rtx *RtpEncodingRtx `json:"rtx,omitempty"` /** * It indicates whether discontinuous RTP transmission will be used. Useful * for audio (if the codec supports it) and for video screen sharing (when * static content is being transmitted, this option disables the RTP * inactivity checks in mediasoup). Default false. */ Dtx bool `json:"dtx,omitempty"` /** * int of spatial and temporal layers in the RTP stream (e.g. 'L1T3'). * See webrtc-svc. */ ScalabilityMode string `json:"scalabilityMode,omitempty"` /** * Others. */ ScaleResolutionDownBy int `json:"scaleResolutionDownBy,omitempty"` MaxBitrate int `json:"maxBitrate,omitempty"` }
*
- Provides information relating to an encoding, which represents a media RTP
- stream and its associated RTX stream (if any).
type RtpEncodingRtx ¶
type RtpEncodingRtx struct {
Ssrc uint32 `json:"ssrc"`
}
RtpEncodingRtx represents the associated RTX stream for RTP stream.
type RtpHeaderExtension ¶
type RtpHeaderExtension struct { /** * Media kind. If empty string, it's valid for all kinds. * Default any media kind. */ Kind MediaKind `json:"kind"` /* * The URI of the RTP header extension, as defined in RFC 5285. */ Uri string `json:"uri"` /** * The preferred numeric identifier that goes in the RTP packet. Must be * unique. */ PreferredId int `json:"preferredId"` /** * If true, it is preferred that the value in the header be encrypted as per * RFC 6904. Default false. */ PreferredEncrypt bool `json:"preferredEncrypt,omitempty"` /** * If 'sendrecv', mediasoup supports sending and receiving this RTP extension. * 'sendonly' means that mediasoup can send (but not receive) it. 'recvonly' * means that mediasoup can receive (but not send) it. */ Direction RtpHeaderExtensionDirection `json:"direction,omitempty"` }
*
- Provides information relating to supported header extensions. The list of
- RTP header extensions supported by mediasoup is defined in the
- supportedRtpCapabilities.ts file. *
- mediasoup does not currently support encrypted RTP header extensions. The
- direction field is just present in mediasoup RTP capabilities (retrieved via
- router.rtpCapabilities or mediasoup.getSupportedRtpCapabilities()). It's
- ignored if present in endpoints' RTP capabilities.
type RtpHeaderExtensionDirection ¶
type RtpHeaderExtensionDirection string
*
- Direction of RTP header extension.
type RtpHeaderExtensionParameters ¶
type RtpHeaderExtensionParameters struct { /** * The URI of the RTP header extension, as defined in RFC 5285. */ Uri string `json:"uri"` /** * The numeric identifier that goes in the RTP packet. Must be unique. */ Id int `json:"id"` /** * If true, the value in the header is encrypted as per RFC 6904. Default false. */ Encrypt bool `json:"encrypt,omitempty"` /** * Configuration parameters for the header extension. */ Parameters *RtpCodecSpecificParameters `json:"parameters,omitempty"` }
*
- Defines a RTP header extension within the RTP parameters. The list of RTP
- header extensions supported by mediasoup is defined in the
- supportedRtpCapabilities.ts file. *
- mediasoup does not currently support encrypted RTP header extensions and no
- parameters are currently considered.
type RtpListener ¶
type RtpMapping ¶
type RtpMapping struct { Codecs []RtpMappingCodec `json:"codecs,omitempty"` Encodings []RtpMappingEncoding `json:"encodings,omitempty"` }
type RtpMappingCodec ¶
type RtpMappingEncoding ¶
type RtpObserver ¶
type RtpObserver struct { IEventEmitter // contains filtered or unexported fields }
*
- RtpObserver
- @interface
- @emits routerclose
- @emits @close
func (*RtpObserver) AddProducer ¶
func (o *RtpObserver) AddProducer(producerId string)
*
- Add a Producer to the RtpObserver.
func (*RtpObserver) Closed ¶
func (o *RtpObserver) Closed() bool
*
- Whether the RtpObserver is closed.
func (*RtpObserver) Observer ¶
func (o *RtpObserver) Observer() IEventEmitter
*
- Observer. *
- @emits close
- @emits pause
- @emits resume
- @emits addproducer - (producer: Producer)
- @emits removeproducer - (producer: Producer)
func (*RtpObserver) Paused ¶
func (o *RtpObserver) Paused() bool
*
- Whether the RtpObserver is paused.
func (*RtpObserver) RemoveProducer ¶
func (o *RtpObserver) RemoveProducer(producerId string)
*
- Remove a Producer from the RtpObserver.
type RtpParameters ¶
type RtpParameters struct { /** * The MID RTP extension value as defined in the BUNDLE specification. */ Mid string `json:"mid,omitempty"` /** * Media and RTX codecs in use. */ Codecs []*RtpCodecParameters `json:"codecs"` /** * RTP header extensions in use. */ HeaderExtensions []RtpHeaderExtensionParameters `json:"headerExtensions,omitempty"` /** * Transmitted RTP streams and their settings. */ Encodings []RtpEncodingParameters `json:"encodings,omitempty"` /** * Parameters used for RTCP. */ Rtcp RtcpParameters `json:"rtcp,omitempty"` }
*
- The RTP send parameters describe a media stream received by mediasoup from
- an endpoint through its corresponding mediasoup Producer. These parameters
- may include a mid value that the mediasoup transport will use to match
- received RTP packets based on their MID RTP extension value. *
- mediasoup allows RTP send parameters with a single encoding and with multiple
- encodings (simulcast). In the latter case, each entry in the encodings array
- must include a ssrc field or a rid field (the RID RTP extension value). Check
- the Simulcast and SVC sections for more information. *
- The RTP receive parameters describe a media stream as sent by mediasoup to
- an endpoint through its corresponding mediasoup Consumer. The mid value is
- unset (mediasoup does not include the MID RTP extension into RTP packets
- being sent to endpoints). *
- There is a single entry in the encodings array (even if the corresponding
- producer uses simulcast). The consumer sends a single and continuous RTP
- stream to the endpoint and spatial/temporal layer selection is possible via
- consumer.setPreferredLayers(). *
- As an exception, previous bullet is not true when consuming a stream over a
- PipeTransport, in which all RTP streams from the associated producer are
- forwarded verbatim through the consumer. *
- The RTP receive parameters will always have their ssrc values randomly
- generated for all of its encodings (and optional rtx { ssrc XXXX } if the
- endpoint supports RTX), regardless of the original RTP send parameters in
- the associated producer. This applies even if the producer's encodings have
- rid set.
type RtpStream ¶
type RtpStream struct { Params RtpStreamParams `json:"params,omitempty"` Score uint8 `json:"score,omitempty"` RtxStream *RtpStream `json:"rtxStream,omitempty"` }
type RtpStreamParams ¶
type RtpStreamParams struct { EncodingIdx int `json:"encodingIdx,omitempty"` Ssrc uint32 `json:"ssrc,omitempty"` PayloadType uint8 `json:"payloadType,omitempty"` MimeType string `json:"mimeType,omitempty"` ClockRate uint32 `json:"clockRate,omitempty"` Rid string `json:"rid,omitempty"` RRid string `json:"rrid,omitempty"` Cname string `json:"cname,omitempty"` RtxSsrc uint32 `json:"rtxSsrc,omitempty"` RtxPayloadType uint8 `json:"rtxPayloadType,omitempty"` UseNack bool `json:"useNack,omitempty"` UsePli bool `json:"usePli,omitempty"` UseFir bool `json:"useFir,omitempty"` UseInBandFec bool `json:"useInBandFec,omitempty"` UseDtx bool `json:"useDtx,omitempty"` SpatialLayers uint8 `json:"spatialLayers,omitempty"` TemporalLayers uint8 `json:"temporalLayers,omitempty"` }
type ScalabilityMode ¶
type ScalabilityMode struct { SpatialLayers uint8 `json:"spatialLayers"` TemporalLayers uint8 `json:"temporalLayers"` Ksvc bool `json:"ksvc"` }
func ParseScalabilityMode ¶
func ParseScalabilityMode(scalabilityMode string) ScalabilityMode
type SctpCapabilities ¶
type SctpCapabilities struct {
NumStreams NumSctpStreams `json:"numStreams"`
}
type SctpListener ¶
type SctpParameters ¶
type SctpParameters struct { /** * Must always equal 5000. */ Port uint16 `json:"port"` /** * Initially requested int of outgoing SCTP streams. */ OS uint16 `json:"os"` /** * Maximum int of incoming SCTP streams. */ MIS uint16 `json:"mis"` /** * Maximum allowed size for SCTP messages. */ MaxMessageSize uint32 `json:"maxMessageSize"` /** * Set by worker. */ IsDataChannel bool `json:"isDataChannel,omitempty"` SctpBufferedAmount int `json:"sctpBufferedAmount,omitempty"` SendBufferSize int `json:"sendBufferSize,omitempty"` }
type SctpStreamParameters ¶
type SctpStreamParameters struct { /** * SCTP stream id. */ StreamId uint16 `json:"streamId"` /** * Whether data messages must be received in order. If true the messages will * be sent reliably. Default true. */ Ordered *bool `json:"ordered,omitempty"` /** * When ordered is false indicates the time (in milliseconds) after which a * SCTP packet will stop being retransmitted. */ MaxPacketLifeTime uint16 `json:"maxPacketLifeTime,omitempty"` /** * When ordered is false indicates the maximum number of times a packet will * be retransmitted. */ MaxRetransmits uint16 `json:"maxRetransmits,omitempty"` }
*
- SCTP stream parameters describe the reliability of a certain SCTP stream.
- If ordered is true then maxPacketLifeTime and maxRetransmits must be
- false.
- If ordered if false, only one of maxPacketLifeTime or maxRetransmits
- can be true.
type SimulcastConsumerDump ¶
type SimulcastConsumerDump struct { PreferredSpatialLayer int16 `json:"preferredSpatialLayer,omitempty"` TargetSpatialLayer int16 `json:"targetSpatialLayer,omitempty"` CurrentSpatialLayer int16 `json:"currentSpatialLayer,omitempty"` PreferredTemporalLayer int16 `json:"preferredTemporalLayer,omitempty"` TargetTemporalLayer int16 `json:"targetTemporalLayer,omitempty"` CurrentTemporalLayer int16 `json:"currentTemporalLayer,omitempty"` }
type SrtpCryptoSuite ¶
type SrtpCryptoSuite string
*
- SRTP crypto suite.
const ( AES_CM_128_HMAC_SHA1_80 SrtpCryptoSuite = "AES_CM_128_HMAC_SHA1_80" AES_CM_128_HMAC_SHA1_32 = "AES_CM_128_HMAC_SHA1_32" )
type SrtpParameters ¶
type SrtpParameters struct { /** * Encryption and authentication transforms to be used. */ CryptoSuite SrtpCryptoSuite `json:"cryptoSuite"` /** * SRTP keying material (master key and salt) in Base64. */ KeyBase64 string `json:"keyBase64"` }
*
- SRTP parameters.
type Transport ¶
type Transport struct { IEventEmitter // contains filtered or unexported fields }
*
- Transport
- @emits routerclose
- @emits @close
- @emits @newproducer - (producer: Producer)
- @emits @producerclose - (producer: Producer)
- @emits @newdataproducer - (dataProducer: DataProducer)
- @emits @dataproducerclose - (dataProducer: DataProducer)
func (*Transport) Connect ¶
func (transport *Transport) Connect(TransportConnectOptions) error
*
- Provide the Transport remote parameters.
func (*Transport) Consume ¶
func (transport *Transport) Consume(options ConsumerOptions) (consumer *Consumer, err error)
*
- Create a Consumer.
func (*Transport) ConsumeData ¶
func (transport *Transport) ConsumeData(options DataConsumerOptions) (dataConsumer *DataConsumer, err error)
*
- Create a DataConsumer.
func (*Transport) Dump ¶
func (transport *Transport) Dump() (data *TransportDump, err error)
Dump Transport.
func (*Transport) EnableTraceEvent ¶
func (transport *Transport) EnableTraceEvent(types ...TransportTraceEventType) error
*
- Enable 'trace' event.
func (*Transport) GetStats ¶
func (transport *Transport) GetStats() (stat []*TransportStat, err error)
Get Transport stats.
func (*Transport) Observer ¶
func (transport *Transport) Observer() IEventEmitter
*
- Observer. *
- @emits close
- @emits newproducer - (producer: Producer)
- @emits newconsumer - (producer: Producer)
- @emits newdataproducer - (dataProducer: DataProducer)
- @emits newdataconsumer - (dataProducer: DataProducer)
func (*Transport) Produce ¶
func (transport *Transport) Produce(options ProducerOptions) (producer *Producer, err error)
*
- Create a Producer.
func (*Transport) ProduceData ¶
func (transport *Transport) ProduceData(options DataProducerOptions) (dataProducer *DataProducer, err error)
*
- Create a DataProducer.
type TransportConnectOptions ¶
type TransportConnectOptions struct { // pipe and plain transport Ip string `json:"ip,omitempty"` Port uint16 `json:"port,omitempty"` SrtpParameters *SrtpParameters `json:"srtpParameters,omitempty"` // plain transport RtcpPort uint16 `json:"rtcpPort,omitempty"` // webrtc transport DtlsParameters *DtlsParameters `json:"dtlsParameters,omitempty"` }
type TransportDump ¶
type TransportDump struct { Id string `json:"id,omitempty"` Direct bool `json:"direct,omitempty"` ProducerIds []string `json:"producerIds,omitempty"` ConsumerIds []string `json:"consumerIds,omitempty"` MapSsrcConsumerId map[string]string `json:"mapSsrcConsumerId,omitempty"` MapRtxSsrcConsumerId map[string]string `json:"mapRtxSsrcConsumerId,omitempty"` DataProducerIds []string `json:"dataProducerIds,omitempty"` DataConsumerIds []string `json:"dataConsumerIds,omitempty"` RecvRtpHeaderExtensions *RecvRtpHeaderExtensions `json:"recvRtpHeaderExtensions,omitempty"` RtpListener *RtpListener `json:"rtpListener,omitempty"` SctpParameters SctpParameters `json:"SctpParameters,omitempty"` SctpState SctpState `json:"sctpState,omitempty"` SctpListener *SctpListener `json:"sctpListener,omitempty"` TraceEventTypes string `json:"traceEventTypes,omitempty"` // plain transport *PlainTransportDump // webrtc transport *WebRtcTransportDump }
type TransportListenIp ¶
type TransportProtocol ¶
type TransportProtocol string
*
- Transport protocol.
const ( TransportProtocol_Udp TransportProtocol = "udp" TransportProtocol_Tcp = "tcp" )
type TransportStat ¶
type TransportStat struct { // Common to all Transports. Type string `json:"type"` TransportId string `json:"transportId"` Timestamp int64 `json:"timestamp"` SctpState SctpState `json:"sctpState,omitempty"` BytesReceived int64 `json:"bytesReceived"` RecvBitrate int64 `json:"recvBitrate"` BytesSent int64 `json:"bytesSent"` SendBitrate int64 `json:"sendBitrate"` RtpBytesReceived int64 `json:"rtpBytesReceived"` RtpRecvBitrate int64 `json:"rtpRecvBitrate"` RtpBytesSent int64 `json:"rtpBytesSent"` RtpSendBitrate int64 `json:"rtpSendBitrate"` RtxBytesReceived int64 `json:"rtxBytesReceived"` RtxRecvBitrate int64 `json:"rtxRecvBitrate"` RtxBytesSent int64 `json:"rtxBytesSent"` RtxSendBitrate int64 `json:"rtxSendBitrate"` ProbationBytesSent int64 `json:"probationBytesSent"` ProbationSendBitrate int64 `json:"probationSendBitrate"` AvailableOutgoingBitrate int64 `json:"availableOutgoingBitrate,omitempty"` AvailableIncomingBitrate int64 `json:"availableIncomingBitrate,omitempty"` MaxIncomingBitrate int64 `json:"maxIncomingBitrate,omitempty"` *WebRtcTransportSpecificStat *PlainTransportSpecificStat // share tuple with pipe transport stat }
type TransportTraceEventData ¶
type TransportTraceEventData struct { /** * Trace type. */ Type TransportTraceEventType `json:"type,omitempty"` /** * Event timestamp. */ Timestamp int64 `json:"timestamp,omitempty"` /** * Event direction. */ Direction string `json:"direction,omitempty"` /** * Per type information. */ Info interface{} `json:"info,omitempty"` }
type TransportTraceEventType ¶
type TransportTraceEventType string
const ( TransportTraceEventType_Probation TransportTraceEventType = "probation" TransportTraceEventType_Bwe = "bwe" )
type TransportTuple ¶
type TransportType ¶
type TransportType string
type UnsupportedError ¶
type UnsupportedError struct {
// contains filtered or unexported fields
}
UnsupportedError indicating not support for something.
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string
type WebRtcTransport ¶
type WebRtcTransport struct { ITransport // contains filtered or unexported fields }
*
- WebRtcTransport
- @emits icestatechange - (iceState: IceState)
- @emits iceselectedtuplechange - (iceSelectedTuple: TransportTuple)
- @emits dtlsstatechange - (dtlsState: DtlsState)
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (*WebRtcTransport) Close ¶
func (transport *WebRtcTransport) Close()
*
- Close the WebRtcTransport. *
- @override
func (*WebRtcTransport) Connect ¶
func (transport *WebRtcTransport) Connect(options TransportConnectOptions) (err error)
*
- Provide the PlainTransport remote parameters. *
- @override
func (WebRtcTransport) DtlsParameters ¶
func (t WebRtcTransport) DtlsParameters() DtlsParameters
*
- DTLS parameters.
func (WebRtcTransport) DtlsRemoteCert ¶
func (t WebRtcTransport) DtlsRemoteCert() string
*
- Remote certificate in PEM format.
func (WebRtcTransport) IceCandidates ¶
func (t WebRtcTransport) IceCandidates() []IceCandidate
*
- ICE candidates.
func (WebRtcTransport) IceParameters ¶
func (t WebRtcTransport) IceParameters() IceParameters
*
- ICE parameters.
func (WebRtcTransport) IceSelectedTuple ¶
func (t WebRtcTransport) IceSelectedTuple() *TransportTuple
*
- ICE selected tuple.
func (*WebRtcTransport) Observer ¶
func (transport *WebRtcTransport) Observer() IEventEmitter
*
- Observer. *
- @override
- @emits close
- @emits newproducer - (producer: Producer)
- @emits newconsumer - (consumer: Consumer)
- @emits newdataproducer - (dataProducer: DataProducer)
- @emits newdataconsumer - (dataConsumer: DataConsumer)
- @emits icestatechange - (iceState: IceState)
- @emits iceselectedtuplechange - (iceSelectedTuple: TransportTuple)
- @emits dtlsstatechange - (dtlsState: DtlsState)
- @emits sctpstatechange - (sctpState: SctpState)
- @emits trace - (trace: TransportTraceEventData)
func (*WebRtcTransport) RestartIce ¶
func (transport *WebRtcTransport) RestartIce() (iceParameters IceParameters, err error)
*
- Restart ICE.
func (WebRtcTransport) SctpParameters ¶
func (t WebRtcTransport) SctpParameters() SctpParameters
*
- SCTP parameters.
func (WebRtcTransport) SctpState ¶
func (t WebRtcTransport) SctpState() SctpState
*
- SRTP parameters.
type WebRtcTransportDump ¶
type WebRtcTransportDump struct { IceRole string `json:"iceRole,omitempty"` IceParameters IceParameters `json:"iceParameters,omitempty"` IceCandidates []IceCandidate `json:"iceCandidates,omitempty"` IceState IceState `json:"iceState,omitempty"` IceSelectedTuple *TransportTuple `json:"iceSelectedTuple,omitempty"` DtlsParameters DtlsParameters `json:"dtlsParameters,omitempty"` DtlsState DtlsState `json:"dtlsState,omitempty"` DtlsRemoteCert string `json:"dtlsRemoteCert,omitempty"` }
type WebRtcTransportOptions ¶
type WebRtcTransportOptions struct { /** * Listening IP address or addresses in order of preference (first one is the * preferred one). */ ListenIps []TransportListenIp `json:"listenIps,omitempty"` /** * Listen in UDP. Default true. */ EnableUdp *bool `json:"enableUdp,omitempty"` /** * Listen in TCP. Default false. */ EnableTcp bool `json:"enableTcp,omitempty"` /** * Prefer UDP. Default false. */ PreferUdp bool `json:"preferUdp,omitempty"` /** * Prefer TCP. Default false. */ PreferTcp bool `json:"preferTcp,omitempty"` /** * Initial available outgoing bitrate (in bps). Default 600000. */ InitialAvailableOutgoingBitrate uint32 `json:"initialAvailableOutgoingBitrate,omitempty"` /** * Create a SCTP association. Default false. */ EnableSctp bool `json:"enableSctp,omitempty"` /** * SCTP streams uint32. */ NumSctpStreams NumSctpStreams `json:"numSctpStreams,omitempty"` /** * Maximum allowed size for SCTP messages sent by DataProducers. * Default 262144. */ MaxSctpMessageSize int `json:"maxSctpMessageSize,omitempty"` /** * Maximum SCTP send buffer used by DataConsumers. * Default 262144. */ SctpSendBufferSize int `json:"sctpSendBufferSize,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` }
type WebRtcTransportSpecificStat ¶
type WebRtcTransportSpecificStat struct { IceRole string `json:"iceRole"` IceState IceState `json:"iceState"` DtlsState DtlsRole `json:"dtlsState"` IceSelectedTuple *TransportTuple `json:"iceSelectedTuple,omitempty"` }
type Worker ¶
type Worker struct { IEventEmitter // contains filtered or unexported fields }
*
- Worker
- @emits died - (error: Error)
- @emits @success
- @emits @failure - (error: Error)
func (*Worker) CreateRouter ¶
func (w *Worker) CreateRouter(options RouterOptions, roomId string) (router *Router, err error)
CreateRouter creates a router.
func (*Worker) GetResourceUsage ¶
func (w *Worker) GetResourceUsage() (usage WorkerResourceUsage, err error)
*
- Get mediasoup-worker process resource usage.
func (*Worker) UpdateSettings ¶
func (w *Worker) UpdateSettings(settings WorkerUpdateableSettings) error
UpdateSettings Update settings.
type WorkerDump ¶
type WorkerLogLevel ¶
type WorkerLogLevel string
type WorkerLogTag ¶
type WorkerLogTag string
type WorkerResourceUsage ¶
type WorkerResourceUsage struct { /** * User CPU time used (in ms). */ RU_Utime int64 `json:"ru_utime"` /** * System CPU time used (in ms). */ RU_Stime int64 `json:"ru_stime"` /** * Maximum resident set size. */ RU_Maxrss int64 `json:"ru_maxrss"` /** * Integral shared memory size. */ RU_Ixrss int64 `json:"ru_ixrss"` /** * Integral unshared data size. */ RU_Idrss int64 `json:"ru_idrss"` /** * Integral unshared stack size. */ RU_Isrss int64 `json:"ru_isrss"` /** * Page reclaims (soft page faults). */ RU_Minflt int64 `json:"ru_minflt"` /** * Page faults (hard page faults). */ RU_Majflt int64 `json:"ru_majflt"` /** * Swaps. */ RU_Nswap int64 `json:"ru_nswap"` /** * Block input operations. */ RU_Inblock int64 `json:"ru_inblock"` /** * Block output operations. */ RU_Oublock int64 `json:"ru_oublock"` /** * IPC messages sent. */ RU_Msgsnd int64 `json:"ru_msgsnd"` /** * IPC messages received. */ RU_Msgrcv int64 `json:"ru_msgrcv"` /** * Signals received. */ RU_Nsignals int64 `json:"ru_nsignals"` /** * Voluntary context switches. */ RU_Nvcsw int64 `json:"ru_nvcsw"` /** * Involuntary context switches. */ RU_Nivcsw int64 `json:"ru_nivcsw"` }
*
- An object with the fields of the uv_rusage_t struct. *
- - http//docs.libuv.org/en/v1.x/misc.html#c.uv_rusage_t
- - https//linux.die.net/man/2/getrusage
type WorkerSettings ¶
type WorkerSettings struct { /** * Logging level for logs generated by the media worker subprocesses (check * the Debugging documentation). Valid values are 'debug', 'warn', 'error' and * 'none'. Default 'error'. */ LogLevel WorkerLogLevel `json:"logLevel,omitempty"` /** * Log tags for debugging. Check the meaning of each available tag in the * Debugging documentation. */ LogTags []WorkerLogTag `json:"logTags,omitempty"` /** * Minimun RTC port for ICE, DTLS, RTP, etc. Default 10000. */ RtcMinPort uint16 `json:"rtcMinPort,omitempty"` /** * Maximum RTC port for ICE, DTLS, RTP, etc. Default 59999. */ RtcMaxPort uint16 `json:"rtcMaxPort,omitempty"` /** * Path to the DTLS public certificate file in PEM format. If unset, a * certificate is dynamically created. */ DtlsCertificateFile string `json:"dtlsCertificateFile,omitempty"` /** * Path to the DTLS certificate private key file in PEM format. If unset, a * certificate is dynamically created. */ DtlsPrivateKeyFile string `json:"dtlsPrivateKeyFile,omitempty"` /** * Custom application data. */ AppData interface{} `json:"appData,omitempty"` /** * Custom options. */ CustomOptions map[string]interface{} }
func (WorkerSettings) Args ¶
func (w WorkerSettings) Args() []string
func (WorkerSettings) Option ¶
func (w WorkerSettings) Option() Option
type WorkerUpdateableSettings ¶
type WorkerUpdateableSettings struct { /** * Logging level for logs generated by the media worker subprocesses (check * the Debugging documentation). Valid values are 'debug', 'warn', 'error' and * 'none'. Default 'error'. */ LogLevel WorkerLogLevel `json:"logLevel,omitempty"` /** * Log tags for debugging. Check the meaning of each available tag in the * Debugging documentation. */ LogTags []WorkerLogTag `json:"logTags,omitempty"` }
Source Files ¶
- audio_level_observer.go
- channel.go
- consumer.go
- data_consumer.go
- data_producer.go
- direct_transport.go
- dump_types.go
- errors.go
- event_emitter.go
- internal.go
- logger.go
- ortc.go
- payload_channel.go
- pipe_transport.go
- plain_transport.go
- producer.go
- router.go
- rtp_observer.go
- rtp_parameters.go
- scalability_modes.go
- sctp_parameters.go
- srtp_parameters.go
- supported_rtp_capabilities.go
- transport.go
- utils.go
- webrtc_transport.go
- worker.go
- worker_settings.go