diff --git a/.gitignore b/.gitignore index 2b83073..1132f09 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ coverage.html /pkg/hls/ /pkg/rtmp/testdata/test.flv +/pkg/rtmp/testdata/test.flv.bak diff --git a/README.md b/README.md index f8d25cd..018497e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Go语言编写的流媒体 库 / 客户端 / 服务端
- + @@ -88,7 +88,7 @@ $./bin/lal -c conf/lal.conf.json 其它放在代码中的配置: [rtmp/var.go](https://github.com/q191201771/lal/blob/master/pkg/rtmp/var.go) -### 测试过的客户端 +#### 测试过的客户端 ``` 推流端: @@ -158,3 +158,9 @@ lal 服务器目标版本roadmap如下: * [rtmp handshake | rtmp握手简单模式和复杂模式](https://pengrl.com/p/20027/) * [rtmp协议中的chunk stream id, message stream id, transaction id, message type id](https://pengrl.com/p/25610/) + +#### 联系我 + +欢迎扫码加我微信,进行技术交流或扯淡。 + + diff --git a/app/flvfile2es/flvfile2es.go b/app/flvfile2es/flvfile2es.go index 7e38c96..c8466ae 100644 --- a/app/flvfile2es/flvfile2es.go +++ b/app/flvfile2es/flvfile2es.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/app/flvfile2rtmppush/flvfile2rtmppush.go b/app/flvfile2rtmppush/flvfile2rtmppush.go index 426a8f9..05acbd8 100644 --- a/app/flvfile2rtmppush/flvfile2rtmppush.go +++ b/app/flvfile2rtmppush/flvfile2rtmppush.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/app/httpflvpull/httpflvpull.go b/app/httpflvpull/httpflvpull.go index 8c42a1f..d20305e 100644 --- a/app/httpflvpull/httpflvpull.go +++ b/app/httpflvpull/httpflvpull.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/app/lal/main.go b/app/lal/main.go index 4e71474..777b30c 100644 --- a/app/lal/main.go +++ b/app/lal/main.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/app/modflvfile/modflvfile.go b/app/modflvfile/modflvfile.go index 5ef4236..3aa0f12 100644 --- a/app/modflvfile/modflvfile.go +++ b/app/modflvfile/modflvfile.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/app/rtmppull/rtmppull.go b/app/rtmppull/rtmppull.go index 54b2799..79fde86 100644 --- a/app/rtmppull/rtmppull.go +++ b/app/rtmppull/rtmppull.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package main import ( diff --git a/pkg/aac/aac.go b/pkg/aac/aac.go index 472d2e8..db3da59 100644 --- a/pkg/aac/aac.go +++ b/pkg/aac/aac.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package aac import ( diff --git a/pkg/aac/aac_test.go b/pkg/aac/aac_test.go index 6eaa36b..a247de3 100644 --- a/pkg/aac/aac_test.go +++ b/pkg/aac/aac_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package aac import ( diff --git a/pkg/avc/avc.go b/pkg/avc/avc.go index 292903a..71ac013 100644 --- a/pkg/avc/avc.go +++ b/pkg/avc/avc.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package avc import ( diff --git a/pkg/avc/avc_test.go b/pkg/avc/avc_test.go index 96e9adc..e619e7a 100644 --- a/pkg/avc/avc_test.go +++ b/pkg/avc/avc_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package avc import ( diff --git a/pkg/httpflv/client_pull_session.go b/pkg/httpflv/client_pull_session.go index 7abb640..48c70c5 100644 --- a/pkg/httpflv/client_pull_session.go +++ b/pkg/httpflv/client_pull_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/httpflv/flv_file_reader.go b/pkg/httpflv/flv_file_reader.go index 1141c99..0def978 100644 --- a/pkg/httpflv/flv_file_reader.go +++ b/pkg/httpflv/flv_file_reader.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/httpflv/flv_file_writer.go b/pkg/httpflv/flv_file_writer.go index e406e7e..da4a104 100644 --- a/pkg/httpflv/flv_file_writer.go +++ b/pkg/httpflv/flv_file_writer.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import "os" diff --git a/pkg/httpflv/gop_cache.go b/pkg/httpflv/gop_cache.go index b2f9836..50b3564 100644 --- a/pkg/httpflv/gop_cache.go +++ b/pkg/httpflv/gop_cache.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv /* diff --git a/pkg/httpflv/group.go b/pkg/httpflv/group.go index 537dfda..3ee7edf 100644 --- a/pkg/httpflv/group.go +++ b/pkg/httpflv/group.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv /* diff --git a/pkg/httpflv/httpflv.go b/pkg/httpflv/httpflv.go index b44fe01..51c908c 100644 --- a/pkg/httpflv/httpflv.go +++ b/pkg/httpflv/httpflv.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/httpflv/server.go b/pkg/httpflv/server.go index ac34fa1..b894337 100644 --- a/pkg/httpflv/server.go +++ b/pkg/httpflv/server.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/httpflv/server_sub_session.go b/pkg/httpflv/server_sub_session.go index 9b34f1c..b901954 100644 --- a/pkg/httpflv/server_sub_session.go +++ b/pkg/httpflv/server_sub_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/httpflv/tag.go b/pkg/httpflv/tag.go index 0c6af29..3134c20 100644 --- a/pkg/httpflv/tag.go +++ b/pkg/httpflv/tag.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package httpflv import ( diff --git a/pkg/logic/config.go b/pkg/logic/config.go index 89d1934..98225c5 100644 --- a/pkg/logic/config.go +++ b/pkg/logic/config.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package logic import ( diff --git a/pkg/logic/group.go b/pkg/logic/group.go index 7554e5b..491bc6b 100644 --- a/pkg/logic/group.go +++ b/pkg/logic/group.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package logic import ( diff --git a/pkg/logic/lal.go b/pkg/logic/lal.go index 8e73d75..b98da5e 100644 --- a/pkg/logic/lal.go +++ b/pkg/logic/lal.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package logic import "errors" diff --git a/pkg/logic/server_manager.go b/pkg/logic/server_manager.go index 97687ac..f779c6e 100644 --- a/pkg/logic/server_manager.go +++ b/pkg/logic/server_manager.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package logic import ( diff --git a/pkg/logic/trans.go b/pkg/logic/trans.go index a12b81d..5cf7985 100644 --- a/pkg/logic/trans.go +++ b/pkg/logic/trans.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package logic import ( diff --git a/pkg/rtmp/amf0.go b/pkg/rtmp/amf0.go index d8a2a2f..07b5d2d 100644 --- a/pkg/rtmp/amf0.go +++ b/pkg/rtmp/amf0.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp // amf0.go diff --git a/pkg/rtmp/amf0_test.go b/pkg/rtmp/amf0_test.go index 8581c56..0806984 100644 --- a/pkg/rtmp/amf0_test.go +++ b/pkg/rtmp/amf0_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp_test import ( diff --git a/pkg/rtmp/chunk_composer.go b/pkg/rtmp/chunk_composer.go index d9be546..219fd62 100644 --- a/pkg/rtmp/chunk_composer.go +++ b/pkg/rtmp/chunk_composer.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp // chunk_composer.go diff --git a/pkg/rtmp/chunk_divider.go b/pkg/rtmp/chunk_divider.go index 3365535..2aa14d5 100644 --- a/pkg/rtmp/chunk_divider.go +++ b/pkg/rtmp/chunk_divider.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp // chunk_divider.go diff --git a/pkg/rtmp/client_pull_session.go b/pkg/rtmp/client_pull_session.go index 5523ad8..5235c3f 100644 --- a/pkg/rtmp/client_pull_session.go +++ b/pkg/rtmp/client_pull_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp type PullSessionObserver interface { diff --git a/pkg/rtmp/client_push_session.go b/pkg/rtmp/client_push_session.go index ba07066..a2daded 100644 --- a/pkg/rtmp/client_push_session.go +++ b/pkg/rtmp/client_push_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp type PushSession struct { diff --git a/pkg/rtmp/client_session.go b/pkg/rtmp/client_session.go index 9b78c49..53f093f 100644 --- a/pkg/rtmp/client_session.go +++ b/pkg/rtmp/client_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import ( diff --git a/pkg/rtmp/example_test.go b/pkg/rtmp/example_test.go index 685ec0b..702313f 100644 --- a/pkg/rtmp/example_test.go +++ b/pkg/rtmp/example_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp_test import ( diff --git a/pkg/rtmp/handshake.go b/pkg/rtmp/handshake.go index 2a700c7..d0c60df 100644 --- a/pkg/rtmp/handshake.go +++ b/pkg/rtmp/handshake.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import ( diff --git a/pkg/rtmp/handshake_test.go b/pkg/rtmp/handshake_test.go index 47d2a37..2d9adfb 100644 --- a/pkg/rtmp/handshake_test.go +++ b/pkg/rtmp/handshake_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp_test import ( diff --git a/pkg/rtmp/message_packer.go b/pkg/rtmp/message_packer.go index 0f616ed..00488fd 100644 --- a/pkg/rtmp/message_packer.go +++ b/pkg/rtmp/message_packer.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp // message_packer.go diff --git a/pkg/rtmp/message_packer_test.go b/pkg/rtmp/message_packer_test.go index 1e6da13..7d532ae 100644 --- a/pkg/rtmp/message_packer_test.go +++ b/pkg/rtmp/message_packer_test.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import ( diff --git a/pkg/rtmp/rtmp.go b/pkg/rtmp/rtmp.go index 155a20b..ad16abb 100644 --- a/pkg/rtmp/rtmp.go +++ b/pkg/rtmp/rtmp.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import "errors" diff --git a/pkg/rtmp/server.go b/pkg/rtmp/server.go index f55523c..7d8560a 100644 --- a/pkg/rtmp/server.go +++ b/pkg/rtmp/server.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import ( diff --git a/pkg/rtmp/server_session.go b/pkg/rtmp/server_session.go index 6bd8179..42e8c44 100644 --- a/pkg/rtmp/server_session.go +++ b/pkg/rtmp/server_session.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import ( diff --git a/pkg/rtmp/stream.go b/pkg/rtmp/stream.go index 6b7383a..cf544d6 100644 --- a/pkg/rtmp/stream.go +++ b/pkg/rtmp/stream.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp import log "github.com/q191201771/naza/pkg/nazalog" diff --git a/pkg/rtmp/var.go b/pkg/rtmp/var.go index 916f52a..af4b36b 100644 --- a/pkg/rtmp/var.go +++ b/pkg/rtmp/var.go @@ -1,3 +1,11 @@ +// Copyright 2019, Chef. All rights reserved. +// https://github.com/q191201771/lal +// +// Use of this source code is governed by a MIT-style license +// that can be found in the License file. +// +// Author: Chef (191201771@qq.com) + package rtmp // 一些更专业的配置项,暂时只在该源码文件中配置,不提供外部配置接口 diff --git a/test.sh b/test.sh index 5a992dc..e478c13 100755 --- a/test.sh +++ b/test.sh @@ -28,6 +28,17 @@ fi echo "CHEFERASEME run coverage test..." echo "" > coverage.txt +if [ ! -f "pkg/rtmp/testdata/test.flv" ]; then + echo "CHEFERASEME test.flv not exist." + if [ ! -d "pkg/rtmp/testdata" ]; then + echo "CHEFERASEME mkdir." + mkdir "pkg/rtmp/testdata" + fi + wget https://pengrl.com/images/other/source.200kbps.768x320.flv -O pkg/rtmp/testdata/test.flv +else + echo "CHEFERASEME test.flv exist." +fi + for d in $(go list ./... | grep -v vendor | grep lal/pkg); do go test -race -coverprofile=profile.out -covermode=atomic $d if [ -f profile.out ]; then