diff --git a/app/demo/customize_lalserver/customize_lalserver.go b/app/demo/customize_lalserver/customize_lalserver.go index 4d872d7..35d3409 100644 --- a/app/demo/customize_lalserver/customize_lalserver.go +++ b/app/demo/customize_lalserver/customize_lalserver.go @@ -11,6 +11,7 @@ package main import ( "flag" "fmt" + "github.com/q191201771/lal/pkg/rtsp" "os" "time" @@ -57,6 +58,8 @@ func (i *MySession) OnStop() { func main() { defer nazalog.Sync() + rtsp.BaseInSessionTimestampFilterFlag = false + confFilename := parseFlag() lals := logic.NewLalServer(func(option *logic.Option) { option.ConfFilename = confFilename diff --git a/pkg/base/t_http_an__.go b/pkg/base/t_http_an__.go index d3314be..3118129 100644 --- a/pkg/base/t_http_an__.go +++ b/pkg/base/t_http_an__.go @@ -107,9 +107,9 @@ func Session2StatPull(session ISession) StatPull { } } -/** - @note result s.Fps is not ordered -*/ +// GetFpsFrom +// +// @note result s.Fps is not ordered func (s *StatGroup) GetFpsFrom(p *PeriodRecord, nowUnixSec int64) { if s.Fps == nil || cap(s.Fps) < p.nRecord { s.Fps = make([]RecordPerSec, p.nRecord) diff --git a/pkg/base/t_http_an__test.go b/pkg/base/t_http_an__test.go index fe8274c..f64e5f3 100644 --- a/pkg/base/t_http_an__test.go +++ b/pkg/base/t_http_an__test.go @@ -1,3 +1,11 @@ +// Copyright 2023, 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 base import ( diff --git a/pkg/base/t_rtmp.go b/pkg/base/t_rtmp.go index bf51a7d..af89e7b 100644 --- a/pkg/base/t_rtmp.go +++ b/pkg/base/t_rtmp.go @@ -57,6 +57,18 @@ const ( RtmpFrameTypeKey uint8 = 1 RtmpFrameTypeInter uint8 = 2 + // RtmpCodecIdAvc + // + // Video tags -> VIDEODATA -> CodecID + // + // 1: JPEG (currently unused) + // 2: Sorenson H.263 + // 3: Screen video + // 4: On2 VP6 + // 5: On2 VP6 with alpha channel + // 6: Screen video version 2 + // 7: AVC + // RtmpCodecIdAvc uint8 = 7 RtmpCodecIdHevc uint8 = 12 diff --git a/pkg/gb28181/pub_session.go b/pkg/gb28181/pub_session.go index ed6e694..8e6398a 100644 --- a/pkg/gb28181/pub_session.go +++ b/pkg/gb28181/pub_session.go @@ -213,7 +213,7 @@ func (session *PubSession) runLoopTcp() error { go func() { lb := make([]byte, 2) - buf := nazabytes.NewBuffer(1500) + buf := nazabytes.NewBuffer(1500) // 初始1500,如果不够会扩容 for { if _, rErr := io.ReadFull(conn, lb); rErr != nil { nazalog.Debugf("[%s] read failed. err=%+v", session.UniqueKey(), rErr) diff --git a/pkg/innertest/dump_ps_test.go b/pkg/innertest/dump_ps_test.go index ed0f5ce..cb39ec7 100644 --- a/pkg/innertest/dump_ps_test.go +++ b/pkg/innertest/dump_ps_test.go @@ -36,7 +36,7 @@ import ( // go test -test.run TestDump_PsPub func TestDump_PsPub(t *testing.T) { filename := "/tmp/record.psdata" - isTcpFlag := 1 + isTcpFlag := 0 b, err := os.ReadFile(filename) if len(b) == 0 || err != nil { @@ -76,6 +76,9 @@ func testPushFile(addr string, filename string, isTcpFlag int) { break } nazalog.Debugf("%s", m.DebugString()) + if m.Typ == base.DumpTypeInnerFileHeaderData { + continue + } if isTcpFlag != 0 { bele.BePutUint16(lb, uint16(m.Len)) diff --git a/pkg/logic/var.go b/pkg/logic/var.go index bd851ce..4eecb0f 100644 --- a/pkg/logic/var.go +++ b/pkg/logic/var.go @@ -65,9 +65,9 @@ var ( RelayPushTimeoutMs = 10000 RelayPushWriteAvTimeoutMs = 10000 - StaticRelayPullTimeoutMs = 10000 + StaticRelayPullTimeoutMs = 10000 - DefaultApiCtrlStartRtpPubReqTimeoutMs = 60000 + DefaultApiCtrlStartRtpPubReqTimeoutMs = 60000 DefaultApiCtrlStartRelayPullReqPullTimeoutMs = 10000 ) diff --git a/pkg/rtprtcp/rtprtcp.go b/pkg/rtprtcp/rtprtcp.go index b545ae4..3947a1a 100644 --- a/pkg/rtprtcp/rtprtcp.go +++ b/pkg/rtprtcp/rtprtcp.go @@ -8,4 +8,5 @@ package rtprtcp +// MaxRtpRtcpPacketSize UDP接收时的buffer大小 const MaxRtpRtcpPacketSize = 1500