This commit is contained in:
Unknown 2018-03-14 11:48:03 +10:30
parent 431b2c4a5f
commit 86bc3602d7
18 changed files with 278 additions and 286 deletions

View File

@ -183,7 +183,6 @@ func isSequenceHeader(frame []byte) bool {
return false
}
// generate takes in raw video data from the input chan and packetises it into
// flv tags, which are then passed to the output channel.
func (g *flvGenerator) generate() {

View File

@ -32,9 +32,7 @@ import (
/*
"../mpegts"
"../pes"
*/
)
*/)
// TODO: really need to finish the at and pmt stuff - this is too hacky
var (

View File

@ -29,8 +29,8 @@ LICENSE
package mpegts
import (
"testing"
_ "fmt"
"testing"
)
// Just ensure that we can create a byte slice with a mpegts packet correctly

View File

@ -29,9 +29,9 @@ package parser
import (
//"bitbucket.org/ausocean/av/itut"
_ "fmt"
"log"
"sync"
_"fmt"
)
// h264 consts

View File

@ -1,10 +1,10 @@
package parser
import (
"testing"
"strconv"
"os"
"fmt"
"os"
"strconv"
"testing"
)
const (

View File

@ -28,7 +28,6 @@ package pes
import (
"bitbucket.org/ausocean/av/tools"
//"../tools"
)

View File

@ -42,8 +42,8 @@ func TestPesToByteSlice(t *testing.T) {
PDI: byte(2),
PTS: 100000,
HeaderLength: byte(10),
Stuff: []byte{0xFF,0xFF,},
Data: []byte{ 0xEA, 0x4B, 0x12, },
Stuff: []byte{0xFF, 0xFF},
Data: []byte{0xEA, 0x4B, 0x12},
}
pesExpectedOutput := []byte{
0x00, // packet start code prefix byte 1

View File

@ -32,7 +32,6 @@ import (
"strconv"
"bitbucket.org/ausocean/utils/smartLogger"
//"../../utils/smartLogger"
)
@ -45,6 +44,7 @@ type Config struct {
RtmpEncodingMethod uint8
RtmpMethod uint8
Packetization uint8
QuantizationMode uint8
FramesPerClip int
RtmpUrl string
Bitrate string

View File

@ -42,8 +42,8 @@ import (
"strconv"
"time"
"bitbucket.org/ausocean/av/parser"
"bitbucket.org/ausocean/av/generator"
"bitbucket.org/ausocean/av/parser"
"bitbucket.org/ausocean/av/ringbuffer"
"bitbucket.org/ausocean/av/rtmp"
/*
@ -51,8 +51,7 @@ import (
"../parser"
"../ringbuffer"
"../rtmp"
*/
)
*/)
// Misc constants
const (
@ -523,7 +522,6 @@ func (r *revidInst)testRtmp(delayTime uint){
}
}
// readCamera reads data from the defined camera while the revidInst is running.
// TODO: use ringbuffer here instead of allocating mem every time!
func (r *revidInst) readCamera() {

View File

@ -169,15 +169,15 @@ func TestRtmpOutputUsingLibRtmp(t *testing.T){
}
*/
// Test revidInst with a Raspivid h264 input
func TestRaspividToRtmp(t *testing.T) {
config := Config{
Input: Raspivid,
Output: Rtmp,
RtmpMethod: LibRtmp,
QuantizationMode: QuantizationOff,
RtmpUrl: "rtmp://a.rtmp.youtube.com/live2/w44c-mkuu-aezg-ceb1",
Bitrate: "500000",
FramesPerClip: 1,
Packetization: Flv,
FrameRate: "25",
@ -191,5 +191,3 @@ func TestRaspividToRtmp(t *testing.T){
time.Sleep(43200 * time.Second)
revidInst.Stop()
}

View File

@ -35,9 +35,9 @@ import "C"
import (
"errors"
"unsafe"
_ "fmt"
"sync"
"unsafe"
)
// RTMPSession provides a crude interface for sending flv tags over rtmp
@ -107,6 +107,7 @@ func (s *rtmpSession) EndSession() error {
}
return nil
}
// uintToBool takes a uint and returns the bool equivalent
func uintToBool(x uint) bool {
return x != 0

View File

@ -1,4 +1,3 @@
package rtmp
/*

View File

@ -29,8 +29,8 @@ LICENSE
package tools
import (
_"os"
_ "fmt"
_ "os"
)
func BoolToByte(in bool) (out byte) {