From 3a736172eea93d5c60a6b292ac02389a184db519 Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 25 Mar 2019 11:34:56 +1030 Subject: [PATCH 1/5] av: restructured directories --- {audio => codec}/adpcm/adpcm.go | 0 {audio => codec}/adpcm/adpcm_test.go | 0 {stream => codec}/lex/lex.go | 0 {stream => codec}/lex/lex_test.go | 0 {stream => container}/encoding.go | 0 {stream => container}/flv/encoder.go | 0 {stream => container}/flv/flv.go | 0 {stream => container}/mts/discontinuity.go | 0 {stream => container}/mts/encoder.go | 0 {stream => container}/mts/meta/meta.go | 0 {stream => container}/mts/meta/meta_test.go | 0 {stream => container}/mts/metaEncode_test.go | 0 {stream => container}/mts/mpegts.go | 0 {stream => container}/mts/pes/pes.go | 0 {stream => container}/mts/pes/pes_test.go | 0 {stream => container}/mts/psi/crc.go | 0 {stream => container}/mts/psi/descriptor_test.go | 0 {stream => container}/mts/psi/helpers.go | 0 {stream => container}/mts/psi/psi.go | 0 {stream => container}/mts/psi/psi_test.go | 0 {stream => container}/mts/psi/std.go | 0 {rtmp => protocol/rtmp}/NOT_PORTED.txt | 0 {rtmp => protocol/rtmp}/amf/amf.go | 0 {rtmp => protocol/rtmp}/amf/amf_test.go | 0 {rtmp => protocol/rtmp}/conn.go | 0 {rtmp => protocol/rtmp}/packet.go | 0 {rtmp => protocol/rtmp}/parseurl.go | 0 {rtmp => protocol/rtmp}/parseurl_test.go | 0 {rtmp => protocol/rtmp}/rtmp.go | 0 {rtmp => protocol/rtmp}/rtmp_test.go | 0 {stream => protocol}/rtp/encoder.go | 0 {stream => protocol}/rtp/rtp.go | 0 {stream => protocol}/rtp/rtp_test.go | 0 33 files changed, 0 insertions(+), 0 deletions(-) rename {audio => codec}/adpcm/adpcm.go (100%) rename {audio => codec}/adpcm/adpcm_test.go (100%) rename {stream => codec}/lex/lex.go (100%) rename {stream => codec}/lex/lex_test.go (100%) rename {stream => container}/encoding.go (100%) rename {stream => container}/flv/encoder.go (100%) rename {stream => container}/flv/flv.go (100%) rename {stream => container}/mts/discontinuity.go (100%) rename {stream => container}/mts/encoder.go (100%) rename {stream => container}/mts/meta/meta.go (100%) rename {stream => container}/mts/meta/meta_test.go (100%) rename {stream => container}/mts/metaEncode_test.go (100%) rename {stream => container}/mts/mpegts.go (100%) rename {stream => container}/mts/pes/pes.go (100%) rename {stream => container}/mts/pes/pes_test.go (100%) rename {stream => container}/mts/psi/crc.go (100%) rename {stream => container}/mts/psi/descriptor_test.go (100%) rename {stream => container}/mts/psi/helpers.go (100%) rename {stream => container}/mts/psi/psi.go (100%) rename {stream => container}/mts/psi/psi_test.go (100%) rename {stream => container}/mts/psi/std.go (100%) rename {rtmp => protocol/rtmp}/NOT_PORTED.txt (100%) rename {rtmp => protocol/rtmp}/amf/amf.go (100%) rename {rtmp => protocol/rtmp}/amf/amf_test.go (100%) rename {rtmp => protocol/rtmp}/conn.go (100%) rename {rtmp => protocol/rtmp}/packet.go (100%) rename {rtmp => protocol/rtmp}/parseurl.go (100%) rename {rtmp => protocol/rtmp}/parseurl_test.go (100%) rename {rtmp => protocol/rtmp}/rtmp.go (100%) rename {rtmp => protocol/rtmp}/rtmp_test.go (100%) rename {stream => protocol}/rtp/encoder.go (100%) rename {stream => protocol}/rtp/rtp.go (100%) rename {stream => protocol}/rtp/rtp_test.go (100%) 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/encoding.go b/container/encoding.go similarity index 100% rename from stream/encoding.go rename to container/encoding.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 100% rename from stream/mts/encoder.go rename to container/mts/encoder.go 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 100% rename from stream/mts/metaEncode_test.go rename to container/mts/metaEncode_test.go 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/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 100% rename from rtmp/conn.go rename to protocol/rtmp/conn.go diff --git a/rtmp/packet.go b/protocol/rtmp/packet.go similarity index 100% rename from rtmp/packet.go rename to protocol/rtmp/packet.go 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 100% rename from rtmp/parseurl_test.go rename to protocol/rtmp/parseurl_test.go diff --git a/rtmp/rtmp.go b/protocol/rtmp/rtmp.go similarity index 100% rename from rtmp/rtmp.go rename to protocol/rtmp/rtmp.go diff --git a/rtmp/rtmp_test.go b/protocol/rtmp/rtmp_test.go similarity index 100% rename from rtmp/rtmp_test.go rename to protocol/rtmp/rtmp_test.go 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 From 5366eca2f2cd24e3b1267fff57ab8d89d713ae97 Mon Sep 17 00:00:00 2001 From: Saxon Date: Mon, 25 Mar 2019 11:51:03 +1030 Subject: [PATCH 2/5] av: fixed imports --- cmd/revid-cli/main.go | 4 ++-- codec/lex/lex.go | 2 +- container/mts/encoder.go | 6 +++--- container/mts/metaEncode_test.go | 4 ++-- protocol/rtmp/conn.go | 2 +- protocol/rtmp/packet.go | 2 +- protocol/rtmp/parseurl_test.go | 2 +- protocol/rtmp/rtmp.go | 2 +- protocol/rtmp/rtmp_test.go | 4 ++-- revid/revid.go | 8 ++++---- revid/senders.go | 6 +++--- revid/senders_test.go | 4 ++-- 12 files changed, 23 insertions(+), 23 deletions(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index af87b38e..6174e4db 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/codec/lex/lex.go b/codec/lex/lex.go index a6275799..9d3bb894 100644 --- a/codec/lex/lex.go +++ b/codec/lex/lex.go @@ -35,7 +35,7 @@ import ( "io" "time" - "bitbucket.org/ausocean/av/stream" + "bitbucket.org/ausocean/av/container" ) var noDelay = make(chan time.Time) diff --git a/container/mts/encoder.go b/container/mts/encoder.go index b1e098a4..6f6cada2 100644 --- a/container/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/container/mts/metaEncode_test.go b/container/mts/metaEncode_test.go index e970b7c8..00f806b9 100644 --- a/container/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/protocol/rtmp/conn.go b/protocol/rtmp/conn.go index ea8869b9..9b453849 100644 --- a/protocol/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/protocol/rtmp/packet.go b/protocol/rtmp/packet.go index b28a1cba..5f46851d 100644 --- a/protocol/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/protocol/rtmp/parseurl_test.go b/protocol/rtmp/parseurl_test.go index 47743693..f6501901 100644 --- a/protocol/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/protocol/rtmp/rtmp.go b/protocol/rtmp/rtmp.go index 3131380c..dcaefe42 100644 --- a/protocol/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/protocol/rtmp/rtmp_test.go b/protocol/rtmp/rtmp_test.go index 8d94ee7e..8ccb2e12 100644 --- a/protocol/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/revid/revid.go b/revid/revid.go index 198bc547..57704957 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -40,10 +40,10 @@ import ( "sync" "time" - "bitbucket.org/ausocean/av/stream" - "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" + "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 ac76736e..d0d8d2e8 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -36,9 +36,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" "bitbucket.org/ausocean/utils/ring" diff --git a/revid/senders_test.go b/revid/senders_test.go index ad4a18ba..b75848c4 100644 --- a/revid/senders_test.go +++ b/revid/senders_test.go @@ -37,8 +37,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" ) From de172bd0a1dba6345cf851624e16a922a7e3f574 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 28 Mar 2019 11:28:46 +1030 Subject: [PATCH 3/5] av: updated go.mod --- go.mod | 1 + 1 file changed, 1 insertion(+) 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 From da54f7af270d704d1128f79ea364870fd2d68c23 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 28 Mar 2019 11:35:32 +1030 Subject: [PATCH 4/5] av: fixed remaining import errors --- exp/adpcm/decode-pcm/decode-pcm.go | 2 +- exp/adpcm/encode-pcm/encode-pcm.go | 2 +- exp/ts-repair/main.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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" ) From a67844e1c61ed03cc00585571e605ddd916c0d06 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 28 Mar 2019 12:34:54 +1030 Subject: [PATCH 5/5] av: adding go.sum --- go.sum | 2 ++ 1 file changed, 2 insertions(+) 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=