mirror of
https://github.com/Monibuca/plugin-ps.git
synced 2026-04-22 23:37:04 +08:00
fit engine update
This commit is contained in:
@@ -7,7 +7,7 @@ require (
|
|||||||
github.com/pion/rtp v1.7.13
|
github.com/pion/rtp v1.7.13
|
||||||
github.com/yapingcat/gomedia v0.0.0-20230426092936-387031404274
|
github.com/yapingcat/gomedia v0.0.0-20230426092936-387031404274
|
||||||
go.uber.org/zap v1.23.0
|
go.uber.org/zap v1.23.0
|
||||||
m7s.live/engine/v4 v4.13.0
|
m7s.live/engine/v4 v4.13.3
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
|||||||
@@ -281,5 +281,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
|
|||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
m7s.live/engine/v4 v4.13.0 h1:zvzCUfZ8Ma4iTmLq9n0UAo9VLCU/b3oB+nbatUOgKAI=
|
m7s.live/engine/v4 v4.13.3 h1:bboacBXHrnnIVu/NrK2vuiiCBrqmB5ZPUW4HN6l+gMU=
|
||||||
m7s.live/engine/v4 v4.13.0/go.mod h1:LoALBfV5rmsz5TJQr6cmLxM33mfUE5BKBq/sMtXOVlc=
|
m7s.live/engine/v4 v4.13.3/go.mod h1:LoALBfV5rmsz5TJQr6cmLxM33mfUE5BKBq/sMtXOVlc=
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/gobwas/ws"
|
"github.com/gobwas/ws"
|
||||||
"github.com/gobwas/ws/wsutil"
|
"github.com/gobwas/ws/wsutil"
|
||||||
@@ -95,7 +94,7 @@ func (c *PSConfig) ServeUDP(conn *net.UDPConn) {
|
|||||||
var lastSSRC uint32
|
var lastSSRC uint32
|
||||||
var lastPubber *PSPublisher
|
var lastPubber *PSPublisher
|
||||||
for {
|
for {
|
||||||
conn.SetReadDeadline(time.Now().Add(time.Second * 10))
|
// conn.SetReadDeadline(time.Now().Add(time.Second * 10))
|
||||||
n, _, err := conn.ReadFromUDP(bufUDP)
|
n, _, err := conn.ReadFromUDP(bufUDP)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
|
|||||||
+2
-2
@@ -20,7 +20,7 @@ func (ps *PSSubscriber) OnEvent(event any) {
|
|||||||
enter := false
|
enter := false
|
||||||
go v.Play(ps.IO, func(data *common.DataFrame[*util.ListItem[util.Buffer]]) error {
|
go v.Play(ps.IO, func(data *common.DataFrame[*util.ListItem[util.Buffer]]) error {
|
||||||
if !enter {
|
if !enter {
|
||||||
if bytes.Compare(data.Value.Value[:3], []byte{0, 0, 1}) == 0 {
|
if bytes.Compare(data.Data.Value[:3], []byte{0, 0, 1}) == 0 {
|
||||||
enter = true
|
enter = true
|
||||||
} else {
|
} else {
|
||||||
return nil
|
return nil
|
||||||
@@ -28,7 +28,7 @@ func (ps *PSSubscriber) OnEvent(event any) {
|
|||||||
}
|
}
|
||||||
// fmt.Printf("% 02X", data.Value.Value[:10])
|
// fmt.Printf("% 02X", data.Value.Value[:10])
|
||||||
// fmt.Println()
|
// fmt.Println()
|
||||||
return wsutil.WriteServerBinary(ps, data.Value.Value)
|
return wsutil.WriteServerBinary(ps, data.Data.Value)
|
||||||
})
|
})
|
||||||
default:
|
default:
|
||||||
ps.Subscriber.OnEvent(event)
|
ps.Subscriber.OnEvent(event)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type PSTrack struct {
|
type PSTrack struct {
|
||||||
track.Data[*util.ListItem[util.Buffer]]
|
track.RecycleData[*util.ListItem[util.Buffer]]
|
||||||
PSM util.Buffer `json:"-" yaml:"-"`
|
PSM util.Buffer `json:"-" yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,9 +22,6 @@ func NewPSTrack(s common.IStream) *PSTrack {
|
|||||||
result := &PSTrack{}
|
result := &PSTrack{}
|
||||||
result.Init(1000)
|
result.Init(1000)
|
||||||
result.SetStuff("ps", s)
|
result.SetStuff("ps", s)
|
||||||
result.Reset = func(f *common.DataFrame[*util.ListItem[util.Buffer]]) {
|
|
||||||
f.Value.Recycle()
|
|
||||||
}
|
|
||||||
s.AddTrack(result)
|
s.AddTrack(result)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user