mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
fix VP9 decoding on iOS (https://github.com/bluenviron/mediamtx/issues/3060) (#553)
This commit is contained in:
2
go.mod
2
go.mod
@@ -6,7 +6,7 @@ require (
|
|||||||
github.com/bluenviron/mediacommon v1.9.3
|
github.com/bluenviron/mediacommon v1.9.3
|
||||||
github.com/google/uuid v1.6.0
|
github.com/google/uuid v1.6.0
|
||||||
github.com/pion/rtcp v1.2.14
|
github.com/pion/rtcp v1.2.14
|
||||||
github.com/pion/rtp v1.8.6
|
github.com/pion/rtp v1.8.7-0.20240429002300-bc5124c9d0d0
|
||||||
github.com/pion/sdp/v3 v3.0.9
|
github.com/pion/sdp/v3 v3.0.9
|
||||||
github.com/stretchr/testify v1.9.0
|
github.com/stretchr/testify v1.9.0
|
||||||
golang.org/x/net v0.24.0
|
golang.org/x/net v0.24.0
|
||||||
|
4
go.sum
4
go.sum
@@ -13,8 +13,8 @@ github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
|
|||||||
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
|
github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
|
||||||
github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE=
|
github.com/pion/rtcp v1.2.14 h1:KCkGV3vJ+4DAJmvP0vaQShsb0xkRfWkO540Gy102KyE=
|
||||||
github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4=
|
github.com/pion/rtcp v1.2.14/go.mod h1:sn6qjxvnwyAkkPzPULIbVqSKI5Dv54Rv7VG0kNxh9L4=
|
||||||
github.com/pion/rtp v1.8.6 h1:MTmn/b0aWWsAzux2AmP8WGllusBVw4NPYPVFFd7jUPw=
|
github.com/pion/rtp v1.8.7-0.20240429002300-bc5124c9d0d0 h1:yPAphilskTN7U3URvBVxlVr0PzheMeWqo7PaOqh//Hg=
|
||||||
github.com/pion/rtp v1.8.6/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
|
github.com/pion/rtp v1.8.7-0.20240429002300-bc5124c9d0d0/go.mod h1:pBGHaFt/yW7bf1jjWAoUjpSNoDnw98KTMg+jWWvziqU=
|
||||||
github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=
|
github.com/pion/sdp/v3 v3.0.9 h1:pX++dCHoHUwq43kuwf3PyJfHlwIj4hXA7Vrifiq0IJY=
|
||||||
github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
|
github.com/pion/sdp/v3 v3.0.9/go.mod h1:B5xmvENq5IXJimIO4zfp6LAe1fD9N+kFv+V/1lOdz8M=
|
||||||
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
|
github.com/pkg/profile v1.4.0/go.mod h1:NWz/XGvpEW1FyYQ7fCx4dqYBLlfTcE+A9FLAkNKqjFE=
|
||||||
|
@@ -39,7 +39,7 @@ var cases = []struct {
|
|||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
"single",
|
"single",
|
||||||
[]byte{0x01, 0x02, 0x03, 0x04},
|
[]byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
|
||||||
[]*rtp.Packet{
|
[]*rtp.Packet{
|
||||||
{
|
{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
@@ -49,13 +49,20 @@ var cases = []struct {
|
|||||||
SequenceNumber: 17645,
|
SequenceNumber: 17645,
|
||||||
SSRC: 0x9dbb7812,
|
SSRC: 0x9dbb7812,
|
||||||
},
|
},
|
||||||
Payload: []byte{0x9c, 0xb5, 0xaf, 0x01, 0x02, 0x03, 0x04},
|
Payload: []byte{
|
||||||
|
0x8f, 0xb5, 0xaf, 0x18, 0x07, 0x80, 0x03, 0x24,
|
||||||
|
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
|
||||||
|
0x77, 0xf0, 0x32, 0x34,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fragmented",
|
"fragmented",
|
||||||
bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 4096/4),
|
mergeBytes(
|
||||||
|
[]byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34},
|
||||||
|
bytes.Repeat([]byte{1, 2, 3, 4}, 4096/4),
|
||||||
|
),
|
||||||
[]*rtp.Packet{
|
[]*rtp.Packet{
|
||||||
{
|
{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
@@ -65,7 +72,13 @@ var cases = []struct {
|
|||||||
SequenceNumber: 17645,
|
SequenceNumber: 17645,
|
||||||
SSRC: 0x9dbb7812,
|
SSRC: 0x9dbb7812,
|
||||||
},
|
},
|
||||||
Payload: mergeBytes([]byte{0x98, 0xb5, 0xaf}, bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 364), []byte{0x01}),
|
Payload: mergeBytes(
|
||||||
|
[]byte{
|
||||||
|
0x8b, 0xb5, 0xaf, 0x18, 0x07, 0x80, 0x03, 0x24,
|
||||||
|
0x01, 0x14, 0x01, 0x82, 0x49, 0x83, 0x42, 0x00,
|
||||||
|
0x77, 0xf0, 0x32, 0x34,
|
||||||
|
},
|
||||||
|
bytes.Repeat([]byte{1, 2, 3, 4}, 360)),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
@@ -75,8 +88,9 @@ var cases = []struct {
|
|||||||
SequenceNumber: 17646,
|
SequenceNumber: 17646,
|
||||||
SSRC: 0x9dbb7812,
|
SSRC: 0x9dbb7812,
|
||||||
},
|
},
|
||||||
Payload: mergeBytes([]byte{0x90, 0xb5, 0xaf, 0x02, 0x03, 0x04},
|
Payload: mergeBytes(
|
||||||
bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 363), []byte{0x01, 0x02}),
|
[]byte{0x81, 0xb5, 0xaf},
|
||||||
|
bytes.Repeat([]byte{1, 2, 3, 4}, 364), []byte{1}),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: rtp.Header{
|
Header: rtp.Header{
|
||||||
@@ -86,7 +100,9 @@ var cases = []struct {
|
|||||||
SequenceNumber: 17647,
|
SequenceNumber: 17647,
|
||||||
SSRC: 0x9dbb7812,
|
SSRC: 0x9dbb7812,
|
||||||
},
|
},
|
||||||
Payload: mergeBytes([]byte{0x94, 0xb5, 0xaf, 0x03, 0x04}, bytes.Repeat([]byte{0x01, 0x02, 0x03, 0x04}, 295)),
|
Payload: mergeBytes(
|
||||||
|
[]byte{0x85, 0xb5, 0xaf, 2, 3, 4},
|
||||||
|
bytes.Repeat([]byte{1, 2, 3, 4}, 299)),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -22,7 +22,7 @@ func TestVP9DecEncoder(t *testing.T) {
|
|||||||
enc, err := format.CreateEncoder()
|
enc, err := format.CreateEncoder()
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04})
|
pkts, err := enc.Encode([]byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34})
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
|
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
|
||||||
|
|
||||||
@@ -31,5 +31,5 @@ func TestVP9DecEncoder(t *testing.T) {
|
|||||||
|
|
||||||
byts, err := dec.Decode(pkts[0])
|
byts, err := dec.Decode(pkts[0])
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
require.Equal(t, []byte{0x82, 0x49, 0x83, 0x42, 0x0, 0x77, 0xf0, 0x32, 0x34}, byts)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user