mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-10 18:40:03 +08:00
Refactored frame/packet side data + added regions of interest to frame side data
This commit is contained in:
23
skip_samples_test.go
Normal file
23
skip_samples_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package astiav
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSkipSamples(t *testing.T) {
|
||||
_, err := newSkipSamplesFromBytes([]byte("123456789"))
|
||||
require.Error(t, err)
|
||||
ss1 := &SkipSamples{
|
||||
ReasonEnd: 1,
|
||||
ReasonStart: 2,
|
||||
SkipEnd: 3,
|
||||
SkipStart: 4,
|
||||
}
|
||||
b1 := ss1.bytes()
|
||||
require.Equal(t, []byte{0x4, 0x0, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0, 0x2, 0x1}, b1)
|
||||
ss2, err := newSkipSamplesFromBytes(b1)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, ss1, ss2)
|
||||
}
|
Reference in New Issue
Block a user