mirror of https://bitbucket.org/ausocean/av.git
mts: made psi counter max packet interval const
This commit is contained in:
parent
7a1c628731
commit
2ff7e6318d
|
@ -38,7 +38,10 @@ import (
|
||||||
"bitbucket.org/ausocean/av/stream/mts/pes"
|
"bitbucket.org/ausocean/av/stream/mts/pes"
|
||||||
)
|
)
|
||||||
|
|
||||||
const psiPacketSize = 184
|
const (
|
||||||
|
psiPacketSize = 184
|
||||||
|
psiSendCount = 100
|
||||||
|
)
|
||||||
|
|
||||||
// TODO: really need to finish the at and pmt stuff - this is too hacky
|
// TODO: really need to finish the at and pmt stuff - this is too hacky
|
||||||
var (
|
var (
|
||||||
|
@ -197,7 +200,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 {
|
||||||
if e.psiCount == 0 {
|
if e.psiCount <= 0 {
|
||||||
// Write PAT
|
// Write PAT
|
||||||
patPkt := Packet{
|
patPkt := Packet{
|
||||||
PUSI: true,
|
PUSI: true,
|
||||||
|
@ -223,7 +226,7 @@ func (e *Encoder) Encode(nalu []byte) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
e.psiCount = 100
|
e.psiCount = psiSendCount
|
||||||
}
|
}
|
||||||
e.psiCount -= 1
|
e.psiCount -= 1
|
||||||
// Prepare PES data.
|
// Prepare PES data.
|
||||||
|
|
Loading…
Reference in New Issue