1
0
Fork 0
forked from External/mediamtx

fix webrtc/VP9 tests (#3443)

This commit is contained in:
Alessandro Ros 2024-06-09 23:18:47 +02:00 committed by GitHub
parent 44953c8e05
commit 427fea30ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 12 deletions

View file

@ -26,10 +26,6 @@ import (
"github.com/stretchr/testify/require"
)
func uint16Ptr(v uint16) *uint16 {
return &v
}
func checkClose(t *testing.T, closeFunc func() error) {
require.NoError(t, closeFunc())
}
@ -357,8 +353,7 @@ func TestServerRead(t *testing.T) {
},
[]byte{0, 2, 1, 2},
},
// TODO: check why this doesn't work
/*{
{
"vp9",
[]*description.Media{{
Type: description.MediaTypeVideo,
@ -367,10 +362,14 @@ func TestServerRead(t *testing.T) {
}},
}},
&unit.VP9{
Frame: []byte{1, 2},
Frame: []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
},
[]byte{1, 2},
},*/
[]byte{
0x8f, 0xa0, 0xfd, 0x18, 0x07, 0x80, 0x03, 0x24,
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
0x77, 0xf0, 0x32, 0x34,
},
},
{
"vp8",
[]*description.Media{{

View file

@ -35,10 +35,14 @@ import (
)
var errNoSupportedCodecs = errors.New(
"the stream doesn't contain any supported codec, which are currently AV1, VP9, VP8, H264, Opus, G722, G711")
"the stream doesn't contain any supported codec, which are currently AV1, VP9, VP8, H264, Opus, G722, G711, LPCM")
type setupStreamFunc func(*webrtc.OutgoingTrack) error
func uint16Ptr(v uint16) *uint16 {
return &v
}
func findVideoTrack(
stream *stream.Stream,
writer *asyncwriter.Writer,
@ -87,8 +91,9 @@ func findVideoTrack(
if vp9Format != nil {
return vp9Format, func(track *webrtc.OutgoingTrack) error {
encoder := &rtpvp9.Encoder{
PayloadType: 96,
PayloadMaxSize: webrtcPayloadMaxSize,
PayloadType: 96,
PayloadMaxSize: webrtcPayloadMaxSize,
InitialPictureID: uint16Ptr(8445),
}
err := encoder.Init()
if err != nil {