diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 358985e1..a1c1d95f 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -36,9 +36,9 @@ import ( "strings" "time" + "bitbucket.org/ausocean/av/container/mts" + "bitbucket.org/ausocean/av/container/mts/meta" "bitbucket.org/ausocean/av/revid" - "bitbucket.org/ausocean/av/stream/mts" - "bitbucket.org/ausocean/av/stream/mts/meta" "bitbucket.org/ausocean/iot/pi/netsender" "bitbucket.org/ausocean/iot/pi/sds" "bitbucket.org/ausocean/iot/pi/smartlogger" diff --git a/audio/adpcm/adpcm.go b/codec/adpcm/adpcm.go similarity index 100% rename from audio/adpcm/adpcm.go rename to codec/adpcm/adpcm.go diff --git a/audio/adpcm/adpcm_test.go b/codec/adpcm/adpcm_test.go similarity index 100% rename from audio/adpcm/adpcm_test.go rename to codec/adpcm/adpcm_test.go diff --git a/stream/lex/lex.go b/codec/lex/lex.go similarity index 100% rename from stream/lex/lex.go rename to codec/lex/lex.go diff --git a/stream/lex/lex_test.go b/codec/lex/lex_test.go similarity index 100% rename from stream/lex/lex_test.go rename to codec/lex/lex_test.go diff --git a/stream/flv/encoder.go b/container/flv/encoder.go similarity index 100% rename from stream/flv/encoder.go rename to container/flv/encoder.go diff --git a/stream/flv/flv.go b/container/flv/flv.go similarity index 100% rename from stream/flv/flv.go rename to container/flv/flv.go diff --git a/stream/mts/discontinuity.go b/container/mts/discontinuity.go similarity index 100% rename from stream/mts/discontinuity.go rename to container/mts/discontinuity.go diff --git a/stream/mts/encoder.go b/container/mts/encoder.go similarity index 97% rename from stream/mts/encoder.go rename to container/mts/encoder.go index 9ae83909..92e87051 100644 --- a/stream/mts/encoder.go +++ b/container/mts/encoder.go @@ -32,9 +32,9 @@ import ( "io" "time" - "bitbucket.org/ausocean/av/stream/mts/meta" - "bitbucket.org/ausocean/av/stream/mts/pes" - "bitbucket.org/ausocean/av/stream/mts/psi" + "bitbucket.org/ausocean/av/container/mts/meta" + "bitbucket.org/ausocean/av/container/mts/pes" + "bitbucket.org/ausocean/av/container/mts/psi" ) // Some common manifestations of PSI diff --git a/stream/mts/meta/meta.go b/container/mts/meta/meta.go similarity index 100% rename from stream/mts/meta/meta.go rename to container/mts/meta/meta.go diff --git a/stream/mts/meta/meta_test.go b/container/mts/meta/meta_test.go similarity index 100% rename from stream/mts/meta/meta_test.go rename to container/mts/meta/meta_test.go diff --git a/stream/mts/metaEncode_test.go b/container/mts/metaEncode_test.go similarity index 97% rename from stream/mts/metaEncode_test.go rename to container/mts/metaEncode_test.go index e970b7c8..00f806b9 100644 --- a/stream/mts/metaEncode_test.go +++ b/container/mts/metaEncode_test.go @@ -31,8 +31,8 @@ import ( "bytes" "testing" - "bitbucket.org/ausocean/av/stream/mts/meta" - "bitbucket.org/ausocean/av/stream/mts/psi" + "bitbucket.org/ausocean/av/container/mts/meta" + "bitbucket.org/ausocean/av/container/mts/psi" ) const ( diff --git a/stream/mts/mpegts.go b/container/mts/mpegts.go similarity index 100% rename from stream/mts/mpegts.go rename to container/mts/mpegts.go diff --git a/stream/mts/pes/pes.go b/container/mts/pes/pes.go similarity index 100% rename from stream/mts/pes/pes.go rename to container/mts/pes/pes.go diff --git a/stream/mts/pes/pes_test.go b/container/mts/pes/pes_test.go similarity index 100% rename from stream/mts/pes/pes_test.go rename to container/mts/pes/pes_test.go diff --git a/stream/mts/psi/crc.go b/container/mts/psi/crc.go similarity index 100% rename from stream/mts/psi/crc.go rename to container/mts/psi/crc.go diff --git a/stream/mts/psi/descriptor_test.go b/container/mts/psi/descriptor_test.go similarity index 100% rename from stream/mts/psi/descriptor_test.go rename to container/mts/psi/descriptor_test.go diff --git a/stream/mts/psi/helpers.go b/container/mts/psi/helpers.go similarity index 100% rename from stream/mts/psi/helpers.go rename to container/mts/psi/helpers.go diff --git a/stream/mts/psi/psi.go b/container/mts/psi/psi.go similarity index 100% rename from stream/mts/psi/psi.go rename to container/mts/psi/psi.go diff --git a/stream/mts/psi/psi_test.go b/container/mts/psi/psi_test.go similarity index 100% rename from stream/mts/psi/psi_test.go rename to container/mts/psi/psi_test.go diff --git a/stream/mts/psi/std.go b/container/mts/psi/std.go similarity index 100% rename from stream/mts/psi/std.go rename to container/mts/psi/std.go diff --git a/exp/adpcm/decode-pcm/decode-pcm.go b/exp/adpcm/decode-pcm/decode-pcm.go index 3b739262..8d2bd7f6 100644 --- a/exp/adpcm/decode-pcm/decode-pcm.go +++ b/exp/adpcm/decode-pcm/decode-pcm.go @@ -34,7 +34,7 @@ import ( "io/ioutil" "log" - "bitbucket.org/ausocean/av/audio/adpcm" + "bitbucket.org/ausocean/av/codec/adpcm" ) // This program accepts an input file encoded in adpcm and outputs a decoded pcm file. diff --git a/exp/adpcm/encode-pcm/encode-pcm.go b/exp/adpcm/encode-pcm/encode-pcm.go index c9796228..d283c822 100644 --- a/exp/adpcm/encode-pcm/encode-pcm.go +++ b/exp/adpcm/encode-pcm/encode-pcm.go @@ -34,7 +34,7 @@ import ( "io/ioutil" "log" - "bitbucket.org/ausocean/av/audio/adpcm" + "bitbucket.org/ausocean/av/codec/adpcm" ) // This program accepts an input pcm file and outputs an encoded adpcm file. diff --git a/exp/ts-repair/main.go b/exp/ts-repair/main.go index 97c350f6..e62a5ffa 100644 --- a/exp/ts-repair/main.go +++ b/exp/ts-repair/main.go @@ -40,7 +40,7 @@ import ( "io" "os" - "bitbucket.org/ausocean/av/stream/mts" + "bitbucket.org/ausocean/av/container/mts" "github.com/Comcast/gots/packet" ) diff --git a/go.mod b/go.mod index 6c6977ea..453a2f38 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/pkg/errors v0.8.1 // indirect github.com/sergi/go-diff v1.0.0 // indirect github.com/stretchr/testify v1.3.0 // indirect + github.com/yobert/alsa v0.0.0-20180630182551-d38d89fa843e go.uber.org/atomic v1.3.2 // indirect go.uber.org/multierr v1.1.0 // indirect go.uber.org/zap v1.9.1 // indirect diff --git a/go.sum b/go.sum index fd14eb02..7a21da57 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,8 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/yobert/alsa v0.0.0-20180630182551-d38d89fa843e h1:3NIzz7weXhh3NToPgbtlQtKiVgerEaG4/nY2skGoGG0= +github.com/yobert/alsa v0.0.0-20180630182551-d38d89fa843e/go.mod h1:CaowXBWOiSGWEpBBV8LoVnQTVPV4ycyviC9IBLj8dRw= go.uber.org/atomic v1.3.2 h1:2Oa65PReHzfn29GpvgsYwloV9AVFHPDk8tYxt2c2tr4= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0 h1:HoEmRHQPVSqub6w2z2d2EOVs2fjyFRGyofhKuyDq0QI= diff --git a/rtmp/NOT_PORTED.txt b/protocol/rtmp/NOT_PORTED.txt similarity index 100% rename from rtmp/NOT_PORTED.txt rename to protocol/rtmp/NOT_PORTED.txt diff --git a/rtmp/amf/amf.go b/protocol/rtmp/amf/amf.go similarity index 100% rename from rtmp/amf/amf.go rename to protocol/rtmp/amf/amf.go diff --git a/rtmp/amf/amf_test.go b/protocol/rtmp/amf/amf_test.go similarity index 100% rename from rtmp/amf/amf_test.go rename to protocol/rtmp/amf/amf_test.go diff --git a/rtmp/conn.go b/protocol/rtmp/conn.go similarity index 99% rename from rtmp/conn.go rename to protocol/rtmp/conn.go index ea8869b9..9b453849 100644 --- a/rtmp/conn.go +++ b/protocol/rtmp/conn.go @@ -39,7 +39,7 @@ import ( "strconv" "time" - "bitbucket.org/ausocean/av/rtmp/amf" + "bitbucket.org/ausocean/av/protocol/rtmp/amf" ) // Conn represents an RTMP connection. diff --git a/rtmp/packet.go b/protocol/rtmp/packet.go similarity index 99% rename from rtmp/packet.go rename to protocol/rtmp/packet.go index b28a1cba..5f46851d 100644 --- a/rtmp/packet.go +++ b/protocol/rtmp/packet.go @@ -38,7 +38,7 @@ import ( "encoding/binary" "io" - "bitbucket.org/ausocean/av/rtmp/amf" + "bitbucket.org/ausocean/av/protocol/rtmp/amf" ) // Packet types. diff --git a/rtmp/parseurl.go b/protocol/rtmp/parseurl.go similarity index 100% rename from rtmp/parseurl.go rename to protocol/rtmp/parseurl.go diff --git a/rtmp/parseurl_test.go b/protocol/rtmp/parseurl_test.go similarity index 99% rename from rtmp/parseurl_test.go rename to protocol/rtmp/parseurl_test.go index 47743693..f6501901 100644 --- a/rtmp/parseurl_test.go +++ b/protocol/rtmp/parseurl_test.go @@ -40,7 +40,7 @@ var parseURLTests = []struct { wantErr error }{ { - url: "rtmp://addr", + url: "rtmp://addr", wantErr: errInvalidURL, }, { diff --git a/rtmp/rtmp.go b/protocol/rtmp/rtmp.go similarity index 99% rename from rtmp/rtmp.go rename to protocol/rtmp/rtmp.go index 3131380c..dcaefe42 100644 --- a/rtmp/rtmp.go +++ b/protocol/rtmp/rtmp.go @@ -43,7 +43,7 @@ import ( "strconv" "time" - "bitbucket.org/ausocean/av/rtmp/amf" + "bitbucket.org/ausocean/av/protocol/rtmp/amf" ) const ( diff --git a/rtmp/rtmp_test.go b/protocol/rtmp/rtmp_test.go similarity index 98% rename from rtmp/rtmp_test.go rename to protocol/rtmp/rtmp_test.go index 8d94ee7e..8ccb2e12 100644 --- a/rtmp/rtmp_test.go +++ b/protocol/rtmp/rtmp_test.go @@ -38,8 +38,8 @@ import ( "testing" "time" - "bitbucket.org/ausocean/av/stream/flv" - "bitbucket.org/ausocean/av/stream/lex" + "bitbucket.org/ausocean/av/codec/lex" + "bitbucket.org/ausocean/av/container/flv" ) const ( diff --git a/stream/rtp/encoder.go b/protocol/rtp/encoder.go similarity index 100% rename from stream/rtp/encoder.go rename to protocol/rtp/encoder.go diff --git a/stream/rtp/rtp.go b/protocol/rtp/rtp.go similarity index 100% rename from stream/rtp/rtp.go rename to protocol/rtp/rtp.go diff --git a/stream/rtp/rtp_test.go b/protocol/rtp/rtp_test.go similarity index 100% rename from stream/rtp/rtp_test.go rename to protocol/rtp/rtp_test.go diff --git a/revid/revid.go b/revid/revid.go index 3b2bc530..adb60a92 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -40,9 +40,9 @@ import ( "sync" "time" - "bitbucket.org/ausocean/av/stream/flv" - "bitbucket.org/ausocean/av/stream/lex" - "bitbucket.org/ausocean/av/stream/mts" + "bitbucket.org/ausocean/av/codec/lex" + "bitbucket.org/ausocean/av/container/flv" + "bitbucket.org/ausocean/av/container/mts" "bitbucket.org/ausocean/iot/pi/netsender" "bitbucket.org/ausocean/utils/logger" "bitbucket.org/ausocean/utils/ring" diff --git a/revid/senders.go b/revid/senders.go index 04c96566..c8ee91f5 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -37,9 +37,9 @@ import ( "github.com/Comcast/gots/packet" - "bitbucket.org/ausocean/av/rtmp" - "bitbucket.org/ausocean/av/stream/mts" - "bitbucket.org/ausocean/av/stream/rtp" + "bitbucket.org/ausocean/av/container/mts" + "bitbucket.org/ausocean/av/protocol/rtmp" + "bitbucket.org/ausocean/av/protocol/rtp" "bitbucket.org/ausocean/iot/pi/netsender" "bitbucket.org/ausocean/utils/logger" ) diff --git a/revid/senders_test.go b/revid/senders_test.go index b78fee5e..2f464de0 100644 --- a/revid/senders_test.go +++ b/revid/senders_test.go @@ -38,8 +38,8 @@ import ( "github.com/Comcast/gots/packet" "github.com/Comcast/gots/pes" - "bitbucket.org/ausocean/av/stream/mts" - "bitbucket.org/ausocean/av/stream/mts/meta" + "bitbucket.org/ausocean/av/container/mts" + "bitbucket.org/ausocean/av/container/mts/meta" "bitbucket.org/ausocean/utils/logger" "bitbucket.org/ausocean/utils/ring" )