stream/mts/psi/psi.go: cleaned up and comment consts

This commit is contained in:
saxon 2019-02-07 15:48:35 +10:30
parent b4393e5136
commit 330fdc6aa8
1 changed files with 17 additions and 21 deletions

View File

@ -32,11 +32,10 @@ import (
"github.com/Comcast/gots/psi"
)
const (
PacketSize = 184 // packet size of a psi.
)
// PacketSize of psi (without mpegts header)
const PacketSize = 184
// Lengths of section definitions
// Lengths of section definitions.
const (
ESSDDefLen = 5
DescDefLen = 2
@ -46,15 +45,14 @@ const (
PSIDefLen = 3
)
// Table Type IDs
// Table Type IDs.
const (
patID = 0x00
pmtID = 0x02
)
const TotalSyntaxSecLen = 180
// Consts relating to time description
// TODO: remove this, we don't do metadata like this anymore.
const (
TimeDescTag = 234
TimeTagIndx = 13
@ -63,6 +61,7 @@ const (
)
// Consts relating to location description
// TODO: remove this, we don't do metadata like this anymore.
const (
LocationDescTag = 235
LocationTagIndx = 23
@ -70,35 +69,32 @@ const (
LocationDataSize = 32 // bytes
)
// Other misc consts
// crc hassh Size
const crcSize = 4
// Consts relating to syntax section.
const (
TotalSyntaxSecLen = 180
SyntaxSecLenIdx1 = 2
SyntaxSecLenIdx2 = 3
SyntaxSecLenMask1 = 0x03
crcSize = 4
)
const (
SectionLenIdx1 = 2
SectionLenIdx2 = 3
)
const (
SectionLenMask1 = 0x03
)
// Consts relating to program info len.
const (
ProgramInfoLenIdx1 = 11
ProgramInfoLenIdx2 = 12
ProgramInfoLenMask1 = 0x03
)
const (
DescriptorsIdx = ProgramInfoLenIdx2 + 1
)
// DescriptorsIdx is the index that the descriptors start at.
const DescriptorsIdx = ProgramInfoLenIdx2 + 1
// MetadataTag is the descriptor tag used for metadata.
const MetadataTag = 0x26
// TODO: get rid of these - not a good idea.
type (
PSIBytes []byte
Descriptor []byte