mirror of
https://github.com/datarhei/core.git
synced 2025-09-26 20:11:29 +08:00
This commit is contained in:
2
go.mod
2
go.mod
@@ -10,7 +10,7 @@ require (
|
||||
github.com/atrox/haikunatorgo/v2 v2.0.1
|
||||
github.com/caddyserver/certmagic v0.21.2
|
||||
github.com/datarhei/gosrt v0.6.0
|
||||
github.com/datarhei/joy4 v0.0.0-20240530204135-9c6cb8a1c911
|
||||
github.com/datarhei/joy4 v0.0.0-20240603190808-b1407345907e
|
||||
github.com/go-playground/validator/v10 v10.20.0
|
||||
github.com/gobwas/glob v0.2.3
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||
|
4
go.sum
4
go.sum
@@ -30,8 +30,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lV
|
||||
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
|
||||
github.com/datarhei/gosrt v0.6.0 h1:HrrXAw90V78ok4WMIhX6se1aTHPCn82Sg2hj+PhdmGc=
|
||||
github.com/datarhei/gosrt v0.6.0/go.mod h1:fsOWdLSHUHShHjgi/46h6wjtdQrtnSdAQFnlas8ONxs=
|
||||
github.com/datarhei/joy4 v0.0.0-20240530204135-9c6cb8a1c911 h1:kDvbQ49kbq6vY0UpflEMkqJwjYpll/JI553Ry+1XCmo=
|
||||
github.com/datarhei/joy4 v0.0.0-20240530204135-9c6cb8a1c911/go.mod h1:Jcw/6jZDQQmPx8A7INEkXmuEF7E9jjBbSTfVSLwmiQw=
|
||||
github.com/datarhei/joy4 v0.0.0-20240603190808-b1407345907e h1:Qc/0D4xvXrazFkoi/4UGqO15yQ1JN5I8h7RwdzCLgTY=
|
||||
github.com/datarhei/joy4 v0.0.0-20240603190808-b1407345907e/go.mod h1:Jcw/6jZDQQmPx8A7INEkXmuEF7E9jjBbSTfVSLwmiQw=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
|
35
vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go
generated
vendored
35
vendor/github.com/datarhei/joy4/format/rtmp/rtmp.go
generated
vendored
@@ -346,19 +346,19 @@ func (t *idleConn) SetIdleTimeout(d time.Duration) error {
|
||||
}
|
||||
|
||||
type txrxcount struct {
|
||||
io.ReadWriter
|
||||
io.ReadWriteCloser
|
||||
txbytes uint64
|
||||
rxbytes uint64
|
||||
}
|
||||
|
||||
func (t *txrxcount) Read(p []byte) (int, error) {
|
||||
n, err := t.ReadWriter.Read(p)
|
||||
n, err := t.ReadWriteCloser.Read(p)
|
||||
t.rxbytes += uint64(n)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func (t *txrxcount) Write(p []byte) (int, error) {
|
||||
n, err := t.ReadWriter.Write(p)
|
||||
n, err := t.ReadWriteCloser.Write(p)
|
||||
t.txbytes += uint64(n)
|
||||
return n, err
|
||||
}
|
||||
@@ -373,7 +373,7 @@ func NewConn(netconn net.Conn) *Conn {
|
||||
conn.readMaxChunkSize = 128
|
||||
conn.writeMaxChunkSize = 128
|
||||
conn.readAckSize = 1048576
|
||||
conn.txrxcount = &txrxcount{ReadWriter: conn.netconn}
|
||||
conn.txrxcount = &txrxcount{ReadWriteCloser: conn.netconn}
|
||||
conn.bufr = bufio.NewReaderSize(conn.txrxcount, pio.RecommendBufioSize)
|
||||
conn.bufw = bufio.NewWriterSize(conn.txrxcount, pio.RecommendBufioSize)
|
||||
conn.writebuf = make([]byte, 4096)
|
||||
@@ -1135,6 +1135,16 @@ func (conn *Conn) WriteHeader(streams []av.CodecData) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if conn.metadata != nil {
|
||||
for key, value := range conn.metadata {
|
||||
if _, hasKey := metadata[key]; hasKey {
|
||||
continue
|
||||
}
|
||||
|
||||
metadata[key] = value
|
||||
}
|
||||
}
|
||||
|
||||
// > onMetaData()
|
||||
if err = conn.writeDataMsg(5, conn.avmsgsid, "onMetaData", metadata); err != nil {
|
||||
return
|
||||
@@ -1858,14 +1868,17 @@ func (conn *Conn) handleMsg(timestamp uint32, msgsid uint32, msgtypeid uint8, ms
|
||||
}
|
||||
|
||||
if metaindex != -1 && metaindex < len(conn.datamsgvals) {
|
||||
conn.metadata = conn.datamsgvals[metaindex].(flvio.AMFMap)
|
||||
//fmt.Printf("onMetadata: %+v\n", conn.metadata)
|
||||
if _, hasVideo := conn.metadata["videocodecid"]; hasVideo {
|
||||
conn.prober.HasVideo = true
|
||||
}
|
||||
metadata, ok := conn.datamsgvals[metaindex].(flvio.AMFMap)
|
||||
if ok {
|
||||
conn.metadata = metadata
|
||||
|
||||
if _, hasAudio := conn.metadata["audiocodecid"]; hasAudio {
|
||||
conn.prober.HasAudio = true
|
||||
if _, hasVideo := metadata["videocodecid"]; hasVideo {
|
||||
conn.prober.HasVideo = true
|
||||
}
|
||||
|
||||
if _, hasAudio := metadata["audiocodecid"]; hasAudio {
|
||||
conn.prober.HasAudio = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -64,7 +64,7 @@ github.com/datarhei/gosrt/crypto
|
||||
github.com/datarhei/gosrt/net
|
||||
github.com/datarhei/gosrt/packet
|
||||
github.com/datarhei/gosrt/rand
|
||||
# github.com/datarhei/joy4 v0.0.0-20240530204135-9c6cb8a1c911
|
||||
# github.com/datarhei/joy4 v0.0.0-20240603190808-b1407345907e
|
||||
## explicit; go 1.14
|
||||
github.com/datarhei/joy4/av
|
||||
github.com/datarhei/joy4/av/avutil
|
||||
|
Reference in New Issue
Block a user