feat(gateway): relay complete encoded frames

This commit is contained in:
sechmachine
2026-07-30 22:47:48 +07:00
parent f12ed6c685
commit 786c96b110
22 changed files with 1023 additions and 159 deletions
+16
View File
@@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"sync"
"sync/atomic"
"time"
protocol "git.sechmachine.io.vn/sechmachine/VerseVDI-Protocol/gen/go/protocol"
@@ -234,6 +235,21 @@ type ProviderMedia struct {
Payload []byte
ReceivedAt time.Time
EnqueuedAt time.Time
queueID uint64
expiry *time.Timer
accounting *providerMediaQueueAccounting
}
type providerMediaQueueAccounting struct {
released atomic.Bool
bytes int64
total *atomic.Int64
}
func (media ProviderMedia) releaseQueue() {
if media.accounting != nil && media.accounting.released.CompareAndSwap(false, true) {
media.accounting.total.Add(-media.accounting.bytes)
}
}
type Provider interface {