Adds NALs types logger

This commit is contained in:
Alexey Khit
2022-10-05 15:33:51 +03:00
parent 6f9976c806
commit 2ec618334a
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -60,3 +60,18 @@ func SplitAVC(data []byte) [][]byte {
}
return nals
}
func Types(data []byte) []byte {
var types []byte
for {
types = append(types, NALUType(data))
size := 4 + int(binary.BigEndian.Uint32(data))
if size < len(data) {
data = data[size:]
} else {
break
}
}
return types
}