mirror of https://bitbucket.org/ausocean/av.git
Need to debug on my puter, so updating remote
This commit is contained in:
parent
309de69964
commit
72de1758ed
|
@ -60,7 +60,6 @@ func (p* H264Parser)Parse() {
|
|||
p.isParsing = true
|
||||
outputBuffer := make([]byte, 0, 10000)
|
||||
searchingForEnd := false
|
||||
p.InputByteChan = make(chan byte, 10000)
|
||||
for p.isParsing {
|
||||
aByte := <-p.InputByteChan
|
||||
outputBuffer = append(outputBuffer, aByte)
|
||||
|
@ -77,8 +76,6 @@ func (p* H264Parser)Parse() {
|
|||
aByte = <-p.InputByteChan
|
||||
outputBuffer = append(outputBuffer, aByte)
|
||||
if nalType := aByte & 0x1F; nalType == 1 || nalType == 5 {
|
||||
if firstRunThrough {
|
||||
spsPpsSei = append(spsPpsSei,
|
||||
searchingForEnd = true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,6 @@ package mpegts
|
|||
import (
|
||||
"bitbucket.org/ausocean/av/tools"
|
||||
"errors"
|
||||
_"fmt"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -135,9 +134,13 @@ func (p *MpegTsPacket) FillPayload(channel chan byte){
|
|||
p.Payload = make([]byte,0,mpegtsPayloadSize)
|
||||
currentPktLength := 6 + int(tools.BoolToByte(p.PCRF))*6+int(tools.BoolToByte(p.OPCRF))*6+
|
||||
int(tools.BoolToByte(p.SPF))*1+int(tools.BoolToByte(p.TPDF))*1+len(p.TPD)
|
||||
for len(channel) > 0 && (currentPktLength+len(p.Payload)) < 188 {
|
||||
nextByte := <-channel
|
||||
p.Payload = append(p.Payload,nextByte)
|
||||
for (currentPktLength+len(p.Payload)) < 188 {
|
||||
select {
|
||||
case nextByte := <-channel:
|
||||
p.Payload = append(p.Payload,nextByte)
|
||||
default:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,6 +143,7 @@ func NewRevidInstance(config Config) (r *revidInst, err error) {
|
|||
}
|
||||
r.generator = tsgenerator.NewTsGenerator(framesPerSec)
|
||||
r.h264Parser = h264.H264Parser{OutputChan: r.generator.GetNalInputChan()}
|
||||
r.h264Parser.InputByteChan = make(chan byte, 10000)
|
||||
// TODO: Need to create constructor for parser otherwise I'm going to break
|
||||
// something eventuallyl
|
||||
go r.h264Parser.Parse()
|
||||
|
@ -162,7 +163,7 @@ func (r *revidInst) Start() {
|
|||
switch r.config.Input {
|
||||
case Raspivid:
|
||||
cmd = exec.Command("raspivid", "-o", "-", "-n", "-t", "0", "-b",
|
||||
r.config.Bitrate, "-w", r.config.Width, "-h", r.config.Height, "-fps", r.config.FrameRate)
|
||||
r.config.Bitrate, "-w", r.config.Width, "-h", r.config.Height, "-fps", r.config.FrameRate, "-ih", "-g", "100")
|
||||
stdout, _ := cmd.StdoutPipe()
|
||||
err := cmd.Start()
|
||||
inputReader = bufio.NewReader(stdout)
|
||||
|
|
|
@ -29,7 +29,7 @@ LICENSE
|
|||
package tsgenerator
|
||||
|
||||
import (
|
||||
_ "fmt"
|
||||
"fmt"
|
||||
_"os"
|
||||
"bitbucket.org/ausocean/av/mpegts"
|
||||
"bitbucket.org/ausocean/av/pes"
|
||||
|
@ -270,6 +270,7 @@ func (g *tsGenerator) Generate() {
|
|||
}
|
||||
}
|
||||
}
|
||||
fmt.Println("\n\n\nGetting out of generate!\n\n\n")
|
||||
}
|
||||
|
||||
func (g *tsGenerator) getCC(pid int) int {
|
||||
|
|
Loading…
Reference in New Issue