Documentation
¶
Overview ¶
Code generated by astits using internal/cmd/crc32_table. DO NOT EDIT
Index ¶
- Constants
- Variables
- func DemuxerOptPacketSize(packetSize int) func(*Demuxer)
- func DemuxerOptPacketSkipper(s PacketSkipper) func(*Demuxer)
- func DemuxerOptPacketsParser(p PacketsParser) func(*Demuxer)
- func DemuxerOptSkipErrLimit(count int) func(*Demuxer)
- func DemuxerOptZeroCopyPackets(batchPackets uint) func(*Demuxer)
- func MuxerOptTablesRetransmitPeriod(newPeriod int) func(*Muxer)
- type ClockReference
- type DSMTrickMode
- type Demuxer
- func (dmx *Demuxer) Close()
- func (dmx *Demuxer) GetStats() (ret map[uint64]uint)
- func (dmx *Demuxer) NextData() (d *DemuxerData, err error)
- func (dmx *Demuxer) NextPacket() (p *Packet, err error)
- func (dmx *Demuxer) NextPacketTo(p *Packet) (err error)
- func (dmx *Demuxer) Rewind() (n int64, err error)
- type DemuxerData
- type Descriptor
- type DescriptorAC3
- type DescriptorAVCVideo
- type DescriptorComponent
- type DescriptorContent
- type DescriptorContentItem
- type DescriptorDataStreamAlignment
- type DescriptorEnhancedAC3
- type DescriptorExtendedEvent
- type DescriptorExtendedEventItem
- type DescriptorExtension
- type DescriptorExtensionSupplementaryAudio
- type DescriptorHeader
- type DescriptorISO639LanguageAndAudioType
- type DescriptorLocalTimeOffset
- type DescriptorLocalTimeOffsetItem
- type DescriptorMaximumBitrate
- type DescriptorNetworkName
- type DescriptorParentalRating
- type DescriptorParentalRatingItem
- type DescriptorParser
- type DescriptorPrivateDataIndicator
- type DescriptorPrivateDataSpecifier
- type DescriptorRegistration
- type DescriptorService
- type DescriptorShortEvent
- type DescriptorStreamIdentifier
- type DescriptorSubtitling
- type DescriptorSubtitlingItem
- type DescriptorTag
- type DescriptorTeletext
- type DescriptorTeletextItem
- type DescriptorUnknown
- type DescriptorUserDefined
- type DescriptorVBIData
- type DescriptorVBIDataDescriptor
- type DescriptorVBIDataService
- type EITData
- type EITDataEvent
- type Muxer
- func (m *Muxer) AddElementaryStream(es PMTElementaryStream) error
- func (m *Muxer) RemoveElementaryStream(pid uint16) error
- func (m *Muxer) SetCC(pid uint16, cc uint8) error
- func (m *Muxer) SetPCRPID(pid uint16)
- func (m *Muxer) WriteData(d *MuxerData) (bytesWritten int, err error)
- func (m *Muxer) WritePacket(p *Packet) (int, error)
- func (m *Muxer) WriteTables() (bytesWritten int, err error)
- type MuxerData
- type NITData
- type NITDataTransportStream
- type PATData
- type PATProgram
- type PESData
- type PESHeader
- type PESOptionalHeader
- type PESOptionalHeaderExtension
- type PMTData
- type PMTElementaryStream
- type PSIData
- type PSISection
- type PSISectionHeader
- type PSISectionSyntax
- type PSISectionSyntaxData
- type PSISectionSyntaxHeader
- type PSITableID
- type Packet
- type PacketAdaptationExtensionField
- type PacketAdaptationField
- type PacketHeader
- type PacketList
- type PacketSkipper
- type PacketsParser
- type SDTData
- type SDTDataService
- type StreamType
- type TOTData
Constants ¶
const ( PIDPAT uint16 = 0x0 // Program Association Table (PAT) contains a directory listing of all Program Map Tables. PIDCAT uint16 = 0x1 // Conditional Access Table (CAT) contains a directory listing of all ITU-T Rec. H.222 entitlement management message streams used by Program Map Tables. PIDTSDT uint16 = 0x2 // Transport Stream Description Table (TSDT) contains descriptors related to the overall transport stream PIDNull uint16 = 0x1fff // Null Packet (used for fixed bandwidth padding) )
PIDs
const ( PSTDBufferScale128Bytes = 0 PSTDBufferScale1024Bytes = 1 )
P-STD buffer scales
const ( PTSDTSIndicatorBothPresent = 3 PTSDTSIndicatorIsForbidden = 1 PTSDTSIndicatorNoPTSOrDTS = 0 PTSDTSIndicatorOnlyPTS = 2 )
PTS DTS indicator
const ( StreamIDPrivateStream1 = 189 StreamIDPaddingStream = 190 StreamIDPrivateStream2 = 191 )
Stream IDs
const ( TrickModeControlFastForward = 0 TrickModeControlFastReverse = 3 TrickModeControlFreezeFrame = 2 TrickModeControlSlowMotion = 1 TrickModeControlSlowReverse = 4 )
Trick mode controls
const ( PSITableTypeBAT = "BAT" PSITableTypeDIT = "DIT" PSITableTypeEIT = "EIT" PSITableTypeNIT = "NIT" PSITableTypeNull = "Null" PSITableTypePAT = "PAT" PSITableTypePMT = "PMT" PSITableTypeRST = "RST" PSITableTypeSDT = "SDT" PSITableTypeSIT = "SIT" PSITableTypeST = "ST" PSITableTypeTDT = "TDT" PSITableTypeTOT = "TOT" PSITableTypeUnknown = "Unknown" )
PSI table IDs
const ( RunningStatusNotRunning = 1 RunningStatusPausing = 3 RunningStatusRunning = 4 RunningStatusServiceOffAir = 5 RunningStatusStartsInAFewSeconds = 2 RunningStatusUndefined = 0 )
Running statuses
const ( AudioTypeCleanEffects = 0x1 AudioTypeHearingImpaired = 0x2 AudioTypeVisualImpairedCommentary = 0x3 )
Audio types Page: 683 | https://books.google.fr/books?id=6dgWB3-rChYC&printsec=frontcover&hl=fr
const ( DataStreamAligmentAudioSyncWord = 0x1 DataStreamAligmentVideoSliceOrAccessUnit = 0x1 DataStreamAligmentVideoAccessUnit = 0x2 DataStreamAligmentVideoGOPOrSEQ = 0x3 DataStreamAligmentVideoSEQ = 0x4 )
Data stream alignments Page: 85 | Chapter:2.6.11 | Link: http://ecee.colorado.edu/~ecen5653/ecen5653/papers/iso13818-1.pdf
const ( TeletextTypeAdditionalInformationPage = 0x3 TeletextTypeInitialTeletextPage = 0x1 TeletextTypeProgramSchedulePage = 0x4 TeletextTypeTeletextSubtitlePage = 0x2 TeletextTypeTeletextSubtitlePageForHearingImpairedPeople = 0x5 )
Teletext types Chapter: 6.2.43 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
const ( VBIDataServiceIDEBUTeletext = 0x1 VBIDataServiceIDInvertedTeletext = 0x2 VBIDataServiceIDVPS = 0x4 VBIDataServiceIDWSS = 0x5 VBIDataServiceIDClosedCaptioning = 0x6 VBIDataServiceIDMonochrome442Samples = 0x7 )
VBI data service id Chapter: 6.2.47 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
const ( ScramblingControlNotScrambled = 0 ScramblingControlReservedForFutureUse = 1 ScramblingControlScrambledWithEvenKey = 2 ScramblingControlScrambledWithOddKey = 3 )
Scrambling Controls
const ( MpegTsPacketSize = 188 M2TsPacketSize = 192 )
const (
DescriptorTagExtensionSupplementaryAudio = 0x6
)
Descriptor extension tags Chapter: 6.3 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
const (
ServiceTypeDigitalTelevisionService = 0x1
)
Service types Chapter: 6.2.33 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
Variables ¶
var ( ErrNoMorePackets = errors.New("astits: no more packets") ErrPacketMustStartWithASyncByte = errors.New("astits: packet must start with a sync byte") ErrZeroCopyNextData = errors.New("astits: NextData is unavailable with zero-copy packets") ErrShortPacket = errors.New("astits: packet too short") )
Errors
var ( ErrPIDNotFound = errors.New("astits: PID not found") ErrPIDAlreadyExists = errors.New("astits: PID already exists") ErrPCRPIDInvalid = errors.New("astits: PCR PID invalid") )
var EmptySkipper = func(_ *Packet) (skip bool) { return }
var ErrCounterOverflow = errors.New("counter overflow")
Functions ¶
func DemuxerOptPacketSize ¶
DemuxerOptPacketSize returns the option to set the packet size
func DemuxerOptPacketSkipper ¶
func DemuxerOptPacketSkipper(s PacketSkipper) func(*Demuxer)
DemuxerOptPacketSkipper returns the option to set the packet skipper
func DemuxerOptPacketsParser ¶
func DemuxerOptPacketsParser(p PacketsParser) func(*Demuxer)
DemuxerOptPacketsParser returns the option to set the packets parser
func DemuxerOptSkipErrLimit ¶
DemuxerOptSkipErrLimit returns the option to set the packet skipper
func DemuxerOptZeroCopyPackets ¶
DemuxerOptZeroCopyPackets makes NextPacket/NextPacketTo read the stream in batches of batchPackets and return packets as views into the internal buffer: no per-packet read call and no copy. A packet's memory (Payload, adaptation private data) is only valid until the NextPacket/NextPacketTo call that triggers the next batch refill — consume it immediately. NextData is unavailable in this mode (it accumulates packets across refills) and returns ErrZeroCopyNextData.
Types ¶
type ClockReference ¶
type ClockReference uint64
ClockReference represents a clock reference Base is based on a 90 kHz clock and extension is based on a 27 MHz clock
func (*ClockReference) Base ¶
func (cr *ClockReference) Base() uint64
func (*ClockReference) Duration ¶
func (cr *ClockReference) Duration() time.Duration
Duration converts the clock reference into duration
func (*ClockReference) Extension ¶
func (cr *ClockReference) Extension() uint64
func (*ClockReference) Time ¶
func (cr *ClockReference) Time() time.Time
Time converts the clock reference into time
type DSMTrickMode ¶
type DSMTrickMode struct {
FieldID uint8
FrequencyTruncation uint8
IntraSliceRefresh uint8
RepeatControl uint8
TrickModeControl uint8
}
DSMTrickMode represents a DSM trick mode https://books.google.fr/books?id=vwUrAwAAQBAJ&pg=PT501&lpg=PT501&dq=dsm+trick+mode+control&source=bl&ots=fI-9IHXMRL&sig=PWnhxrsoMWNQcl1rMCPmJGNO9Ds&hl=fr&sa=X&ved=0ahUKEwjogafD8bjXAhVQ3KQKHeHKD5oQ6AEINDAB#v=onepage&q=dsm%20trick%20mode%20control&f=false
type Demuxer ¶
type Demuxer struct {
// contains filtered or unexported fields
}
Demuxer represents a demuxer https://en.wikipedia.org/wiki/MPEG_transport_stream http://seidl.cs.vsb.cz/download/dvb/DVB_Poster.pdf http://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.13.01_40/en_300468v011301o.pdf
func NewDemuxer ¶
NewDemuxer creates a new transport stream based on a reader
func (*Demuxer) Close ¶
func (dmx *Demuxer) Close()
Close returns everything the demuxer holds to the pools (buffered data, unfinished lists, the freelist). The demuxer must not be used after Close. Mandatory for demuxers abandoned before the end of the stream.
func (*Demuxer) NextData ¶
func (dmx *Demuxer) NextData() (d *DemuxerData, err error)
NextData retrieves the next data
func (*Demuxer) NextPacket ¶
NextPacket retrieves the next packet. You must Close() the packet after use.
func (*Demuxer) NextPacketTo ¶
NextPacketTo unpack packet to provided p.
type DemuxerData ¶
type DemuxerData struct {
PAT *PATData
PMT *PMTData
PES *PESData
EIT *EITData
NIT *NITData
SDT *SDTData
TOT *TOTData
AdaptationField *PacketAdaptationField
ContinuityCounter uint8
PID uint16
// contains filtered or unexported fields
}
DemuxerData represents a data parsed by Demuxer
func (*DemuxerData) Close ¶
func (d *DemuxerData) Close()
type Descriptor ¶
type Descriptor interface {
// contains filtered or unexported methods
}
type DescriptorAC3 ¶
type DescriptorAC3 struct {
Header DescriptorHeader
AdditionalInfo []byte
ASVC uint8
BSID uint8
ComponentType uint8
HasASVC bool
HasBSID bool
HasComponentType bool
HasMainID bool
MainID uint8
}
DescriptorAC3 represents an AC3 descriptor Chapter: Annex D | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorAVCVideo ¶
type DescriptorAVCVideo struct {
Header DescriptorHeader
AVC24HourPictureFlag bool
AVCStillPresent bool
CompatibleFlags uint8
ConstraintSet0Flag bool
ConstraintSet1Flag bool
ConstraintSet2Flag bool
LevelIDC uint8
ProfileIDC uint8
}
DescriptorAVCVideo represents an AVC video descriptor No doc found unfortunately, basing the implementation on https://github.com/gfto/bitstream/blob/master/mpeg/psi/desc_28.h
type DescriptorComponent ¶
type DescriptorComponent struct {
Header DescriptorHeader
ISO639LanguageCode [3]byte
Text []byte
ComponentTag uint8
ComponentType uint8
StreamContent uint8
StreamContentExt uint8
}
DescriptorComponent represents a component descriptor Chapter: 6.2.8 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorContent ¶
type DescriptorContent struct {
Header DescriptorHeader
Items []DescriptorContentItem
}
DescriptorContent represents a content descriptor Chapter: 6.2.9 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorContentItem ¶
type DescriptorContentItem struct {
ContentNibbleLevel1 uint8
ContentNibbleLevel2 uint8
UserByte uint8
}
DescriptorContentItem represents a content item descriptor Chapter: 6.2.9 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorDataStreamAlignment ¶
type DescriptorDataStreamAlignment struct {
Header DescriptorHeader
Type uint8
}
DescriptorDataStreamAlignment represents a data stream alignment descriptor
type DescriptorEnhancedAC3 ¶
type DescriptorEnhancedAC3 struct {
Header DescriptorHeader
AdditionalInfo []byte
ASVC uint8
BSID uint8
ComponentType uint8
HasASVC bool
HasBSID bool
HasComponentType bool
HasMainID bool
HasSubStream1 bool
HasSubStream2 bool
HasSubStream3 bool
MainID uint8
MixInfoExists bool
SubStream1 uint8
SubStream2 uint8
SubStream3 uint8
}
DescriptorEnhancedAC3 represents an enhanced AC3 descriptor Chapter: Annex D | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorExtendedEvent ¶
type DescriptorExtendedEvent struct {
Text []byte
Items []DescriptorExtendedEventItem
Header DescriptorHeader
ISO639LanguageCode [3]byte
LastDescriptorNumber uint8
Number uint8
}
DescriptorExtendedEvent represents an extended event descriptor Chapter: 6.2.15 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorExtendedEventItem ¶
DescriptorExtendedEventItem represents an extended event item descriptor Chapter: 6.2.15 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorExtension ¶
type DescriptorExtension struct {
Header DescriptorHeader
SupplementaryAudio *DescriptorExtensionSupplementaryAudio
Unknown []byte
Tag uint8
}
DescriptorExtension represents an extension descriptor Chapter: 6.2.16 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorExtensionSupplementaryAudio ¶
type DescriptorExtensionSupplementaryAudio struct {
LanguageCode [3]byte
PrivateData []byte
EditorialClassification uint8
HasLanguageCode bool
MixType bool
}
DescriptorExtensionSupplementaryAudio represents a supplementary audio extension descriptor Chapter: 6.4.10 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorHeader ¶
type DescriptorHeader struct {
Tag DescriptorTag // the tag defines the structure of the contained data following the descriptor length.
Length uint8
}
type DescriptorISO639LanguageAndAudioType ¶
type DescriptorISO639LanguageAndAudioType struct {
Language [3]byte
Header DescriptorHeader
Type uint8
}
DescriptorISO639LanguageAndAudioType represents an ISO639 language descriptor https://github.com/gfto/bitstream/blob/master/mpeg/psi/desc_0a.h FIXME (barbashov) according to Chapter 2.6.18 ISO/IEC 13818-1:2015 there could be not one, but multiple such descriptors
type DescriptorLocalTimeOffset ¶
type DescriptorLocalTimeOffset struct {
Header DescriptorHeader
Items []DescriptorLocalTimeOffsetItem
}
DescriptorLocalTimeOffset represents a local time offset descriptor Chapter: 6.2.20 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorLocalTimeOffsetItem ¶
type DescriptorLocalTimeOffsetItem struct {
LocalTimeOffset time.Duration
NextTimeOffset time.Duration
TimeOfChange time.Time
CountryCode [3]byte
CountryRegionID uint8
LocalTimeOffsetPolarity bool
}
DescriptorLocalTimeOffsetItem represents a local time offset item descriptor Chapter: 6.2.20 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorMaximumBitrate ¶
type DescriptorMaximumBitrate struct {
Bitrate uint32 // In bytes/second
Header DescriptorHeader
}
DescriptorMaximumBitrate represents a maximum bitrate descriptor
type DescriptorNetworkName ¶
type DescriptorNetworkName struct {
Header DescriptorHeader
Name []byte
}
DescriptorNetworkName represents a network name descriptor Chapter: 6.2.27 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorParentalRating ¶
type DescriptorParentalRating struct {
Header DescriptorHeader
Items []DescriptorParentalRatingItem
}
DescriptorParentalRating represents a parental rating descriptor Chapter: 6.2.28 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorParentalRatingItem ¶
DescriptorParentalRatingItem represents a parental rating item descriptor Chapter: 6.2.28 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
func (DescriptorParentalRatingItem) MinimumAge ¶
func (d DescriptorParentalRatingItem) MinimumAge() int
MinimumAge returns the minimum age for the parental rating
type DescriptorParser ¶
type DescriptorParser func(i *astikit.BytesIterator, h DescriptorHeader, offsetEnd int) (d Descriptor, err error)
type DescriptorPrivateDataIndicator ¶
type DescriptorPrivateDataIndicator struct {
Header DescriptorHeader
Indicator uint32
}
DescriptorPrivateDataIndicator represents a private data Indicator descriptor
type DescriptorPrivateDataSpecifier ¶
type DescriptorPrivateDataSpecifier struct {
Header DescriptorHeader
Specifier uint32
}
DescriptorPrivateDataSpecifier represents a private data specifier descriptor
type DescriptorRegistration ¶
type DescriptorRegistration struct {
AdditionalIdentificationInfo []byte
FormatIdentifier uint32
Header DescriptorHeader
}
DescriptorRegistration represents a registration descriptor Page: 84 | http://ecee.colorado.edu/~ecen5653/ecen5653/papers/iso13818-1.pdf
type DescriptorService ¶
type DescriptorService struct {
Name []byte
Provider []byte
Header DescriptorHeader
Type uint8
}
DescriptorService represents a service descriptor Chapter: 6.2.33 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorShortEvent ¶
type DescriptorShortEvent struct {
Header DescriptorHeader
EventName []byte
Language [3]byte
Text []byte
}
DescriptorShortEvent represents a short event descriptor Chapter: 6.2.37 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorStreamIdentifier ¶
type DescriptorStreamIdentifier struct {
Header DescriptorHeader
ComponentTag uint8
}
DescriptorStreamIdentifier represents a stream identifier descriptor Chapter: 6.2.39 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorSubtitling ¶
type DescriptorSubtitling struct {
Header DescriptorHeader
Items []DescriptorSubtitlingItem
}
DescriptorSubtitling represents a subtitling descriptor Chapter: 6.2.41 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorSubtitlingItem ¶
type DescriptorSubtitlingItem struct {
Language [3]byte
AncillaryPageID uint16
CompositionPageID uint16
Type uint8
}
DescriptorSubtitlingItem represents subtitling descriptor item Chapter: 6.2.41 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorTag ¶
type DescriptorTag uint8
const ( DescriptorTagAC3 DescriptorTag = 0x6a DescriptorTagAVCVideo DescriptorTag = 0x28 DescriptorTagComponent DescriptorTag = 0x50 DescriptorTagContent DescriptorTag = 0x54 DescriptorTagDataStreamAlignment DescriptorTag = 0x6 DescriptorTagEnhancedAC3 DescriptorTag = 0x7a DescriptorTagExtendedEvent DescriptorTag = 0x4e DescriptorTagExtension DescriptorTag = 0x7f DescriptorTagISO639LanguageAndAudioType DescriptorTag = 0xa DescriptorTagLocalTimeOffset DescriptorTag = 0x58 DescriptorTagMaximumBitrate DescriptorTag = 0xe DescriptorTagNetworkName DescriptorTag = 0x40 DescriptorTagParentalRating DescriptorTag = 0x55 DescriptorTagPrivateDataIndicator DescriptorTag = 0xf DescriptorTagPrivateDataSpecifier DescriptorTag = 0x5f DescriptorTagRegistration DescriptorTag = 0x5 DescriptorTagService DescriptorTag = 0x48 DescriptorTagShortEvent DescriptorTag = 0x4d DescriptorTagStreamIdentifier DescriptorTag = 0x52 DescriptorTagSubtitling DescriptorTag = 0x59 DescriptorTagTeletext DescriptorTag = 0x56 DescriptorTagVBIData DescriptorTag = 0x45 DescriptorTagVBITeletext DescriptorTag = 0x46 )
Descriptor tags Chapter: 6.1 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorTeletext ¶
type DescriptorTeletext struct {
Header DescriptorHeader
Items []DescriptorTeletextItem
}
DescriptorTeletext represents a teletext descriptor Chapter: 6.2.43 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorTeletextItem ¶
DescriptorTeletextItem represents a teletext descriptor item Chapter: 6.2.43 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorUnknown ¶
type DescriptorUnknown struct {
Header DescriptorHeader
Content []byte
}
type DescriptorUserDefined ¶
type DescriptorUserDefined struct {
Header DescriptorHeader
Data []byte
}
type DescriptorVBIData ¶
type DescriptorVBIData struct {
Header DescriptorHeader
Services []DescriptorVBIDataService
}
DescriptorVBIData represents a VBI data descriptor Chapter: 6.2.47 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorVBIDataDescriptor ¶
DescriptorVBIDataItem represents a vbi data descriptor item Chapter: 6.2.47 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type DescriptorVBIDataService ¶
type DescriptorVBIDataService struct {
DataServiceID uint8
Descriptors []DescriptorVBIDataDescriptor
}
DescriptorVBIDataService represents a vbi data service descriptor Chapter: 6.2.47 | Link: https://www.etsi.org/deliver/etsi_en/300400_300499/300468/01.15.01_60/en_300468v011501p.pdf
type EITData ¶
type EITData struct {
Events []EITDataEvent
OriginalNetworkID uint16
ServiceID uint16
TransportStreamID uint16
LastTableID uint8
SegmentLastSectionNumber uint8
}
EITData represents an EIT data Page: 36 | Chapter: 5.2.4 | Link: https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
type EITDataEvent ¶
type EITDataEvent struct {
Descriptors []Descriptor
Duration time.Duration
StartTime time.Time
EventID uint16
HasFreeCSAMode bool // When true indicates that access to one or more streams may be controlled by a CA system.
RunningStatus uint8
}
EITDataEvent represents an EIT data event
type Muxer ¶
type Muxer struct {
// contains filtered or unexported fields
}
func (*Muxer) AddElementaryStream ¶
func (m *Muxer) AddElementaryStream(es PMTElementaryStream) error
if es.ElementaryPID is zero, it will be generated automatically
func (*Muxer) RemoveElementaryStream ¶
func (*Muxer) WriteData ¶
WriteData writes MuxerData to TS stream Currently only PES packets are supported Be aware that after successful call WriteData will set d.AdaptationField.StuffingLength value to zero
func (*Muxer) WritePacket ¶
Writes given packet to MPEG-TS stream Stuffs with 0xffs if packet turns out to be shorter than target packet length
func (*Muxer) WriteTables ¶
type MuxerData ¶
type MuxerData struct {
PID uint16
AdaptationField *PacketAdaptationField
PES *PESData
}
MuxerData represents a data to be written by Muxer
type NITData ¶
type NITData struct {
NetworkDescriptors []Descriptor
TransportStreams []NITDataTransportStream
NetworkID uint16
}
NITData represents a NIT data Page: 29 | Chapter: 5.2.1 | Link: https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
type NITDataTransportStream ¶
type NITDataTransportStream struct {
TransportDescriptors []Descriptor
TransportStreamID uint16
OriginalNetworkID uint16
}
NITDataTransportStream represents a NIT data transport stream
type PATData ¶
type PATData struct {
Programs []PATProgram
TransportStreamID uint16
}
PATData represents a PAT data https://en.wikipedia.org/wiki/Program-specific_information
type PATProgram ¶
type PATProgram struct {
ProgramMapID uint16 // The packet identifier that contains the associated PMT
ProgramNumber uint16 // Relates to the Table ID extension in the associated PMT. A value of 0 is reserved for a NIT packet identifier.
}
PATProgram represents a PAT program
type PESData ¶
PESData represents a PES data https://en.wikipedia.org/wiki/Packetized_elementary_stream http://dvd.sourceforge.net/dvdinfo/pes-hdr.html http://happy.emu.id.au/lab/tut/dttb/dtbtut4b.htm
type PESHeader ¶
type PESHeader struct {
OptionalHeader *PESOptionalHeader
PacketLength uint16 // Specifies the number of bytes remaining in the packet after this field. Can be zero. If the PES packet length is set to zero, the PES packet can be of any length. A value of zero for the PES packet length can be used only when the PES packet payload is a video elementary stream.
StreamID uint8 // Examples: Audio streams (0xC0-0xDF), Video streams (0xE0-0xEF)
// contains filtered or unexported fields
}
PESHeader represents a packet PES header
func (*PESHeader) IsVideoStream ¶
type PESOptionalHeader ¶
type PESOptionalHeader struct {
DSMTrickMode *DSMTrickMode
Extension *PESOptionalHeaderExtension
DTS ClockReference
PTS ClockReference
ESCR ClockReference
ESRate uint32
CRC uint16
AdditionalCopyInfo uint8
DataAlignmentIndicator bool // True indicates that the PES packet header is immediately followed by the video start code or audio syncword
HasAdditionalCopyInfo bool
HasCRC bool
HasDSMTrickMode bool
HasESCR bool
HasESRate bool
HasExtension bool
HasOptionalFields bool
HeaderLength uint8
IsCopyrighted bool
IsOriginal bool
MarkerBits uint8
Priority bool
PTSDTSIndicator uint8
ScramblingControl uint8
}
PESOptionalHeader represents a PES optional header
type PESOptionalHeaderExtension ¶
type PESOptionalHeaderExtension struct {
PrivateData []byte
Extension2Data []byte
HasPrivateData bool
HasPackHeaderField bool
HasProgramPacketSequenceCounter bool
HasPSTDBuffer bool
HasExtension2 bool
PackField uint8
PacketSequenceCounter uint8
MPEG1OrMPEG2ID uint8
OriginalStuffingLength uint8
PSTDBufferScale uint8
PSTDBufferSize uint16
Extension2Length uint8
}
type PMTData ¶
type PMTData struct {
ElementaryStreams []PMTElementaryStream
ProgramDescriptors []Descriptor // Program descriptors
ProgramNumber uint16
PCRPID uint16 // The packet identifier that contains the program clock reference used to improve the random access accuracy of the stream's timing that is derived from the program timestamp. If this is unused. then it is set to 0x1FFF (all bits on).
}
PMTData represents a PMT data https://en.wikipedia.org/wiki/Program-specific_information
type PMTElementaryStream ¶
type PMTElementaryStream struct {
ElementaryStreamDescriptors []Descriptor // Elementary stream descriptors
ElementaryPID uint16 // The packet identifier that contains the stream type data.
StreamType StreamType // This defines the structure of the data contained within the elementary packet identifier.
}
PMTElementaryStream represents a PMT elementary stream
type PSIData ¶
type PSIData struct {
PointerField int // Present at the start of the TS packet payload signaled by the payload_unit_start_indicator bit in the TS header. Used to set packet alignment bytes or content before the start of tabled payload data.
Sections []PSISection
}
PSIData represents a PSI data https://en.wikipedia.org/wiki/Program-specific_information
type PSISection ¶
type PSISection struct {
Syntax *PSISectionSyntax
CRC32 uint32 // A checksum of the entire table excluding the pointer field, pointer filler bytes and the trailing CRC32.
Header PSISectionHeader
}
PSISection represents a PSI section
type PSISectionHeader ¶
type PSISectionHeader struct {
SectionLength uint16 // The number of bytes that follow for the syntax section (with CRC value) and/or table data. These bytes must not exceed a value of 1021.
TableID PSITableID // Table Identifier, that defines the structure of the syntax section and other contained data. As an exception, if this is the byte that immediately follow previous table section and is set to 0xFF, then it indicates that the repeat of table section end here and the rest of TS data payload shall be stuffed with 0xFF. Consequently the value 0xFF shall not be used for the Table Identifier.
SectionSyntaxIndicator bool // A flag that indicates if the syntax section follows the section length. The PAT, PMT, and CAT all set this to 1.
PrivateBit bool // The PAT, PMT, and CAT all set this to 0. Other tables set this to 1.
}
PSISectionHeader represents a PSI section header
type PSISectionSyntax ¶
type PSISectionSyntax struct {
Data PSISectionSyntaxData
Header PSISectionSyntaxHeader
}
PSISectionSyntax represents a PSI section syntax
type PSISectionSyntaxData ¶
type PSISectionSyntaxData interface{}
PSISectionSyntaxData represents a PSI section syntax data
type PSISectionSyntaxHeader ¶
type PSISectionSyntaxHeader struct {
CurrentNextIndicator bool // Indicates if data is current in effect or is for future use. If the bit is flagged on, then the data is to be used at the present moment.
LastSectionNumber uint8 // This indicates which table is the last table in the sequence of tables.
SectionNumber uint8 // This is an index indicating which table this is in a related sequence of tables. The first table starts from 0.
VersionNumber uint8 // Syntax version number. Incremented when data is changed and wrapped around on overflow for values greater than 32.
TableIDExtension uint16 // Informational only identifier. The PAT uses this for the transport stream identifier and the PMT uses this for the Program number.
}
PSISectionSyntaxHeader represents a PSI section syntax header
type PSITableID ¶
type PSITableID uint8
const ( PSITableIDPAT PSITableID = 0x00 PSITableIDPMT PSITableID = 0x02 PSITableIDNITVariant1 PSITableID = 0x40 PSITableIDNITVariant2 PSITableID = 0x41 PSITableIDSDTVariant1 PSITableID = 0x42 PSITableIDSDTVariant2 PSITableID = 0x46 PSITableIDBAT PSITableID = 0x4a PSITableIDEITStart PSITableID = 0x4e PSITableIDEITEnd PSITableID = 0x6f PSITableIDTDT PSITableID = 0x70 PSITableIDRST PSITableID = 0x71 PSITableIDST PSITableID = 0x72 PSITableIDTOT PSITableID = 0x73 PSITableIDDIT PSITableID = 0x7e PSITableIDSIT PSITableID = 0x7f PSITableIDNull PSITableID = 0xff )
func (PSITableID) Type ¶
func (t PSITableID) Type() string
PSITableID.Type() returns the psi table type based on the table id Page: 28 | https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
type Packet ¶
type Packet struct {
Header PacketHeader
AdaptationField *PacketAdaptationField
Payload []byte // This is only the payload content
// Offset is the byte offset of the raw packet start (including any M2TS prefix)
// within the demuxed stream, counted from the Demuxer's first packet. Packets
// dropped by a PacketSkipper advance it too, so it stays a valid byte map.
Offset int64
// contains filtered or unexported fields
}
Packet represents a packet https://en.wikipedia.org/wiki/MPEG_transport_stream
func (*Packet) Reset ¶
func (p *Packet) Reset()
Reset deliberately keeps bs: it is fully overwritten by the next read before any parse, and zeroing it per packet doubles the per-packet memory traffic.
func (*Packet) UpdateHeader ¶
func (p *Packet) UpdateHeader()
type PacketAdaptationExtensionField ¶
type PacketAdaptationExtensionField struct {
DTSNextAccessUnit ClockReference // The PES DTS of the splice point. Split up as 3 bits, 1 marker bit (0x1), 15 bits, 1 marker bit, 15 bits, and 1 marker bit, for 33 data bits total.
PiecewiseRate uint32 // The rate of the stream, measured in 188-byte packets, to define the end-time of the LTW.
LegalTimeWindowOffset uint16 // Extra information for rebroadcasters to determine the state of buffers when packets may be missing.
LegalTimeWindowIsValid bool
HasLegalTimeWindow bool
HasPiecewiseRate bool
HasSeamlessSplice bool
Length uint8
SpliceType uint8 // Indicates the parameters of the H.262 splice.
}
PacketAdaptationExtensionField represents a packet adaptation extension field
type PacketAdaptationField ¶
type PacketAdaptationField struct {
AdaptationExtensionField *PacketAdaptationExtensionField
OPCR ClockReference // Original Program clock reference. Helps when one TS is copied into another
PCR ClockReference // Program clock reference
TransportPrivateData []byte // points into privBuf after parse — owned by this struct, survives value copies via repoint
TransportPrivateDataLength uint8
Length uint8
StuffingLength uint8 // Only used in writePacketAdaptationField to request stuffing
SpliceCountdown uint8 // Indicates how many TS packets from this one a splicing point occurs (Two's complement signed; may be negative)
IsOneByteStuffing bool // Only used for one byte stuffing - if true, adaptation field will be written as one uint8(0). Not part of TS format
DiscontinuityIndicator bool // Set if current TS packet is in a discontinuity state with respect to either the continuity counter or the program clock reference
RandomAccessIndicator bool // Set when the stream may be decoded without errors from this point
ElementaryStreamPriorityIndicator bool // Set when this stream should be considered "high priority"
HasPCR bool
HasOPCR bool
HasSplicingCountdown bool
HasTransportPrivateData bool
HasAdaptationExtensionField bool
// contains filtered or unexported fields
}
PacketAdaptationField represents a packet adaptation field
type PacketHeader ¶
type PacketHeader struct {
ContinuityCounter uint8 // Sequence number of payload packets (0x00 to 0x0F) within each stream (except PID 8191)
HasAdaptationField bool
HasPayload bool
PayloadUnitStartIndicator bool // Set when a PES, PSI, or DVB-MIP packet begins immediately following the header.
PID uint16 // Packet Identifier, describing the payload data.
TransportErrorIndicator bool // Set when a demodulator can't correct errors from FEC data; indicating the packet is corrupt.
TransportPriority bool // Set when the current packet has a higher priority than other packets with the same PID.
TransportScramblingControl uint8
}
PacketHeader represents a packet header
type PacketList ¶
type PacketList struct {
// contains filtered or unexported fields
}
func NewPacketList ¶
func NewPacketList() *PacketList
func (*PacketList) Clear ¶
func (pl *PacketList) Clear()
func (*PacketList) Close ¶
func (pl *PacketList) Close()
Close clears the list and returns it to the pool: only when no references remain
func (*PacketList) Head ¶
func (pl *PacketList) Head() *Packet
func (*PacketList) IsEmpty ¶
func (pl *PacketList) IsEmpty() bool
func (*PacketList) Length ¶
func (pl *PacketList) Length() int
func (*PacketList) PushBack ¶
func (pl *PacketList) PushBack(p *Packet)
func (*PacketList) Size ¶
func (pl *PacketList) Size() int
func (*PacketList) Tail ¶
func (pl *PacketList) Tail() *Packet
type PacketSkipper ¶
PacketSkipper represents an object capable of skipping a packet before parsing its payload. Its header and adaptation field is parsed and provided to the object. Use this option if you need to filter out unwanted packets from your pipeline. NextPacket() will return the next unskipped packet if any.
type PacketsParser ¶
type PacketsParser func(pl *PacketList) (ds []*DemuxerData, skip bool, err error)
PacketsParser represents an object capable of parsing a set of packets containing a unique payload spanning over those packets Use the skip returned argument to indicate whether the default process should still be executed on the set of packets
type SDTData ¶
type SDTData struct {
Services []SDTDataService
OriginalNetworkID uint16
TransportStreamID uint16
}
SDTData represents an SDT data Page: 33 | Chapter: 5.2.3 | Link: https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
type SDTDataService ¶
type SDTDataService struct {
Descriptors []Descriptor
ServiceID uint16
HasEITPresentFollowing bool // When true indicates that EIT present/following information for the service is present in the current TS
HasEITSchedule bool // When true indicates that EIT schedule information for the service is present in the current TS
HasFreeCSAMode bool // When true indicates that access to one or more streams may be controlled by a CA system.
RunningStatus uint8
}
SDTDataService represents an SDT data service
type StreamType ¶
type StreamType uint8
const ( StreamTypeMPEG1Video StreamType = 0x01 StreamTypeMPEG2Video StreamType = 0x02 StreamTypeMPEG1Audio StreamType = 0x03 // ISO/IEC 11172-3 StreamTypeMPEG2HalvedSampleRateAudio StreamType = 0x04 // ISO/IEC 13818-3 StreamTypeMPEG2Audio StreamType = 0x04 StreamTypePrivateSection StreamType = 0x05 StreamTypePrivateData StreamType = 0x06 StreamTypeMPEG2PacketizedData StreamType = 0x06 // Rec. ITU-T H.222 | ISO/IEC 13818-1 i.e., DVB subtitles/VBI and AC-3 StreamTypeADTS StreamType = 0x0F // ISO/IEC 13818-7 Audio with ADTS transport syntax StreamTypeAACAudio StreamType = 0x0f StreamTypeMPEG4Video StreamType = 0x10 StreamTypeAACLATMAudio StreamType = 0x11 StreamTypeMetadata StreamType = 0x15 StreamTypeH264Video StreamType = 0x1B // Rec. ITU-T H.264 | ISO/IEC 14496-10 StreamTypeH265Video StreamType = 0x24 // Rec. ITU-T H.265 | ISO/IEC 23008-2 StreamTypeHEVCVideo StreamType = 0x24 StreamTypeCAVSVideo StreamType = 0x42 StreamTypeVC1Video StreamType = 0xea StreamTypeDIRACVideo StreamType = 0xd1 StreamTypeAC3Audio StreamType = 0x81 StreamTypeDTSAudio StreamType = 0x82 StreamTypeTRUEHDAudio StreamType = 0x83 StreamTypeSCTE35 StreamType = 0x86 StreamTypeEAC3Audio StreamType = 0x87 )
Stream types
func (StreamType) IsAudio ¶
func (t StreamType) IsAudio() bool
func (StreamType) IsVideo ¶
func (t StreamType) IsVideo() bool
func (StreamType) String ¶
func (t StreamType) String() string
func (StreamType) ToPESStreamID ¶
func (t StreamType) ToPESStreamID() uint8
type TOTData ¶
type TOTData struct {
Descriptors []Descriptor
UTCTime time.Time
}
TOTData represents a TOT data Page: 39 | Chapter: 5.2.6 | Link: https://www.dvb.org/resources/public/standards/a38_dvb-si_specification.pdf (barbashov) the link above can be broken, alternative: https://dvb.org/wp-content/uploads/2019/12/a038_tm1217r37_en300468v1_17_1_-_rev-134_-_si_specification.pdf
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
astits-es-split
command
|
|
|
astits-probe
command
|
|
|
internal
|
|
|
cmd/crc32_table
command
|