dtsestimator_test.go 597 B

12345678910111213141516171819202122232425262728
  1. package common
  2. import (
  3. "testing"
  4. )
  5. func TestDts(t *testing.T) {
  6. t.Run(t.Name(), func(t *testing.T) {
  7. dtsg := NewDTSEstimator()
  8. var pts uint32 = 0xFFFFFFFF - 5
  9. for i := 0; i < 10; i++ {
  10. dts := dtsg.Feed(pts)
  11. pts++
  12. t.Logf("dts=%d", dts)
  13. }
  14. })
  15. }
  16. func Test往前跳(t *testing.T) {
  17. t.Run(t.Name(), func(t *testing.T) {
  18. data := []uint32{64175310, 64178910, 64182510, 64186110, 64189710, 64340910, 64344510, 64348110, 64351710, 64355310, 64358910}
  19. dtsg := NewDTSEstimator()
  20. for _, pts := range data {
  21. dts := dtsg.Feed(pts)
  22. t.Logf("pts=%d,dts=%d", pts, dts)
  23. }
  24. })
  25. }