@@ -5,7 +5,6 @@ package ivfwriter
5
5
6
6
import (
7
7
"bytes"
8
- "encoding/binary"
9
8
"io"
10
9
"testing"
11
10
@@ -258,25 +257,19 @@ func TestIVFWriter_AV1(t *testing.T) {
258
257
t .Run ("Unfragmented" , func (t * testing.T ) {
259
258
buffer := & bytes.Buffer {}
260
259
261
- expectedTimestamp := uint32 (3653407706 )
260
+ writer , err := NewWith (buffer , WithCodec (mimeTypeAV1 ))
261
+ assert .NoError (t , err )
262
262
263
- // the timestamp is an uint32, 4 bytes from offset 36
264
- expectedPayloadWithTimestamp := []byte {
263
+ assert .NoError (t , writer .WriteRTP (& rtp.Packet {Payload : []byte {0x00 , 0x01 , 0xFF }}))
264
+ assert .NoError (t , writer .Close ())
265
+ assert .Equal (t , buffer .Bytes (), []byte {
265
266
0x44 , 0x4b , 0x49 , 0x46 , 0x0 , 0x0 , 0x20 ,
266
267
0x0 , 0x41 , 0x56 , 0x30 , 0x31 , 0x80 , 0x2 ,
267
268
0xe0 , 0x1 , 0x1e , 0x0 , 0x0 , 0x0 , 0x1 , 0x0 ,
268
269
0x0 , 0x0 , 0x84 , 0x3 , 0x0 , 0x0 , 0x0 , 0x0 ,
269
- 0x0 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0xda , 0x93 , 0xc2 ,
270
- 0xd9 , 0x0 , 0x0 , 0x0 , 0x0 , 0xff ,
271
- }
272
-
273
- writer , err := NewWith (buffer , WithCodec (mimeTypeAV1 ))
274
- assert .NoError (t , err )
275
-
276
- assert .NoError (t , writer .WriteRTP (& rtp.Packet {Header : rtp.Header {Timestamp : expectedTimestamp }, Payload : []byte {0x00 , 0x01 , 0xFF }}))
277
- assert .NoError (t , writer .Close ())
278
- assert .Equal (t , expectedPayloadWithTimestamp , buffer .Bytes ())
279
- assert .Equal (t , expectedTimestamp , binary .LittleEndian .Uint32 (expectedPayloadWithTimestamp [36 :40 ]))
270
+ 0x0 , 0x0 , 0x1 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0x0 ,
271
+ 0x0 , 0x0 , 0x0 , 0x0 , 0x0 , 0xff ,
272
+ })
280
273
})
281
274
282
275
t .Run ("Fragmented" , func (t * testing.T ) {
0 commit comments