Documentation ¶
Index ¶
- Constants
- Variables
- func AsUint32(data []byte) (n uint32)
- func CheckCRC32(payload []byte) bool
- type Descriptor
- type DescriptorTag
- type PID
- type PIDSlice
- type Packet
- type PacketFilter
- type PacketScanner
- type PacketStream
- type ProgramAssociationSection
- type Table
- func (t Table) CRC32() uint32
- func (t Table) CheckCRC() bool
- func (t Table) CurrentNextIndicator() bool
- func (t Table) Data() []byte
- func (t Table) LastSectionNumber() uint8
- func (t Table) PrivateIndicator() bool
- func (t Table) SectionLength() int
- func (t Table) SectionNumber() uint8
- func (t Table) SectionSyntaxIndicator() bool
- func (t Table) TableId() TableId
- func (t Table) TableIdExtension() uint16
- func (t Table) VersionNumber() uint8
- type TableId
- type TableScanner
- type TableStream
Constants ¶
View Source
const ( PacketSize = 188 BufferedPacketCount = 5 BufferSize = PacketSize * BufferedPacketCount SyncByte byte = 0x47 )
Variables ¶
View Source
var ( ErrInvalidPointer = errors.New("Invalid value of pointer_field") ErrPacketScrambled = errors.New("Scrambled") ErrPacketDropped = errors.New("Detected dropping packet") )
View Source
var ( ErrInvalidTableLength = errors.New("Invalid table length") ErrInvalidSectionLength = errors.New("Invalid value of section_length") )
Functions ¶
func CheckCRC32 ¶
Types ¶
type Descriptor ¶
type Descriptor []byte
func ParseDescriptor ¶
func ParseDescriptor(data []byte) (d Descriptor, length int)
func ParseDescriptors ¶
func ParseDescriptors(data []byte) []Descriptor
func (Descriptor) Length ¶
func (d Descriptor) Length() uint8
func (Descriptor) Payload ¶
func (d Descriptor) Payload() []byte
func (Descriptor) Tag ¶
func (d Descriptor) Tag() DescriptorTag
type DescriptorTag ¶
type DescriptorTag uint8
type Packet ¶
type Packet []byte
func (Packet) AdaptationField ¶
func (Packet) HasAdaptationField ¶
func (Packet) HasPayload ¶
type PacketFilter ¶
type PacketFilter struct {
// contains filtered or unexported fields
}
func NewPacketFilter ¶
func NewPacketFilter(s PacketStream, pids ...PID) *PacketFilter
func (*PacketFilter) Bytes ¶
func (f *PacketFilter) Bytes() []byte
func (*PacketFilter) Packet ¶
func (f *PacketFilter) Packet() Packet
func (*PacketFilter) Scan ¶
func (f *PacketFilter) Scan() bool
type PacketScanner ¶
type PacketScanner struct {
// contains filtered or unexported fields
}
func NewPacketScanner ¶
func NewPacketScanner(r io.Reader, logger *log.Logger) *PacketScanner
func (*PacketScanner) Bytes ¶
func (s *PacketScanner) Bytes() []byte
func (*PacketScanner) Packet ¶
func (s *PacketScanner) Packet() Packet
func (*PacketScanner) Scan ¶
func (s *PacketScanner) Scan() bool
type PacketStream ¶
type ProgramAssociationSection ¶
type ProgramAssociationSection struct {
// contains filtered or unexported fields
}
func ParseProgramAssociationSection ¶
func ParseProgramAssociationSection(table Table) *ProgramAssociationSection
func (*ProgramAssociationSection) NetworkPID ¶
func (s *ProgramAssociationSection) NetworkPID() PID
func (*ProgramAssociationSection) ProgramMap ¶
func (s *ProgramAssociationSection) ProgramMap() map[uint16]PID
type Table ¶
type Table []byte
func (Table) CurrentNextIndicator ¶
func (Table) LastSectionNumber ¶
func (Table) PrivateIndicator ¶
func (Table) SectionLength ¶
func (Table) SectionNumber ¶
func (Table) SectionSyntaxIndicator ¶
func (Table) TableIdExtension ¶
func (Table) VersionNumber ¶
type TableScanner ¶
type TableScanner struct {
// contains filtered or unexported fields
}
func NewTableScanner ¶
func NewTableScanner(s PacketStream, l *log.Logger) *TableScanner
func (*TableScanner) Scan ¶
func (s *TableScanner) Scan() bool
func (*TableScanner) Table ¶
func (s *TableScanner) Table() Table
type TableStream ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.