mediasoup_go_worker

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 12 Imported by: 0

README

mediasoup-go-worker

Pure Go implementation of Mediasoup worker.

Motivation is to provide a mediasoup APIs implementation of Pion WebRTC libraries.

Go Report Card

Features
Mediasoup worker Protocol
version stream protocol type support
< 3.9.0 netstring
>= 3.9.0 native
>= 3.10.5 native
message wrapper without JSON
cpu: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
BenchmarkNetNative_WriteBuffer-12       39985699                29.73 ns/op            4 B/op          1 allocs/op
BenchmarkNetNative_ReadBuffer-12          269317              4487 ns/op              12 B/op          3 allocs/op
BenchmarkNetStrings_WriteBuffer-12       7167288               152.0 ns/op           355 B/op          3 allocs/op
BenchmarkNetStrings_ReadBuffer-12       13219642                88.37 ns/op            4 B/op          1 allocs/op

goos: darwin
goarch: arm64
BenchmarkNetNative_WriteBuffer-10       53218015                22.44 ns/op            4 B/op          1 allocs/op
BenchmarkNetNative_ReadBuffer-10          415128              2861 ns/op              12 B/op          3 allocs/op
BenchmarkNetStrings_WriteBuffer-10      11343592               105.2 ns/op           355 B/op          3 allocs/op
BenchmarkNetStrings_ReadBuffer-10       15113563                77.66 ns/op            4 B/op          1 allocs/op
Mediasoup worker API
worker API
method support
worker.close
worker.dump
worker.getResourceUsage
worker.updateSettings WIP
worker.createRouter
router API
method support
router.close
router.dump
router.createWebRtcTransport
router.createPlainTransport WIP
router.createPipeTransport
router.createDirectTransport
router.createActiveSpeakerObserver
router.createAudioLevelObserver
transport API
method support
transport.close
transport.dump
transport.getStats
transport.connect
transport.setMaxIncomingBitrate WIP
transport.setMaxOutgoingBitrate WIP
transport.produce
transport.consume
transport.produceData
transport.consumeData
producer API
method support
producer.close
producer.dump
producer.getStats
producer.pause WIP
producer.resume WIP
producer.enableTraceEvent WIP
consumer API
method support
consumer.close
consumer.dump
consumer.getStats
consumer.pause WIP
consumer.resume WIP
consumer.setPreferredLayers WIP
consumer.setPriority WIP
consumer.requestKeyFrame WIP
consumer.enableTraceEvent WIP
dataProducer API
method support
dataProducer.close WIP
dataProducer.dump WIP
dataProducer.getStats WIP
dataConsumer API
method support
dataConsumer.close WIP
dataConsumer.dump WIP
dataConsumer.getStats WIP
dataConsumer.getBufferedAmount WIP
dataConsumer.setBufferedAmountLowThreshold WIP
rtpObserver API
method support
rtpObserver.close WIP
rtpObserver.pause WIP
rtpObserver.resume WIP
rtpObserver.addProducer WIP
rtpObserver.removeProducer WIP
Codec
video
codec support
H264
audio
codec support
opus
Usage
mediasoup-worker

build out executable file.

$ make

Replace the worker Binary in mediasoup project.

References

mediasoup

mediasoup-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWorker added in v1.0.6

func InitWorker(mediasoupVersion string) (*workerchannel.Channel, *workerchannel.PayloadChannel, error)

func NewWorkerBase added in v1.0.6

func NewWorkerBase(pid int) *workerBase

Types

type MediasoupWorker

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

func NewMediasoupWorker

func NewMediasoupWorker(channel *workerchannel.Channel, payloadChannel *workerchannel.PayloadChannel) *MediasoupWorker

func (MediasoupWorker) FillJson

func (w MediasoupWorker) FillJson() json.RawMessage

func (MediasoupWorker) FillJsonResourceUsage

func (w MediasoupWorker) FillJsonResourceUsage() json.RawMessage

func (MediasoupWorker) GetPid

func (w MediasoupWorker) GetPid() int

func (MediasoupWorker) OnChannelRequest

func (w MediasoupWorker) OnChannelRequest(request workerchannel.RequestData) (response workerchannel.ResponseData)

func (*MediasoupWorker) Start

func (w *MediasoupWorker) Start() int

func (MediasoupWorker) Stop

func (w MediasoupWorker) Stop()

type SimpleWorker

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

func NewSimpleWorker

func NewSimpleWorker() *SimpleWorker

func (SimpleWorker) FillJson

func (w SimpleWorker) FillJson() json.RawMessage

func (SimpleWorker) FillJsonResourceUsage

func (w SimpleWorker) FillJsonResourceUsage() json.RawMessage

func (SimpleWorker) GetPid

func (w SimpleWorker) GetPid() int

func (SimpleWorker) OnChannelRequest

func (w SimpleWorker) OnChannelRequest(request workerchannel.RequestData) (response workerchannel.ResponseData)

func (*SimpleWorker) Start

func (w *SimpleWorker) Start() int

func (SimpleWorker) Stop

func (w SimpleWorker) Stop()

Jump to

Keyboard shortcuts

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