|
|
|
|
@ -7,11 +7,14 @@ import (
@@ -7,11 +7,14 @@ import (
|
|
|
|
|
|
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/description" |
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/format" |
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/liberrors" |
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/rtplossdetector" |
|
|
|
|
"github.com/bluenviron/gortsplib/v4/pkg/rtptime" |
|
|
|
|
"github.com/pion/rtcp" |
|
|
|
|
"github.com/pion/rtp" |
|
|
|
|
"github.com/pion/webrtc/v3" |
|
|
|
|
|
|
|
|
|
"github.com/bluenviron/mediamtx/internal/logger" |
|
|
|
|
"github.com/bluenviron/mediamtx/internal/stream" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
@ -112,7 +115,8 @@ func (webrtcTrackWrapper) PTSEqualsDTS(*rtp.Packet) bool {
@@ -112,7 +115,8 @@ func (webrtcTrackWrapper) PTSEqualsDTS(*rtp.Packet) bool {
|
|
|
|
|
return true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func (t *webRTCIncomingTrack) start(stream *stream.Stream, timeDecoder *rtptime.GlobalDecoder) { |
|
|
|
|
func (t *webRTCIncomingTrack) start(stream *stream.Stream, timeDecoder *rtptime.GlobalDecoder, log logger.Writer) { |
|
|
|
|
lossDetector := rtplossdetector.New() |
|
|
|
|
trackWrapper := &webrtcTrackWrapper{clockRate: int(t.track.Codec().ClockRate)} |
|
|
|
|
|
|
|
|
|
go func() { |
|
|
|
|
@ -122,6 +126,12 @@ func (t *webRTCIncomingTrack) start(stream *stream.Stream, timeDecoder *rtptime.
@@ -122,6 +126,12 @@ func (t *webRTCIncomingTrack) start(stream *stream.Stream, timeDecoder *rtptime.
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lost := lossDetector.Process(pkt) |
|
|
|
|
if lost != 0 { |
|
|
|
|
log.Log(logger.Warn, (liberrors.ErrClientRTPPacketsLost{Lost: lost}).Error()) |
|
|
|
|
// do not return
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// sometimes Chrome sends empty RTP packets. ignore them.
|
|
|
|
|
if len(pkt.Payload) == 0 { |
|
|
|
|
continue |
|
|
|
|
|