From 222e61e616b63a51f6ba29a4ffba675ae4ce47cc Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Mon, 17 May 2021 15:29:37 +0200 Subject: [PATCH] Add Z bit to VP9 unmarshaller This was added in draft-ietf-payload-vp9-10. --- codecs/vp9_packet.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/codecs/vp9_packet.go b/codecs/vp9_packet.go index 0396554..9d05340 100644 --- a/codecs/vp9_packet.go +++ b/codecs/vp9_packet.go @@ -25,12 +25,12 @@ const ( // Payload fragments an VP9 packet across one or more byte arrays func (p *VP9Payloader) Payload(mtu int, payload []byte) [][]byte { /* - * https://www.ietf.org/id/draft-ietf-payload-vp9-10.txt + * https://www.ietf.org/id/draft-ietf-payload-vp9-13.txt * * Flexible mode (F=1) * 0 1 2 3 4 5 6 7 * +-+-+-+-+-+-+-+-+ - * |I|P|L|F|B|E|V|-| (REQUIRED) + * |I|P|L|F|B|E|V|Z| (REQUIRED) * +-+-+-+-+-+-+-+-+ * I: |M| PICTURE ID | (REQUIRED) * +-+-+-+-+-+-+-+-+ @@ -47,7 +47,7 @@ func (p *VP9Payloader) Payload(mtu int, payload []byte) [][]byte { * Non-flexible mode (F=0) * 0 1 2 3 4 5 6 7 * +-+-+-+-+-+-+-+-+ - * |I|P|L|F|B|E|V|-| (REQUIRED) + * |I|P|L|F|B|E|V|Z| (REQUIRED) * +-+-+-+-+-+-+-+-+ * I: |M| PICTURE ID | (RECOMMENDED) * +-+-+-+-+-+-+-+-+ @@ -121,6 +121,7 @@ type VP9Packet struct { B bool // Start of a frame E bool // End of a frame V bool // Scalability structure (SS) data present + Z bool // Not a reference frame for upper spatial layers // Recommended headers PictureID uint16 // 7 or 16 bits, picture ID @@ -171,6 +172,7 @@ func (p *VP9Packet) Unmarshal(packet []byte) ([]byte, error) { p.B = packet[0]&0x08 != 0 p.E = packet[0]&0x04 != 0 p.V = packet[0]&0x02 != 0 + p.Z = packet[0]&0x01 != 0 pos := 1 var err error