Files
overlord/Overlord-Client/cmd/agent/h264util/annexb_test.go
T

23 lines
510 B
Go
Raw Normal View History

2026-07-30 00:22:08 -05:00
package h264util
import "testing"
func TestInspectAnnexB(t *testing.T) {
data := []byte{
0, 0, 0, 1, 0x67, 1, 2, 3,
0, 0, 1, 0x68, 4, 5,
0, 0, 0, 1, 0x65, 6, 7,
}
got := InspectAnnexB(data)
if !got.HasSPS || !got.HasPPS || !got.HasIDR {
t.Fatalf("InspectAnnexB() = %+v", got)
}
}
func TestInspectAnnexBRejectsDeltaFrame(t *testing.T) {
got := InspectAnnexB([]byte{0, 0, 1, 0x41, 1, 2, 3})
if got.HasSPS || got.HasPPS || got.HasIDR {
t.Fatalf("delta frame was misclassified: %+v", got)
}
}