mirror of
https://github.com/aler9/gortsplib
synced 2025-09-27 03:25:52 +08:00
switch to v5 (#890)
* switch from v4 to v5 * remove deprecated entities * remove "2" suffix from entities * rename TransportProtocol into Protocol
This commit is contained in:
@@ -4,10 +4,10 @@ package main
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/bluenviron/gortsplib/v4"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/base"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/description"
|
||||
"github.com/bluenviron/gortsplib/v4/pkg/format"
|
||||
"github.com/bluenviron/gortsplib/v5"
|
||||
"github.com/bluenviron/gortsplib/v5/pkg/base"
|
||||
"github.com/bluenviron/gortsplib/v5/pkg/description"
|
||||
"github.com/bluenviron/gortsplib/v5/pkg/format"
|
||||
"github.com/pion/rtp"
|
||||
)
|
||||
|
||||
@@ -29,7 +29,7 @@ func main() {
|
||||
}
|
||||
|
||||
// connect to the server
|
||||
err = c.Start2()
|
||||
err = c.Start()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -50,7 +50,7 @@ func main() {
|
||||
// called when a RTP packet arrives
|
||||
c.OnPacketRTPAny(func(medi *description.Media, _ format.Format, pkt *rtp.Packet) {
|
||||
// get the PTS (presentation timestamp) of the packet
|
||||
pts, ptsAvailable := c.PacketPTS2(medi, pkt)
|
||||
pts, ptsAvailable := c.PacketPTS(medi, pkt)
|
||||
log.Printf("PTS: available=%v, value=%v\n", ptsAvailable, pts)
|
||||
|
||||
// get the NTP (absolute timestamp) of the packet
|
||||
|
Reference in New Issue
Block a user