mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
rtsp: route original absolute timestamp of packets (#1300) (#4378)
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
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
This commit is contained in:
parent
4bbedc4955
commit
8b98c02903
10 changed files with 168 additions and 60 deletions
|
|
@ -7,12 +7,12 @@ import (
|
|||
"github.com/bluenviron/gortsplib/v4"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/base"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/headers"
|
||||
"github.com/pion/rtp"
|
||||
|
||||
"github.com/bluenviron/mediamtx/internal/conf"
|
||||
"github.com/bluenviron/mediamtx/internal/counterdumper"
|
||||
"github.com/bluenviron/mediamtx/internal/defs"
|
||||
"github.com/bluenviron/mediamtx/internal/logger"
|
||||
"github.com/bluenviron/mediamtx/internal/protocols/rtsp"
|
||||
"github.com/bluenviron/mediamtx/internal/protocols/tls"
|
||||
)
|
||||
|
||||
|
|
@ -168,21 +168,12 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error {
|
|||
|
||||
defer s.Parent.SetNotReady(defs.PathSourceStaticSetNotReadyReq{})
|
||||
|
||||
for _, medi := range desc.Medias {
|
||||
for _, forma := range medi.Formats {
|
||||
cmedi := medi
|
||||
cforma := forma
|
||||
|
||||
c.OnPacketRTP(cmedi, cforma, func(pkt *rtp.Packet) {
|
||||
pts, ok := c.PacketPTS2(cmedi, pkt)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
res.Stream.WriteRTPPacket(cmedi, cforma, pkt, time.Now(), pts)
|
||||
})
|
||||
}
|
||||
}
|
||||
rtsp.ToStream(
|
||||
c,
|
||||
desc.Medias,
|
||||
params.Conf,
|
||||
res.Stream,
|
||||
s)
|
||||
|
||||
rangeHeader, err := createRangeHeader(params.Conf)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue