-
Notifications
You must be signed in to change notification settings - Fork 173
/
nalutype.go
69 lines (64 loc) · 2.73 KB
/
nalutype.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
69
package h264
import (
"fmt"
)
// NALUType is the type of a NALU.
type NALUType uint8
// NALU types.
const (
NALUTypeNonIDR NALUType = 1
NALUTypeDataPartitionA NALUType = 2
NALUTypeDataPartitionB NALUType = 3
NALUTypeDataPartitionC NALUType = 4
NALUTypeIDR NALUType = 5
NALUTypeSEI NALUType = 6
NALUTypeSPS NALUType = 7
NALUTypePPS NALUType = 8
NALUTypeAccessUnitDelimiter NALUType = 9
NALUTypeEndOfSequence NALUType = 10
NALUTypeEndOfStream NALUType = 11
NALUTypeFillerData NALUType = 12
NALUTypeSPSExtension NALUType = 13
NALUTypePrefix NALUType = 14
NALUTypeSubsetSPS NALUType = 15
NALUTypeReserved16 NALUType = 16
NALUTypeReserved17 NALUType = 17
NALUTypeReserved18 NALUType = 18
NALUTypeSliceLayerWithoutPartitioning NALUType = 19
NALUTypeSliceExtension NALUType = 20
NALUTypeSliceExtensionDepth NALUType = 21
NALUTypeReserved22 NALUType = 22
NALUTypeReserved23 NALUType = 23
)
var naluTypelabels = map[NALUType]string{
NALUTypeNonIDR: "NonIDR",
NALUTypeDataPartitionA: "DataPartitionA",
NALUTypeDataPartitionB: "DataPartitionB",
NALUTypeDataPartitionC: "DataPartitionC",
NALUTypeIDR: "IDR",
NALUTypeSEI: "SEI",
NALUTypeSPS: "SPS",
NALUTypePPS: "PPS",
NALUTypeAccessUnitDelimiter: "AccessUnitDelimiter",
NALUTypeEndOfSequence: "EndOfSequence",
NALUTypeEndOfStream: "EndOfStream",
NALUTypeFillerData: "FillerData",
NALUTypeSPSExtension: "SPSExtension",
NALUTypePrefix: "Prefix",
NALUTypeSubsetSPS: "SubsetSPS",
NALUTypeReserved16: "Reserved16",
NALUTypeReserved17: "Reserved17",
NALUTypeReserved18: "Reserved18",
NALUTypeSliceLayerWithoutPartitioning: "SliceLayerWithoutPartitioning",
NALUTypeSliceExtension: "SliceExtension",
NALUTypeSliceExtensionDepth: "SliceExtensionDepth",
NALUTypeReserved22: "Reserved22",
NALUTypeReserved23: "Reserved23",
}
// String implements fmt.Stringer.
func (nt NALUType) String() string {
if l, ok := naluTypelabels[nt]; ok {
return l
}
return fmt.Sprintf("unknown (%d)", nt)
}