feat(gateway): relay complete encoded frames
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user