mirror of https://bitbucket.org/ausocean/av.git
mts: added full stops to some comments
This commit is contained in:
parent
ebd6d5816d
commit
b75dfaa4de
|
@ -38,7 +38,7 @@ import (
|
||||||
|
|
||||||
// Some common manifestations of PSI
|
// Some common manifestations of PSI
|
||||||
var (
|
var (
|
||||||
// PSI struct to represent basic pat
|
// PSI struct to represent basic pat.
|
||||||
StandardPat = psi.PSI{
|
StandardPat = psi.PSI{
|
||||||
Pf: 0x00,
|
Pf: 0x00,
|
||||||
Tid: 0x00,
|
Tid: 0x00,
|
||||||
|
@ -58,7 +58,7 @@ var (
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// PSI struct to represent basic pmt without descriptors for time and location
|
// PSI struct to represent basic pmt without descriptors for time and location.
|
||||||
StandardPmt = psi.PSI{
|
StandardPmt = psi.PSI{
|
||||||
Pf: 0x00,
|
Pf: 0x00,
|
||||||
Tid: 0x02,
|
Tid: 0x02,
|
||||||
|
@ -82,7 +82,7 @@ var (
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Std pmt with time and location descriptors, time and location fields are zeroed out
|
// Std pmt with time and location descriptors, time and location fields are zeroed out.
|
||||||
StandardPmtTimeLocation = psi.PSI{
|
StandardPmtTimeLocation = psi.PSI{
|
||||||
Pf: 0x00,
|
Pf: 0x00,
|
||||||
Tid: 0x02,
|
Tid: 0x02,
|
||||||
|
@ -155,7 +155,7 @@ const (
|
||||||
// Time related constants.
|
// Time related constants.
|
||||||
const (
|
const (
|
||||||
// ptsOffset is the offset added to the clock to determine
|
// ptsOffset is the offset added to the clock to determine
|
||||||
// the current presentation timestamp,
|
// the current presentation timestamp.
|
||||||
ptsOffset = 700 * time.Millisecond
|
ptsOffset = 700 * time.Millisecond
|
||||||
|
|
||||||
// pcrFreq is the base Program Clock Reference frequency.
|
// pcrFreq is the base Program Clock Reference frequency.
|
||||||
|
@ -202,7 +202,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
// generate handles the incoming data and generates equivalent mpegts packets -
|
// generate handles the incoming data and generates equivalent mpegts packets -
|
||||||
// sending them to the output channel
|
// sending them to the output channel.
|
||||||
func (e *Encoder) Encode(nalu []byte) error {
|
func (e *Encoder) Encode(nalu []byte) error {
|
||||||
|
|
||||||
// Prepare PES data.
|
// Prepare PES data.
|
||||||
|
@ -255,7 +255,7 @@ func (e *Encoder) Encode(nalu []byte) error {
|
||||||
// writePSI creates mpegts with pat and pmt tables - with pmt table having updated
|
// writePSI creates mpegts with pat and pmt tables - with pmt table having updated
|
||||||
// location and time data.
|
// location and time data.
|
||||||
func (e *Encoder) writePSI() error {
|
func (e *Encoder) writePSI() error {
|
||||||
// Write PAT
|
// Write PAT.
|
||||||
patPkt := Packet{
|
patPkt := Packet{
|
||||||
PUSI: true,
|
PUSI: true,
|
||||||
PID: patPid,
|
PID: patPid,
|
||||||
|
@ -268,7 +268,7 @@ func (e *Encoder) writePSI() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update pmt table time and location
|
// Update pmt table time and location.
|
||||||
err = psi.UpdateTime(pmtTable, metaData.Time)
|
err = psi.UpdateTime(pmtTable, metaData.Time)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -278,7 +278,7 @@ func (e *Encoder) writePSI() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create mts packet from pmt table
|
// Create mts packet from pmt table.
|
||||||
pmtPkt := Packet{
|
pmtPkt := Packet{
|
||||||
PUSI: true,
|
PUSI: true,
|
||||||
PID: pmtPid,
|
PID: pmtPid,
|
||||||
|
@ -295,7 +295,7 @@ func (e *Encoder) writePSI() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// addPadding adds an appropriate amount of padding to a pat or pmt table for
|
// addPadding adds an appropriate amount of padding to a pat or pmt table for
|
||||||
// addition to an mpegts packet
|
// addition to an mpegts packet.
|
||||||
func addPadding(d []byte) []byte {
|
func addPadding(d []byte) []byte {
|
||||||
for len(d) < psiPacketSize {
|
for len(d) < psiPacketSize {
|
||||||
d = append(d, 0xff)
|
d = append(d, 0xff)
|
||||||
|
|
Loading…
Reference in New Issue