mirror of
https://github.com/bluenviron/mediamtx.git
synced 2026-01-25 12:59:15 -08:00
Some checks failed
code_lint / golangci_lint (push) Has been cancelled
code_lint / mod_tidy (push) Has been cancelled
code_lint / api_docs (push) Has been cancelled
code_test / test_64 (push) Has been cancelled
code_test / test_32 (push) Has been cancelled
code_test / test_highlevel (push) Has been cancelled
Stream errors include both errors from decoding RTP packets into frames, and errors from encoding frames into RTP packets. "processing errors" is more fit.
36 lines
831 B
Go
36 lines
831 B
Go
package stream
|
|
|
|
import (
|
|
"github.com/bluenviron/gortsplib/v4/pkg/description"
|
|
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
|
"github.com/bluenviron/mediamtx/internal/counterdumper"
|
|
)
|
|
|
|
type streamMedia struct {
|
|
udpMaxPayloadSize int
|
|
media *description.Media
|
|
generateRTPPackets bool
|
|
processingErrors *counterdumper.CounterDumper
|
|
|
|
formats map[format.Format]*streamFormat
|
|
}
|
|
|
|
func (sm *streamMedia) initialize() error {
|
|
sm.formats = make(map[format.Format]*streamFormat)
|
|
|
|
for _, forma := range sm.media.Formats {
|
|
sf := &streamFormat{
|
|
udpMaxPayloadSize: sm.udpMaxPayloadSize,
|
|
format: forma,
|
|
generateRTPPackets: sm.generateRTPPackets,
|
|
processingErrors: sm.processingErrors,
|
|
}
|
|
err := sf.initialize()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
sm.formats[forma] = sf
|
|
}
|
|
|
|
return nil
|
|
}
|