Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add muxer #16

Merged
merged 57 commits into from
Mar 24, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d07a182
starting
Jan 25, 2021
0798d32
pcr write
Jan 27, 2021
c9e1bff
go-astikit replacement until PR is merged
Jan 28, 2021
9c4fa08
packet header, adaptation field, dts write
Jan 28, 2021
8741f0c
dependency cleanup
Feb 1, 2021
905064d
get rid of panic/recover for writing
Feb 2, 2021
f298e1e
make writePCR code more adequate
Feb 2, 2021
5c71b25
writePacket and adaptation field length calculation
Feb 2, 2021
278fce9
writePacket and adaptation field length calculation
Feb 2, 2021
4047b66
s/188/MpegTsPacketSize/
Feb 2, 2021
7dc14a4
writePATSection
Feb 2, 2021
28edb16
Try* -> BitsWriterBatch
Feb 3, 2021
b4a87e9
descriptors WIP
Feb 3, 2021
e7a5601
go-astikit version bump
Feb 3, 2021
3dae8fc
descriptors WIP
Feb 4, 2021
b06993f
descriptor parsing tests refactored to allow reuse for descriptor wri…
Feb 5, 2021
3e5341d
descriptors writing tested
Feb 5, 2021
8aa5b6c
descriptors writing refactoring
Feb 5, 2021
e4788ba
descriptors done, PMT WIP
Feb 5, 2021
28a686e
write PMT section fix
Feb 11, 2021
fc82353
writePSIData works
Feb 12, 2021
f82bc07
WIP
Feb 17, 2021
db031e6
PES WIP
Feb 18, 2021
05b66f0
PES functions pass tests
Feb 19, 2021
705a8d3
minor fix
Feb 20, 2021
9391d51
muxer: pat & pmt
Feb 26, 2021
78bebcd
muxer: more tests
Feb 26, 2021
2475c9b
muxer: payload writing
Feb 27, 2021
05cec28
es-split WIP
Feb 27, 2021
69ec742
es-split seems to work
Feb 28, 2021
f060240
es-split PCR sync; some style fixes
Mar 2, 2021
9191588
Data.Kind cleanup
Mar 2, 2021
074bd9b
comment update
Mar 2, 2021
881e1c3
cleanup
Mar 2, 2021
de205b4
cleanup
Mar 2, 2021
ca51287
go-astikit dep replace removed
Mar 3, 2021
b07932b
comment fix
Mar 3, 2021
e98cd9e
minor fix
Mar 3, 2021
583de87
flush on pid change removed as it seems to be unnecessary
Mar 3, 2021
449222b
added some streamtype info funcs
Mar 4, 2021
3916b58
StreamType and PSITableTypeID are special types now
Mar 5, 2021
b069beb
comment cleanup
Mar 6, 2021
72ce363
use PSITableTypeId more instead of comparing strings
Mar 6, 2021
40fd6af
comment cleanup
Mar 6, 2021
6b7966e
PSITableTypeId -> PSITableTypeID
Mar 9, 2021
a6249bb
PESIsVideoStreamId -> PESIsVideoStreamID
Mar 9, 2021
5064bcb
PSITableTypeID.String() -> PSITableTypeID.Type()
Mar 9, 2021
2abf745
review fixes: first pack: constants and stuff
Mar 22, 2021
5d7277f
packet_buffer read() renamed to peek()
Mar 23, 2021
6af7b0b
tools are moved to cmd directory
Mar 24, 2021
a5c45f3
correct prefixes for muxer and demuxer opts
Mar 24, 2021
18725af
SetPCRPID instead of isPCRPID of AddElementaryStream
Mar 24, 2021
432588a
test fix and some comments
Mar 24, 2021
135fae5
muxer WritePacket export
Mar 24, 2021
f2a492a
`astits.New` renamed to `NewDemuxer`
Mar 24, 2021
e943295
astikit version bump; writeBytesN removed in favor of one in BitsWriter
Mar 24, 2021
bc4c488
WritePayload -> WriteData with MuxerData
Mar 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions astits/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,9 @@ type Program struct {

// Stream represents a stream
type Stream struct {
Descriptors []string `json:"descriptors,omitempty"`
ID uint16 `json:"id,omitempty"`
Type uint8 `json:"type,omitempty"`
Descriptors []string `json:"descriptors,omitempty"`
ID uint16 `json:"id,omitempty"`
Type astits.StreamType `json:"type,omitempty"`
}

func newProgram(id, mapID uint16) *Program {
Expand All @@ -359,7 +359,7 @@ func newProgram(id, mapID uint16) *Program {
}
}

func newStream(id uint16, _type uint8) *Stream {
func newStream(id uint16, _type astits.StreamType) *Stream {
return &Stream{
ID: id,
Type: _type,
Expand Down
66 changes: 34 additions & 32 deletions data_pmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,33 @@ import (
"github.com/asticode/go-astikit"
)

type StreamType uint8

// Stream types
const (
StreamTypeMPEG1Video = 0x01
StreamTypeMPEG2Video = 0x02
StreamTypeMPEG1Audio = 0x03 // ISO/IEC 11172-3
StreamTypeMPEG2HalvedSampleRateAudio = 0x04 // ISO/IEC 13818-3
StreamTypeMPEG2Audio = 0x04
StreamTypePrivateSection = 0x05
StreamTypePrivateData = 0x06
StreamTypeMPEG2PacketizedData = 0x06 // Rec. ITU-T H.222 | ISO/IEC 13818-1 i.e., DVB subtitles/VBI and AC-3
StreamTypeADTS = 0x0F // ISO/IEC 13818-7 Audio with ADTS transport syntax
StreamTypeAACAudio = 0x0f
StreamTypeMPEG4Video = 0x10
StreamTypeAACLATMAudio = 0x11
StreamTypeMetadata = 0x15
StreamTypeH264Video = 0x1B // Rec. ITU-T H.264 | ISO/IEC 14496-10
StreamTypeH265Video = 0x24 // Rec. ITU-T H.265 | ISO/IEC 23008-2
StreamTypeHEVCVideo = 0x24
StreamTypeCAVSVideo = 0x42
StreamTypeVC1Video = 0xea
StreamTypeDIRACVideo = 0xd1
StreamTypeAC3Audio = 0x81
StreamTypeDTSAudio = 0x82
StreamTypeTRUEHDAudio = 0x83
StreamTypeEAC3Audio = 0x87
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
StreamTypeEAC3Audio StreamType = 0x87
)

// PMTData represents a PMT data
Expand All @@ -46,7 +48,7 @@ type PMTData struct {
type PMTElementaryStream struct {
ElementaryPID uint16 // The packet identifier that contains the stream type data.
ElementaryStreamDescriptors []*Descriptor // Elementary stream descriptors
StreamType uint8 // This defines the structure of the data contained within the elementary packet identifier.
StreamType StreamType // This defines the structure of the data contained within the elementary packet identifier.
}

// parsePMTSection parses a PMT section
Expand Down Expand Up @@ -83,7 +85,7 @@ func parsePMTSection(i *astikit.BytesIterator, offsetSectionsEnd int, tableIDExt
}

// Stream type
e.StreamType = uint8(b)
e.StreamType = StreamType(b)

// Get next bytes
if bs, err = i.NextBytes(2); err != nil {
Expand Down Expand Up @@ -146,7 +148,7 @@ func writePMTSection(w *astikit.BitsWriter, d *PMTData) (int, error) {
bytesWritten += n

for _, es := range d.ElementaryStreams {
b.Write(es.StreamType)
b.Write(uint8(es.StreamType))
b.WriteN(uint8(0xff), 3)
b.WriteN(es.ElementaryPID, 13)
bytesWritten += 3
Expand All @@ -161,8 +163,8 @@ func writePMTSection(w *astikit.BitsWriter, d *PMTData) (int, error) {
return bytesWritten, b.Err()
}

func StreamTypeIsVideo(streamType uint8) bool {
switch streamType {
func (t StreamType) IsVideo() bool {
switch t {
case StreamTypeMPEG1Video,
StreamTypeMPEG2Video,
StreamTypeMPEG4Video,
Expand All @@ -176,8 +178,8 @@ func StreamTypeIsVideo(streamType uint8) bool {
return false
}

func StreamTypeIsAudio(streamType uint8) bool {
switch streamType {
func (t StreamType) IsAudio() bool {
switch t {
case StreamTypeMPEG1Audio,
StreamTypeMPEG2Audio,
StreamTypeAACAudio,
Expand All @@ -191,8 +193,8 @@ func StreamTypeIsAudio(streamType uint8) bool {
return false
}

func StreamTypeString(streamType uint8) string {
switch streamType {
func (t StreamType) String() string {
switch t {
case StreamTypeMPEG1Video:
return "MPEG1 Video"
case StreamTypeMPEG2Video:
Expand Down
103 changes: 53 additions & 50 deletions data_psi.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,27 @@ const (
PSITableTypeTOT = "TOT"
PSITableTypeUnknown = "Unknown"
)

type PSITableTypeId uint16
asticode marked this conversation as resolved.
Show resolved Hide resolved

const (
PSITableTypeIdPAT = 0x00
PSITableTypeIdPMT = 0x02
PSITableTypeIdBAT = 0x4a
PSITableTypeIdDIT = 0x7e
PSITableTypeIdRST = 0x71
PSITableTypeIdSIT = 0x7f
PSITableTypeIdST = 0x72
PSITableTypeIdTDT = 0x70
PSITableTypeIdTOT = 0x73
PSITableTypeIdNull = 0xff

PSITableTypeIdEITStart = 0x4e
PSITableTypeIdEITEnd = 0x6f
PSITableTypeIdSDTVariant1 = 0x42
PSITableTypeIdSDTVariant2 = 0x46
PSITableTypeIdNITVariant1 = 0x40
PSITableTypeIdNITVariant2 = 0x41
PSITableTypeIdPAT PSITableTypeId = 0x00
PSITableTypeIdPMT PSITableTypeId = 0x02
PSITableTypeIdBAT PSITableTypeId = 0x4a
PSITableTypeIdDIT PSITableTypeId = 0x7e
PSITableTypeIdRST PSITableTypeId = 0x71
PSITableTypeIdSIT PSITableTypeId = 0x7f
PSITableTypeIdST PSITableTypeId = 0x72
PSITableTypeIdTDT PSITableTypeId = 0x70
PSITableTypeIdTOT PSITableTypeId = 0x73
PSITableTypeIdNull PSITableTypeId = 0xff

PSITableTypeIdEITStart PSITableTypeId = 0x4e
PSITableTypeIdEITEnd PSITableTypeId = 0x6f
PSITableTypeIdSDTVariant1 PSITableTypeId = 0x42
PSITableTypeIdSDTVariant2 PSITableTypeId = 0x46
PSITableTypeIdNITVariant1 PSITableTypeId = 0x40
PSITableTypeIdNITVariant2 PSITableTypeId = 0x41
)

// PSIData represents a PSI data
Expand All @@ -59,10 +62,10 @@ type PSISection struct {

// PSISectionHeader represents a PSI section header
type PSISectionHeader struct {
PrivateBit bool // The PAT, PMT, and CAT all set this to 0. Other tables set this to 1.
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.
SectionSyntaxIndicator bool // A flag that indicates if the syntax section follows the section length. The PAT, PMT, and CAT all set this to 1.
TableID int // 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.
PrivateBit bool // The PAT, PMT, and CAT all set this to 0. Other tables set this to 1.
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.
SectionSyntaxIndicator bool // A flag that indicates if the syntax section follows the section length. The PAT, PMT, and CAT all set this to 1.
TableID PSITableTypeId // 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.
TableType string
}

Expand Down Expand Up @@ -213,10 +216,10 @@ func parsePSISectionHeader(i *astikit.BytesIterator) (h *PSISectionHeader, offse
}

// Table ID
h.TableID = int(b)
h.TableID = PSITableTypeId(b)

// Table type
h.TableType = psiTableType(h.TableID)
h.TableType = h.TableID.String()

// Check whether we need to stop the parsing
if shouldStopPSIParsing(h.TableType) {
Expand Down Expand Up @@ -262,46 +265,55 @@ func hasCRC32(tableType string) bool {
// psiTableType 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
func psiTableType(tableID int) string {
func (t PSITableTypeId) String() string {
asticode marked this conversation as resolved.
Show resolved Hide resolved
switch {
case tableID == PSITableTypeIdBAT:
case t == PSITableTypeIdBAT:
return PSITableTypeBAT
case tableID >= PSITableTypeIdEITStart && tableID <= PSITableTypeIdEITEnd:
case t >= PSITableTypeIdEITStart && t <= PSITableTypeIdEITEnd:
return PSITableTypeEIT
case tableID == PSITableTypeIdDIT:
case t == PSITableTypeIdDIT:
return PSITableTypeDIT
case tableID == PSITableTypeIdNITVariant1, tableID == PSITableTypeIdNITVariant2:
case t == PSITableTypeIdNITVariant1, t == PSITableTypeIdNITVariant2:
return PSITableTypeNIT
case tableID == PSITableTypeIdNull:
case t == PSITableTypeIdNull:
return PSITableTypeNull
case tableID == PSITableTypeIdPAT:
case t == PSITableTypeIdPAT:
return PSITableTypePAT
case tableID == PSITableTypeIdPMT:
case t == PSITableTypeIdPMT:
return PSITableTypePMT
case tableID == PSITableTypeIdRST:
case t == PSITableTypeIdRST:
return PSITableTypeRST
case tableID == PSITableTypeIdSDTVariant1, tableID == PSITableTypeIdSDTVariant2:
case t == PSITableTypeIdSDTVariant1, t == PSITableTypeIdSDTVariant2:
return PSITableTypeSDT
case tableID == PSITableTypeIdSIT:
case t == PSITableTypeIdSIT:
return PSITableTypeSIT
case tableID == PSITableTypeIdST:
case t == PSITableTypeIdST:
return PSITableTypeST
case tableID == PSITableTypeIdTDT:
case t == PSITableTypeIdTDT:
return PSITableTypeTDT
case tableID == PSITableTypeIdTOT:
case t == PSITableTypeIdTOT:
return PSITableTypeTOT
default:
return PSITableTypeUnknown
}
}

// hasPSISyntaxHeader checks whether the section has a syntax header
func (t PSITableTypeId) hasPSISyntaxHeader() bool {
return t == PSITableTypeIdPAT ||
t == PSITableTypeIdPMT ||
t == PSITableTypeIdNITVariant1 || t == PSITableTypeIdNITVariant2 ||
t == PSITableTypeIdSDTVariant1 || t == PSITableTypeIdSDTVariant2 ||
(t >= PSITableTypeIdEITStart && t <= PSITableTypeIdEITEnd)
}

// parsePSISectionSyntax parses a PSI section syntax
func parsePSISectionSyntax(i *astikit.BytesIterator, h *PSISectionHeader, offsetSectionsEnd int) (s *PSISectionSyntax, err error) {
// Init
s = &PSISectionSyntax{}

// Header
if hasPSISyntaxHeader(h.TableType) {
if h.TableID.hasPSISyntaxHeader() {
if s.Header, err = parsePSISectionSyntaxHeader(i); err != nil {
err = fmt.Errorf("astits: parsing PSI section syntax header failed: %w", err)
return
Expand All @@ -316,15 +328,6 @@ func parsePSISectionSyntax(i *astikit.BytesIterator, h *PSISectionHeader, offset
return
}

// hasPSISyntaxHeader checks whether the section has a syntax header
func hasPSISyntaxHeader(tableType string) bool {
return tableType == PSITableTypeEIT ||
tableType == PSITableTypeNIT ||
tableType == PSITableTypePAT ||
tableType == PSITableTypePMT ||
tableType == PSITableTypeSDT
}

// parsePSISectionSyntaxHeader parses a PSI section syntax header
func parsePSISectionSyntaxHeader(i *astikit.BytesIterator) (h *PSISectionSyntaxHeader, err error) {
// Init
Expand Down Expand Up @@ -463,7 +466,7 @@ func writePSIData(w *astikit.BitsWriter, d *PSIData) (int, error) {
}

for _, s := range d.Sections {
s.Header.TableType = psiTableType(s.Header.TableID)
s.Header.TableType = s.Header.TableID.String()
n, err := writePSISection(w, s)
if err != nil {
return 0, err
Expand All @@ -476,7 +479,7 @@ func writePSIData(w *astikit.BitsWriter, d *PSIData) (int, error) {

func calcPSISectionLength(s *PSISection) uint16 {
ret := uint16(0)
if hasPSISyntaxHeader(s.Header.TableType) {
if s.Header.TableID.hasPSISyntaxHeader() {
ret += 5 // PSI syntax header length
}

Expand Down Expand Up @@ -536,7 +539,7 @@ func writePSISection(w *astikit.BitsWriter, s *PSISection) (int, error) {

func writePSISectionSyntax(w *astikit.BitsWriter, s *PSISection) (int, error) {
bytesWritten := 0
if hasPSISyntaxHeader(s.Header.TableType) {
if s.Header.TableID.hasPSISyntaxHeader() {
n, err := writePSISectionSyntaxHeader(w, s.Syntax.Header)
if err != nil {
return 0, err
Expand Down
32 changes: 16 additions & 16 deletions data_psi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,24 +221,24 @@ func TestParsePSISectionHeader(t *testing.T) {

func TestPSITableType(t *testing.T) {
for i := PSITableTypeIdEITStart; i <= PSITableTypeIdEITEnd; i++ {
assert.Equal(t, PSITableTypeEIT, psiTableType(i))
assert.Equal(t, PSITableTypeEIT, i.String())
}
assert.Equal(t, PSITableTypeDIT, psiTableType(PSITableTypeIdDIT))
assert.Equal(t, PSITableTypeNIT, psiTableType(PSITableTypeIdNITVariant1))
assert.Equal(t, PSITableTypeNIT, psiTableType(PSITableTypeIdNITVariant2))
assert.Equal(t, PSITableTypeSDT, psiTableType(PSITableTypeIdSDTVariant1))
assert.Equal(t, PSITableTypeSDT, psiTableType(PSITableTypeIdSDTVariant2))
assert.Equal(t, PSITableTypeDIT, PSITableTypeIdDIT.String())
assert.Equal(t, PSITableTypeNIT, PSITableTypeIdNITVariant1.String())
assert.Equal(t, PSITableTypeNIT, PSITableTypeIdNITVariant2.String())
assert.Equal(t, PSITableTypeSDT, PSITableTypeIdSDTVariant1.String())
assert.Equal(t, PSITableTypeSDT, PSITableTypeIdSDTVariant2.String())

assert.Equal(t, PSITableTypeBAT, psiTableType(PSITableTypeIdBAT))
assert.Equal(t, PSITableTypeNull, psiTableType(PSITableTypeIdNull))
assert.Equal(t, PSITableTypePAT, psiTableType(PSITableTypeIdPAT))
assert.Equal(t, PSITableTypePMT, psiTableType(PSITableTypeIdPMT))
assert.Equal(t, PSITableTypeRST, psiTableType(PSITableTypeIdRST))
assert.Equal(t, PSITableTypeSIT, psiTableType(PSITableTypeIdSIT))
assert.Equal(t, PSITableTypeST, psiTableType(PSITableTypeIdST))
assert.Equal(t, PSITableTypeTDT, psiTableType(PSITableTypeIdTDT))
assert.Equal(t, PSITableTypeTOT, psiTableType(PSITableTypeIdTOT))
assert.Equal(t, PSITableTypeUnknown, psiTableType(1))
assert.Equal(t, PSITableTypeBAT, PSITableTypeIdBAT.String())
assert.Equal(t, PSITableTypeNull, PSITableTypeIdNull.String())
assert.Equal(t, PSITableTypePAT, PSITableTypeIdPAT.String())
assert.Equal(t, PSITableTypePMT, PSITableTypeIdPMT.String())
assert.Equal(t, PSITableTypeRST, PSITableTypeIdRST.String())
assert.Equal(t, PSITableTypeSIT, PSITableTypeIdSIT.String())
assert.Equal(t, PSITableTypeST, PSITableTypeIdST.String())
assert.Equal(t, PSITableTypeTDT, PSITableTypeIdTDT.String())
assert.Equal(t, PSITableTypeTOT, PSITableTypeIdTOT.String())
assert.Equal(t, PSITableTypeUnknown, PSITableTypeId(1).String())
}

var psiSectionSyntaxHeader = &PSISectionSyntaxHeader{
Expand Down
2 changes: 1 addition & 1 deletion es-split/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func main() {

if !pmtsPrinted {
log.Printf("\t\tES PID %d type %s",
es.ElementaryPID, astits.StreamTypeString(es.StreamType),
es.ElementaryPID, es.StreamType.String(),
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions muxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (m *Muxer) generatePAT() error {
Header: &PSISectionHeader{
SectionLength: calcPATSectionLength(d),
SectionSyntaxIndicator: true,
TableID: int(d.TransportStreamID),
TableID: PSITableTypeId(d.TransportStreamID),
},
Syntax: syntax,
}
Expand Down Expand Up @@ -392,7 +392,7 @@ func (m *Muxer) generatePMT() error {
}

// TODO move it somewhere
func pmtStreamTypeToPESStreamID(pmtStreamType uint8) uint8 {
func pmtStreamTypeToPESStreamID(pmtStreamType StreamType) uint8 {
asticode marked this conversation as resolved.
Show resolved Hide resolved
switch pmtStreamType {
case StreamTypeMPEG1Video, StreamTypeMPEG2Video, StreamTypeMPEG4Video, StreamTypeH264Video,
StreamTypeH265Video, StreamTypeCAVSVideo, StreamTypeVC1Video:
Expand Down
Loading