mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-30 15:02:00 -08:00
accept durations expressed as days (i.e. '1d') (#4094)
This commit is contained in:
parent
8cbbbc05c3
commit
b49acb1e00
53 changed files with 378 additions and 257 deletions
|
|
@ -72,8 +72,8 @@ type PeerConnection struct {
|
|||
ICEServers []webrtc.ICEServer
|
||||
ICEUDPMux ice.UDPMux
|
||||
ICETCPMux ice.TCPMux
|
||||
HandshakeTimeout conf.StringDuration
|
||||
TrackGatherTimeout conf.StringDuration
|
||||
HandshakeTimeout conf.Duration
|
||||
TrackGatherTimeout conf.Duration
|
||||
LocalRandomUDP bool
|
||||
IPsFromInterfaces bool
|
||||
IPsFromInterfacesList []string
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import (
|
|||
|
||||
func TestPeerConnectionCloseImmediately(t *testing.T) {
|
||||
pc := &PeerConnection{
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: false,
|
||||
|
|
@ -37,8 +37,8 @@ func TestPeerConnectionCloseImmediately(t *testing.T) {
|
|||
// test that an audio codec is present regardless of the fact that an audio track is.
|
||||
func TestPeerConnectionFallbackCodecs(t *testing.T) {
|
||||
pc1 := &PeerConnection{
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: false,
|
||||
|
|
@ -49,8 +49,8 @@ func TestPeerConnectionFallbackCodecs(t *testing.T) {
|
|||
defer pc1.Close()
|
||||
|
||||
pc2 := &PeerConnection{
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: true,
|
||||
|
|
|
|||
|
|
@ -336,8 +336,8 @@ func TestToStream(t *testing.T) {
|
|||
for _, ca := range toFromStreamCases {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
pc1 := &PeerConnection{
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: true,
|
||||
|
|
@ -351,8 +351,8 @@ func TestToStream(t *testing.T) {
|
|||
defer pc1.Close()
|
||||
|
||||
pc2 := &PeerConnection{
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: false,
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ func (c *Client) Publish(
|
|||
|
||||
c.pc = &webrtc.PeerConnection{
|
||||
ICEServers: iceServers,
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: true,
|
||||
|
|
@ -122,8 +122,8 @@ func (c *Client) Read(ctx context.Context) ([]*webrtc.IncomingTrack, error) {
|
|||
|
||||
c.pc = &webrtc.PeerConnection{
|
||||
ICEServers: iceServers,
|
||||
HandshakeTimeout: conf.StringDuration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.StringDuration(2 * time.Second),
|
||||
HandshakeTimeout: conf.Duration(10 * time.Second),
|
||||
TrackGatherTimeout: conf.Duration(2 * time.Second),
|
||||
LocalRandomUDP: true,
|
||||
IPsFromInterfaces: true,
|
||||
Publish: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue