mirror of
https://github.com/bluenviron/mediamtx
synced 2024-12-12 01:35:02 +00:00
41 lines
773 B
Go
41 lines
773 B
Go
package formatprocessor
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/bluenviron/gortsplib/v3/pkg/formats"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestAV1KeyFrameWarning(t *testing.T) {
|
|
forma := &formats.AV1{
|
|
PayloadTyp: 96,
|
|
}
|
|
|
|
w := &testLogWriter{recv: make(chan string, 1)}
|
|
p, err := New(1472, forma, true, w)
|
|
require.NoError(t, err)
|
|
|
|
ntp := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
|
|
err = p.Process(&UnitAV1{
|
|
OBUs: [][]byte{
|
|
{0x01},
|
|
},
|
|
NTP: ntp,
|
|
}, false)
|
|
require.NoError(t, err)
|
|
|
|
ntp = ntp.Add(30 * time.Second)
|
|
err = p.Process(&UnitAV1{
|
|
OBUs: [][]byte{
|
|
{0x01},
|
|
},
|
|
NTP: ntp,
|
|
}, false)
|
|
require.NoError(t, err)
|
|
|
|
logl := <-w.recv
|
|
require.Equal(t, "no AV1 key frames received in 10s, stream can't be decoded", logl)
|
|
}
|