mediamtx/internal/stream/stream_media.go
Alessandro Ros 0d46cf3f74
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
rename stream decode errors into processing errors (#4370)
Stream errors include both errors from decoding RTP packets into
frames, and errors from encoding frames into RTP packets. "processing
errors" is more fit.
2025-03-26 15:14:08 +01:00

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
}