forked from External/mediamtx
fix webrtc/VP9 tests (#3443)
This commit is contained in:
parent
44953c8e05
commit
427fea30ed
2 changed files with 16 additions and 12 deletions
|
|
@ -26,10 +26,6 @@ import (
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
func uint16Ptr(v uint16) *uint16 {
|
|
||||||
return &v
|
|
||||||
}
|
|
||||||
|
|
||||||
func checkClose(t *testing.T, closeFunc func() error) {
|
func checkClose(t *testing.T, closeFunc func() error) {
|
||||||
require.NoError(t, closeFunc())
|
require.NoError(t, closeFunc())
|
||||||
}
|
}
|
||||||
|
|
@ -357,8 +353,7 @@ func TestServerRead(t *testing.T) {
|
||||||
},
|
},
|
||||||
[]byte{0, 2, 1, 2},
|
[]byte{0, 2, 1, 2},
|
||||||
},
|
},
|
||||||
// TODO: check why this doesn't work
|
{
|
||||||
/*{
|
|
||||||
"vp9",
|
"vp9",
|
||||||
[]*description.Media{{
|
[]*description.Media{{
|
||||||
Type: description.MediaTypeVideo,
|
Type: description.MediaTypeVideo,
|
||||||
|
|
@ -367,10 +362,14 @@ func TestServerRead(t *testing.T) {
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
&unit.VP9{
|
&unit.VP9{
|
||||||
Frame: []byte{1, 2},
|
Frame: []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
|
||||||
|
},
|
||||||
|
[]byte{
|
||||||
|
0x8f, 0xa0, 0xfd, 0x18, 0x07, 0x80, 0x03, 0x24,
|
||||||
|
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
|
||||||
|
0x77, 0xf0, 0x32, 0x34,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
[]byte{1, 2},
|
|
||||||
},*/
|
|
||||||
{
|
{
|
||||||
"vp8",
|
"vp8",
|
||||||
[]*description.Media{{
|
[]*description.Media{{
|
||||||
|
|
|
||||||
|
|
@ -35,10 +35,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var errNoSupportedCodecs = errors.New(
|
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
|
type setupStreamFunc func(*webrtc.OutgoingTrack) error
|
||||||
|
|
||||||
|
func uint16Ptr(v uint16) *uint16 {
|
||||||
|
return &v
|
||||||
|
}
|
||||||
|
|
||||||
func findVideoTrack(
|
func findVideoTrack(
|
||||||
stream *stream.Stream,
|
stream *stream.Stream,
|
||||||
writer *asyncwriter.Writer,
|
writer *asyncwriter.Writer,
|
||||||
|
|
@ -89,6 +93,7 @@ func findVideoTrack(
|
||||||
encoder := &rtpvp9.Encoder{
|
encoder := &rtpvp9.Encoder{
|
||||||
PayloadType: 96,
|
PayloadType: 96,
|
||||||
PayloadMaxSize: webrtcPayloadMaxSize,
|
PayloadMaxSize: webrtcPayloadMaxSize,
|
||||||
|
InitialPictureID: uint16Ptr(8445),
|
||||||
}
|
}
|
||||||
err := encoder.Init()
|
err := encoder.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue