@@ -27,14 +27,28 @@ package gots
27
27
import "errors"
28
28
29
29
var (
30
+ // ErrBadSyncByte is returned when the sync byte (first byte of packet) is not valid
31
+ ErrBadSyncByte = errors .New ("sync byte is not valid" )
30
32
// ErrUnrecognizedEbpType is returned if the EBP cannot be parsed
31
33
ErrUnrecognizedEbpType = errors .New ("unrecognized EBP" )
32
34
// ErrNoEBP is returned when an attempt is made to extract an EBP from a packet that does not contain one
33
35
ErrNoEBP = errors .New ("packet does not contain EBP" )
34
36
// ErrInvalidPacketLength denotes an packet length that is not packet.PacketSize bytes in length
35
37
ErrInvalidPacketLength = errors .New ("invalid packet length" )
38
+ // ErrInvalidTSCFlag is returned when the transport scrambling control bit is set to the bit reserved by the specification
39
+ ErrInvalidTSCFlag = errors .New ("invalid transport scrambling control option." )
40
+ // ErrInvalidAFCFlag is returned when the adaptation field control bits dont have a payload or an adaptation field
41
+ ErrInvalidAFCFlag = errors .New ("invalid packet length" )
36
42
// ErrNoPayload denotes that the attempted operation is not valid on a packet with no payload
37
43
ErrNoPayload = errors .New ("packet does not contain payload" )
44
+ // ErrNoAdaptationField is returned if the adaptation field cannot be accessed or does not exist.
45
+ ErrNoAdaptationField = errors .New ("packet does not contain an adaptation field" )
46
+ // ErrAdaptationFieldTooLarge is returned if the adaptation field is too large to be put in a packet.
47
+ ErrAdaptationFieldTooLarge = errors .New ("adaptation field is too large and cannot shrink" )
48
+ // ErrAdaptationFieldCannotGrow is returned if the adaptation field will overwrite the payload if it grows.
49
+ ErrAdaptationFieldCannotGrow = errors .New ("adaptation field cannot cannot grow beyond its allocated length" )
50
+ // ErrAdaptationFieldZeroLength is returned if the adaptation field is empty and only used for stuffing.
51
+ ErrAdaptationFieldZeroLength = errors .New ("adaptation field is empty" )
38
52
// ErrNoPrivateTransportData is returned when an attempt is made to access private transport data when none exists
39
53
ErrNoPrivateTransportData = errors .New ("adaptation field has no private transport data" )
40
54
// ErrNoSplicePoint is returned when an attempt to access a splice countdown and no splice point exists
43
57
ErrNoPCR = errors .New ("adaptation field has no Program Clock Reference" )
44
58
// ErrNoOPCR is returned when an attempt is made to access an adaptation field OPCR that does not exist
45
59
ErrNoOPCR = errors .New ("adaptation field has no Original Program Clock Reference" )
60
+ // ErrNoAdaptationFieldExtension is returned when an attempt is made to access adaptation field's
61
+ // Adaptation Field Extension when it does not exist
62
+ ErrNoAdaptationFieldExtension = errors .New ("adaptation field has no Adaptation Field Extension" )
46
63
// ErrPATNotFound is returned when expected PAT packet is not found when
47
64
// reading TS packets.
48
65
ErrPATNotFound = errors .New ("No PAT was found while reading TS" )
0 commit comments