Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
q191201771 committed Jun 21, 2023
1 parent 33bba7b commit 7e1b27d
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 7 deletions.
3 changes: 3 additions & 0 deletions app/demo/customize_lalserver/customize_lalserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package main
import (
"flag"
"fmt"
"github.com/q191201771/lal/pkg/rtsp"
"os"
"time"

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions pkg/base/t_http_an__.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions pkg/base/t_http_an__test.go
Original file line number Diff line number Diff line change
@@ -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 ([email protected])

package base

import (
Expand Down
12 changes: 12 additions & 0 deletions pkg/base/t_rtmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pkg/gb28181/pub_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion pkg/innertest/dump_ps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
Expand Down
4 changes: 2 additions & 2 deletions pkg/logic/var.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ var (
RelayPushTimeoutMs = 10000
RelayPushWriteAvTimeoutMs = 10000

StaticRelayPullTimeoutMs = 10000
StaticRelayPullTimeoutMs = 10000

DefaultApiCtrlStartRtpPubReqTimeoutMs = 60000
DefaultApiCtrlStartRtpPubReqTimeoutMs = 60000
DefaultApiCtrlStartRelayPullReqPullTimeoutMs = 10000
)

Expand Down
1 change: 1 addition & 0 deletions pkg/rtprtcp/rtprtcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

package rtprtcp

// MaxRtpRtcpPacketSize UDP接收时的buffer大小
const MaxRtpRtcpPacketSize = 1500

0 comments on commit 7e1b27d

Please sign in to comment.