golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
388 B
17 lines
388 B
package h264 |
|
|
|
import ( |
|
"testing" |
|
"time" |
|
|
|
"github.com/stretchr/testify/require" |
|
) |
|
|
|
func TestDTSEstimator(t *testing.T) { |
|
est := NewDTSEstimator() |
|
est.Feed(2 * time.Second) |
|
est.Feed(2*time.Second - 200*time.Millisecond) |
|
est.Feed(2*time.Second - 400*time.Millisecond) |
|
dts := est.Feed(2*time.Second + 200*time.Millisecond) |
|
require.Equal(t, 2*time.Second-400*time.Millisecond, dts) |
|
}
|
|
|