File: nalunittype.go

package info (click to toggle)
golang-github-pion-webrtc.v3 3.1.56-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,392 kB
  • sloc: javascript: 595; sh: 28; makefile: 5
file content (68 lines) | stat: -rw-r--r-- 2,580 bytes parent folder | download | duplicates (2)
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 h264reader

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
}