mirror of https://bitbucket.org/ausocean/av.git
go fmted
This commit is contained in:
parent
431b2c4a5f
commit
86bc3602d7
|
@ -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() {
|
||||
|
|
|
@ -32,9 +32,7 @@ import (
|
|||
/*
|
||||
"../mpegts"
|
||||
"../pes"
|
||||
*/
|
||||
|
||||
)
|
||||
*/)
|
||||
|
||||
// TODO: really need to finish the at and pmt stuff - this is too hacky
|
||||
var (
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -29,9 +29,9 @@ package parser
|
|||
|
||||
import (
|
||||
//"bitbucket.org/ausocean/av/itut"
|
||||
_ "fmt"
|
||||
"log"
|
||||
"sync"
|
||||
_"fmt"
|
||||
)
|
||||
|
||||
// h264 consts
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package parser
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"strconv"
|
||||
"os"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"testing"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -28,7 +28,6 @@ package pes
|
|||
|
||||
import (
|
||||
"bitbucket.org/ausocean/av/tools"
|
||||
|
||||
//"../tools"
|
||||
)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package rtmp
|
||||
|
||||
/*
|
||||
|
|
|
@ -29,8 +29,8 @@ LICENSE
|
|||
package tools
|
||||
|
||||
import (
|
||||
_"os"
|
||||
_ "fmt"
|
||||
_ "os"
|
||||
)
|
||||
|
||||
func BoolToByte(in bool) (out byte) {
|
||||
|
|
Loading…
Reference in New Issue