-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnnalunittype.go
68 lines (64 loc) · 2.52 KB
/
nnalunittype.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package h264benchmark
import "strconv"
// NalUnitType is the type of a NAL
type NalUnitType uint8
// Enums for NalUnitTypes
const (
NalUnitTypeUnspecified NalUnitType = 0 // Unspecified
NalUnitTypeCodedSliceNonIdr NalUnitType = 1 // Coded slice of a non-IDR picture
NalUnitTypeCodedSliceDataPartitionA NalUnitType = 2 // Coded slice data partition A
NalUnitTypeCodedSliceDataPartitionB NalUnitType = 3 // Coded slice data partition B
NalUnitTypeCodedSliceDataPartitionC NalUnitType = 4 // Coded slice data partition C
NalUnitTypeCodedSliceIdr NalUnitType = 5 // Coded slice of an IDR picture
NalUnitTypeSEI NalUnitType = 6 // Supplemental enhancement information (SEI)
NalUnitTypeSPS NalUnitType = 7 // Sequence parameter set
NalUnitTypePPS NalUnitType = 8 // Picture parameter set
NalUnitTypeAUD NalUnitType = 9 // Access unit delimiter
NalUnitTypeEndOfSequence NalUnitType = 10 // End of sequence
NalUnitTypeEndOfStream NalUnitType = 11 // End of stream
NalUnitTypeFiller NalUnitType = 12 // Filler data
NalUnitTypeSpsExt NalUnitType = 13 // Sequence parameter set extension
NalUnitTypeCodedSliceAux NalUnitType = 19 // Coded slice of an auxiliary coded picture without partitioning
// 14..18 // Reserved
// 20..23 // Reserved
// 24..31 // Unspecified
)
func (n *NalUnitType) String() string {
var str string
switch *n {
case NalUnitTypeUnspecified:
str = "Unspecified"
case NalUnitTypeCodedSliceNonIdr:
str = "CodedSliceNonIdr"
case NalUnitTypeCodedSliceDataPartitionA:
str = "CodedSliceDataPartitionA"
case NalUnitTypeCodedSliceDataPartitionB:
str = "CodedSliceDataPartitionB"
case NalUnitTypeCodedSliceDataPartitionC:
str = "CodedSliceDataPartitionC"
case NalUnitTypeCodedSliceIdr:
str = "CodedSliceIdr"
case NalUnitTypeSEI:
str = "SEI"
case NalUnitTypeSPS:
str = "SPS"
case NalUnitTypePPS:
str = "PPS"
case NalUnitTypeAUD:
str = "AUD"
case NalUnitTypeEndOfSequence:
str = "EndOfSequence"
case NalUnitTypeEndOfStream:
str = "EndOfStream"
case NalUnitTypeFiller:
str = "Filler"
case NalUnitTypeSpsExt:
str = "SpsExt"
case NalUnitTypeCodedSliceAux:
str = "NalUnitTypeCodedSliceAux"
default:
str = "Unknown"
}
str = str + "(" + strconv.FormatInt(int64(*n), 10) + ")"
return str
}