Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove av1 obu parsing #265

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 0 additions & 47 deletions codecs/av1/frame/av1.go

This file was deleted.

86 changes: 0 additions & 86 deletions codecs/av1/frame/av1_test.go

This file was deleted.

35 changes: 0 additions & 35 deletions codecs/av1_packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ type AV1Packet struct {

// N: MUST be set to 1 if the packet is the first packet of a coded video sequence, and MUST be set to 0 otherwise.
N bool

// Each AV1 RTP Packet is a collection of OBU Elements. Each OBU Element may be a full OBU, or just a fragment of one.
// AV1Frame provides the tools to construct a collection of OBUs from a collection of OBU Elements
OBUElements [][]byte
}

// Unmarshal parses the passed byte slice and stores the result in the AV1Packet this method is called upon
Expand All @@ -153,36 +149,5 @@ func (p *AV1Packet) Unmarshal(payload []byte) ([]byte, error) {
return nil, errIsKeyframeAndFragment
}

currentIndex := uint(1)
p.OBUElements = [][]byte{}

var (
obuElementLength, bytesRead uint
err error
)
for i := 1; ; i++ {
if currentIndex == uint(len(payload)) {
break
}

// If W bit is set the last OBU Element will have no length header
if byte(i) == p.W {
bytesRead = 0
obuElementLength = uint(len(payload)) - currentIndex
} else {
obuElementLength, bytesRead, err = obu.ReadLeb128(payload[currentIndex:])
if err != nil {
return nil, err
}
}

currentIndex += bytesRead
if uint(len(payload)) < currentIndex+obuElementLength {
return nil, errShortPacket
}
p.OBUElements = append(p.OBUElements, payload[currentIndex:currentIndex+obuElementLength])
currentIndex += obuElementLength
}

return payload[1:], nil
}
8 changes: 0 additions & 8 deletions codecs/av1_packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"errors"
"reflect"
"testing"

"github.com/pion/rtp/codecs/av1/obu"
)

func TestAV1_Marshal(t *testing.T) {
Expand Down Expand Up @@ -89,8 +87,6 @@ func TestAV1_Unmarshal_Error(t *testing.T) {
{errNilPacket, nil},
{errShortPacket, []byte{0x00}},
{errIsKeyframeAndFragment, []byte{byte(0b10001000), 0x00}},
{obu.ErrFailedToReadLEB128, []byte{byte(0b10000000), 0xFF, 0xFF}},
{errShortPacket, []byte{byte(0b10000000), 0xFF, 0x0F, 0x00, 0x00}},
} {
test := test
av1Pkt := &AV1Packet{}
Expand Down Expand Up @@ -284,10 +280,6 @@ func TestAV1_Unmarshal(t *testing.T) {
Y: true,
W: 2,
N: true,
OBUElements: [][]byte{
av1Payload[2:14],
av1Payload[14:],
},
}) {
t.Fatal("AV1 Unmarshal didn't store the expected results in the packet")
}
Expand Down
17 changes: 0 additions & 17 deletions pkg/frame/av1.go

This file was deleted.

Loading