From bc882c1e7cde87db32b925b8ca6540376f6f2339 Mon Sep 17 00:00:00 2001 From: Ruben Cid Date: Wed, 8 Apr 2020 17:27:27 +0200 Subject: [PATCH] current remopo --- container/flv/demuxer.go | 2 +- container/flv/muxer.go | 10 +++++----- container/flv/tag.go | 2 +- container/ts/muxer.go | 2 +- container/ts/muxer_test.go | 3 ++- go.mod | 1 - go.sum | 6 ------ main.go | 10 +++++----- parser/aac/parser.go | 2 +- parser/parser.go | 8 ++++---- protocol/hls/hls.go | 5 +++-- protocol/hls/source.go | 8 ++++---- protocol/httpflv/server.go | 4 ++-- protocol/httpflv/writer.go | 8 ++++---- protocol/httpopera/http_opera.go | 9 +++++---- protocol/rtmp/cache/cache.go | 2 +- protocol/rtmp/cache/gop.go | 2 +- protocol/rtmp/cache/special.go | 4 ++-- protocol/rtmp/core/chunk_stream.go | 4 ++-- protocol/rtmp/core/chunk_stream_test.go | 3 ++- protocol/rtmp/core/conn.go | 4 ++-- protocol/rtmp/core/conn_client.go | 4 ++-- protocol/rtmp/core/conn_server.go | 4 ++-- protocol/rtmp/core/conn_test.go | 3 ++- protocol/rtmp/core/handshake.go | 2 +- protocol/rtmp/rtmp.go | 10 +++++----- protocol/rtmp/rtmprelay/rtmprelay.go | 4 ++-- protocol/rtmp/rtmprelay/staticrelay.go | 6 +++--- protocol/rtmp/stream.go | 9 +++++---- utils/queue/queue.go | 2 +- 30 files changed, 71 insertions(+), 72 deletions(-) diff --git a/container/flv/demuxer.go b/container/flv/demuxer.go index 2c205ba3..bfcc7842 100755 --- a/container/flv/demuxer.go +++ b/container/flv/demuxer.go @@ -3,7 +3,7 @@ package flv import ( "errors" - "github.com/gwuhaolin/livego/av" + "livego/av" ) var ( diff --git a/container/flv/muxer.go b/container/flv/muxer.go index 08cc266c..a7eaa884 100755 --- a/container/flv/muxer.go +++ b/container/flv/muxer.go @@ -9,15 +9,15 @@ import ( "strings" "time" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/amf" - "github.com/gwuhaolin/livego/utils/pio" - "github.com/gwuhaolin/livego/utils/uid" + "livego/av" + "livego/protocol/amf" + "livego/utils/pio" + "livego/utils/uid" ) var ( flvHeader = []byte{0x46, 0x4c, 0x56, 0x01, 0x05, 0x00, 0x00, 0x00, 0x09} - flvDir = flag.String("flvDir", "tmp", "output flv file at flvDir/APP/KEY_TIME.flv") + flvDir = flag.String("flvDir", "tmp", "output flv file at flvDir/APP/KEY_TIME.flv") ) /* diff --git a/container/flv/tag.go b/container/flv/tag.go index 5c85466e..d2aec4f5 100755 --- a/container/flv/tag.go +++ b/container/flv/tag.go @@ -3,7 +3,7 @@ package flv import ( "fmt" - "github.com/gwuhaolin/livego/av" + "livego/av" ) type flvTag struct { diff --git a/container/ts/muxer.go b/container/ts/muxer.go index cbb9981d..8f7ad3d2 100755 --- a/container/ts/muxer.go +++ b/container/ts/muxer.go @@ -3,7 +3,7 @@ package ts import ( "io" - "github.com/gwuhaolin/livego/av" + "livego/av" ) const ( diff --git a/container/ts/muxer_test.go b/container/ts/muxer_test.go index 52b36685..5ee3cf38 100755 --- a/container/ts/muxer_test.go +++ b/container/ts/muxer_test.go @@ -3,7 +3,8 @@ package ts import ( "testing" - "github.com/gwuhaolin/livego/av" + "livego/av" + "github.com/stretchr/testify/assert" ) diff --git a/go.mod b/go.mod index 6b4faef3..5294b52a 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/go-redis/redis/v7 v7.2.0 github.com/gorilla/mux v1.7.4 // indirect - github.com/gwuhaolin/livego v0.0.0-20191025074832-36aaf27ee5c7 github.com/orcaman/concurrent-map v0.0.0-20190826125027-8c72a8bb44f6 github.com/satori/go.uuid v1.2.0 github.com/smartystreets/goconvey v1.6.4 // indirect diff --git a/go.sum b/go.sum index afae03f0..000ad9eb 100644 --- a/go.sum +++ b/go.sum @@ -6,7 +6,6 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumC github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= github.com/go-redis/redis/v7 v7.2.0 h1:CrCexy/jYWZjW0AyVoHlcJUeZN19VWlbepTh1Vq6dJs= github.com/go-redis/redis/v7 v7.2.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -16,8 +15,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGa github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= -github.com/gwuhaolin/livego v0.0.0-20191025074832-36aaf27ee5c7 h1:Hwr5HBWp2+ftb74B9dgSHgN2Z7ndoYEkX9TqkPeegJ0= -github.com/gwuhaolin/livego v0.0.0-20191025074832-36aaf27ee5c7/go.mod h1:XPGYyS5lXw2ForUaQjb/hJbzhuKPjnLxcGgSWCXZUGQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= @@ -45,8 +42,6 @@ github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -72,7 +67,6 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/main.go b/main.go index 3c2d83f5..09575bc8 100755 --- a/main.go +++ b/main.go @@ -6,11 +6,11 @@ import ( "net" "time" - "github.com/gwuhaolin/livego/configure" - "github.com/gwuhaolin/livego/protocol/hls" - "github.com/gwuhaolin/livego/protocol/httpflv" - "github.com/gwuhaolin/livego/protocol/httpopera" - "github.com/gwuhaolin/livego/protocol/rtmp" + "livego/configure" + "livego/protocol/hls" + "livego/protocol/httpflv" + "livego/protocol/httpopera" + "livego/protocol/rtmp" ) var ( diff --git a/parser/aac/parser.go b/parser/aac/parser.go index e9caf57a..7ad9f05f 100755 --- a/parser/aac/parser.go +++ b/parser/aac/parser.go @@ -4,7 +4,7 @@ import ( "errors" "io" - "github.com/gwuhaolin/livego/av" + "livego/av" ) type mpegExtension struct { diff --git a/parser/parser.go b/parser/parser.go index 05b4d730..31bdd4fa 100755 --- a/parser/parser.go +++ b/parser/parser.go @@ -4,10 +4,10 @@ import ( "errors" "io" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/parser/aac" - "github.com/gwuhaolin/livego/parser/h264" - "github.com/gwuhaolin/livego/parser/mp3" + "livego/av" + "livego/parser/aac" + "livego/parser/h264" + "livego/parser/mp3" ) var ( diff --git a/protocol/hls/hls.go b/protocol/hls/hls.go index 749b81ae..0648f033 100755 --- a/protocol/hls/hls.go +++ b/protocol/hls/hls.go @@ -11,8 +11,9 @@ import ( "strings" "time" - "github.com/gwuhaolin/livego/av" - "github.com/orcaman/concurrent-map" + "livego/av" + + cmap "github.com/orcaman/concurrent-map" ) const ( diff --git a/protocol/hls/source.go b/protocol/hls/source.go index c2fc7a0f..60f4f832 100644 --- a/protocol/hls/source.go +++ b/protocol/hls/source.go @@ -7,10 +7,10 @@ import ( "log" "time" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/container/flv" - "github.com/gwuhaolin/livego/container/ts" - "github.com/gwuhaolin/livego/parser" + "livego/av" + "livego/container/flv" + "livego/container/ts" + "livego/parser" ) const ( diff --git a/protocol/httpflv/server.go b/protocol/httpflv/server.go index 8c46c238..1974dbbf 100644 --- a/protocol/httpflv/server.go +++ b/protocol/httpflv/server.go @@ -7,8 +7,8 @@ import ( "net/http" "strings" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/rtmp" + "livego/av" + "livego/protocol/rtmp" ) type Server struct { diff --git a/protocol/httpflv/writer.go b/protocol/httpflv/writer.go index 70ed67b1..e97e6006 100755 --- a/protocol/httpflv/writer.go +++ b/protocol/httpflv/writer.go @@ -7,10 +7,10 @@ import ( "net/http" "time" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/amf" - "github.com/gwuhaolin/livego/utils/pio" - "github.com/gwuhaolin/livego/utils/uid" + "livego/av" + "livego/protocol/amf" + "livego/utils/pio" + "livego/utils/uid" ) const ( diff --git a/protocol/httpopera/http_opera.go b/protocol/httpopera/http_opera.go index c10b473f..7816cb71 100755 --- a/protocol/httpopera/http_opera.go +++ b/protocol/httpopera/http_opera.go @@ -8,12 +8,13 @@ import ( "net" "net/http" + "livego/av" + "livego/configure" + "livego/protocol/rtmp" + "livego/protocol/rtmp/rtmprelay" + jwtmiddleware "github.com/auth0/go-jwt-middleware" "github.com/dgrijalva/jwt-go" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/configure" - "github.com/gwuhaolin/livego/protocol/rtmp" - "github.com/gwuhaolin/livego/protocol/rtmp/rtmprelay" ) type Response struct { diff --git a/protocol/rtmp/cache/cache.go b/protocol/rtmp/cache/cache.go index a5c604b7..b644e94d 100755 --- a/protocol/rtmp/cache/cache.go +++ b/protocol/rtmp/cache/cache.go @@ -3,7 +3,7 @@ package cache import ( "flag" - "github.com/gwuhaolin/livego/av" + "livego/av" ) var ( diff --git a/protocol/rtmp/cache/gop.go b/protocol/rtmp/cache/gop.go index ececab4b..401bab08 100755 --- a/protocol/rtmp/cache/gop.go +++ b/protocol/rtmp/cache/gop.go @@ -3,7 +3,7 @@ package cache import ( "errors" - "github.com/gwuhaolin/livego/av" + "livego/av" ) var ( diff --git a/protocol/rtmp/cache/special.go b/protocol/rtmp/cache/special.go index 89c9693b..dce82a3f 100755 --- a/protocol/rtmp/cache/special.go +++ b/protocol/rtmp/cache/special.go @@ -4,8 +4,8 @@ import ( "bytes" "log" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/amf" + "livego/av" + "livego/protocol/amf" ) const ( diff --git a/protocol/rtmp/core/chunk_stream.go b/protocol/rtmp/core/chunk_stream.go index 33970c48..379646b2 100755 --- a/protocol/rtmp/core/chunk_stream.go +++ b/protocol/rtmp/core/chunk_stream.go @@ -4,8 +4,8 @@ import ( "encoding/binary" "fmt" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/utils/pool" + "livego/av" + "livego/utils/pool" ) type ChunkStream struct { diff --git a/protocol/rtmp/core/chunk_stream_test.go b/protocol/rtmp/core/chunk_stream_test.go index 749c7abb..94cd05a6 100755 --- a/protocol/rtmp/core/chunk_stream_test.go +++ b/protocol/rtmp/core/chunk_stream_test.go @@ -4,7 +4,8 @@ import ( "bytes" "testing" - "github.com/gwuhaolin/livego/utils/pool" + "livego/utils/pool" + "github.com/stretchr/testify/assert" ) diff --git a/protocol/rtmp/core/conn.go b/protocol/rtmp/core/conn.go index 610a58c8..2e563a9f 100755 --- a/protocol/rtmp/core/conn.go +++ b/protocol/rtmp/core/conn.go @@ -5,8 +5,8 @@ import ( "net" "time" - "github.com/gwuhaolin/livego/utils/pio" - "github.com/gwuhaolin/livego/utils/pool" + "livego/utils/pio" + "livego/utils/pool" ) const ( diff --git a/protocol/rtmp/core/conn_client.go b/protocol/rtmp/core/conn_client.go index 566e67fc..42db529d 100755 --- a/protocol/rtmp/core/conn_client.go +++ b/protocol/rtmp/core/conn_client.go @@ -12,8 +12,8 @@ import ( "log" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/amf" + "livego/av" + "livego/protocol/amf" ) var ( diff --git a/protocol/rtmp/core/conn_server.go b/protocol/rtmp/core/conn_server.go index 006b5204..f1bb88d9 100755 --- a/protocol/rtmp/core/conn_server.go +++ b/protocol/rtmp/core/conn_server.go @@ -7,8 +7,8 @@ import ( "log" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/amf" + "livego/av" + "livego/protocol/amf" ) var ( diff --git a/protocol/rtmp/core/conn_test.go b/protocol/rtmp/core/conn_test.go index 170543de..1f4cb9b4 100755 --- a/protocol/rtmp/core/conn_test.go +++ b/protocol/rtmp/core/conn_test.go @@ -5,7 +5,8 @@ import ( "io" "testing" - "github.com/gwuhaolin/livego/utils/pool" + "livego/utils/pool" + "github.com/stretchr/testify/assert" ) diff --git a/protocol/rtmp/core/handshake.go b/protocol/rtmp/core/handshake.go index e5583768..61a79b20 100755 --- a/protocol/rtmp/core/handshake.go +++ b/protocol/rtmp/core/handshake.go @@ -10,7 +10,7 @@ import ( "time" - "github.com/gwuhaolin/livego/utils/pio" + "livego/utils/pio" ) var ( diff --git a/protocol/rtmp/rtmp.go b/protocol/rtmp/rtmp.go index f81ecf36..d999c9bb 100755 --- a/protocol/rtmp/rtmp.go +++ b/protocol/rtmp/rtmp.go @@ -11,12 +11,12 @@ import ( "strings" "time" - "github.com/gwuhaolin/livego/utils/uid" + "livego/utils/uid" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/configure" - "github.com/gwuhaolin/livego/container/flv" - "github.com/gwuhaolin/livego/protocol/rtmp/core" + "livego/av" + "livego/configure" + "livego/container/flv" + "livego/protocol/rtmp/core" ) const ( diff --git a/protocol/rtmp/rtmprelay/rtmprelay.go b/protocol/rtmp/rtmprelay/rtmprelay.go index 1980b9b5..5434b0e9 100644 --- a/protocol/rtmp/rtmprelay/rtmprelay.go +++ b/protocol/rtmp/rtmprelay/rtmprelay.go @@ -7,8 +7,8 @@ import ( "io" "log" - "github.com/gwuhaolin/livego/protocol/amf" - "github.com/gwuhaolin/livego/protocol/rtmp/core" + "livego/protocol/amf" + "livego/protocol/rtmp/core" ) var ( diff --git a/protocol/rtmp/rtmprelay/staticrelay.go b/protocol/rtmp/rtmprelay/staticrelay.go index 4fb17ff4..00e6cf9f 100644 --- a/protocol/rtmp/rtmprelay/staticrelay.go +++ b/protocol/rtmp/rtmprelay/staticrelay.go @@ -6,9 +6,9 @@ import ( "log" "sync" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/configure" - "github.com/gwuhaolin/livego/protocol/rtmp/core" + "livego/av" + "livego/configure" + "livego/protocol/rtmp/core" ) type StaticPush struct { diff --git a/protocol/rtmp/stream.go b/protocol/rtmp/stream.go index a5dbaed6..381cef0b 100755 --- a/protocol/rtmp/stream.go +++ b/protocol/rtmp/stream.go @@ -6,10 +6,11 @@ import ( "strings" "time" - "github.com/gwuhaolin/livego/av" - "github.com/gwuhaolin/livego/protocol/rtmp/cache" - "github.com/gwuhaolin/livego/protocol/rtmp/rtmprelay" - "github.com/orcaman/concurrent-map" + "livego/av" + "livego/protocol/rtmp/cache" + "livego/protocol/rtmp/rtmprelay" + + cmap "github.com/orcaman/concurrent-map" ) var ( diff --git a/utils/queue/queue.go b/utils/queue/queue.go index fc82ff9b..03e4b6f7 100755 --- a/utils/queue/queue.go +++ b/utils/queue/queue.go @@ -3,7 +3,7 @@ package queue import ( "sync" - "github.com/gwuhaolin/livego/av" + "livego/av" ) // Queue is a basic FIFO queue for Messages.