From 9be2f95befa8db2795a25584a9348e2e448e06c6 Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 2 Mar 2019 13:21:46 +1030 Subject: [PATCH] stream/mts: improved and added commenting --- stream/mts/encoder.go | 4 ++++ stream/mts/mpegts.go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index 74df4746..b1e098a4 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -168,6 +168,10 @@ const ( hasPTS = 0x2 ) +// TimeBasedPsi allows for the setting of the PSI writing method, therefore, if +// PSI is written based on some time duration, or based on a packet count. +// If b is true, then time based PSI is used, otherwise the PSI is written +// every sendCount. func (e *Encoder) TimeBasedPsi(b bool, sendCount int) { e.timeBasedPsi = b e.psiSendCount = sendCount diff --git a/stream/mts/mpegts.go b/stream/mts/mpegts.go index a3908659..18fe8b5f 100644 --- a/stream/mts/mpegts.go +++ b/stream/mts/mpegts.go @@ -62,9 +62,9 @@ const ( AdaptationFieldsIdx = AdaptationIdx + 1 // Adaptation field index is the index of the adaptation fields. DefaultAdaptationSize = 2 // Default size of the adaptation field. AdaptationControlMask = 0x30 // Mask for the adaptation field control in octet 3. - DefaultAdaptationBodySize = 1 - DiscontinuityIndicatorMask = 0x80 - DiscontinuityIndicatorIdx = AdaptationIdx + 1 + DefaultAdaptationBodySize = 1 // Default size of the adaptation field body. + DiscontinuityIndicatorMask = 0x80 // Mask for the discontinuity indicator at the discontinuity indicator idk. + DiscontinuityIndicatorIdx = AdaptationIdx + 1 // The index at which the discontinuity indicator is found in an MTS packet. ) // TODO: make this better - currently doesn't make sense.