mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-11-03 04:23:38 +08:00
fix: memory
This commit is contained in:
11
api.go
11
api.go
@@ -129,6 +129,7 @@ func (s *Server) getStreamInfo(pub *Publisher) (res *pb.StreamInfoResponse, err
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) StreamInfo(ctx context.Context, req *pb.StreamSnapRequest) (res *pb.StreamInfoResponse, err error) {
|
func (s *Server) StreamInfo(ctx context.Context, req *pb.StreamSnapRequest) (res *pb.StreamInfoResponse, err error) {
|
||||||
s.Call(func() {
|
s.Call(func() {
|
||||||
if pub, ok := s.Streams.Get(req.StreamPath); ok {
|
if pub, ok := s.Streams.Get(req.StreamPath); ok {
|
||||||
@@ -193,6 +194,16 @@ func (s *Server) VideoTrackSnap(ctx context.Context, req *pb.StreamSnapRequest)
|
|||||||
res = &pb.TrackSnapShotResponse{}
|
res = &pb.TrackSnapShotResponse{}
|
||||||
if !pub.VideoTrack.IsEmpty() {
|
if !pub.VideoTrack.IsEmpty() {
|
||||||
// vcc := pub.VideoTrack.AVTrack.ICodecCtx.(pkg.IVideoCodecCtx)
|
// vcc := pub.VideoTrack.AVTrack.ICodecCtx.(pkg.IVideoCodecCtx)
|
||||||
|
for _, memlist := range pub.VideoTrack.Allocator.GetChildren() {
|
||||||
|
var list []*pb.MemoryBlock
|
||||||
|
for _, block := range memlist.GetBlocks() {
|
||||||
|
list = append(list, &pb.MemoryBlock{
|
||||||
|
S: uint32(block[0]),
|
||||||
|
E: uint32(block[1]),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
res.Memory = append(res.Memory, &pb.MemoryBlockGroup{List: list, Size: uint32(memlist.Size)})
|
||||||
|
}
|
||||||
res.Reader = make(map[uint32]uint32)
|
res.Reader = make(map[uint32]uint32)
|
||||||
for sub := range pub.Subscribers {
|
for sub := range pub.Subscribers {
|
||||||
if sub.VideoReader == nil {
|
if sub.VideoReader == nil {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ webrtc:
|
|||||||
rtmp:
|
rtmp:
|
||||||
chunksize: 2048
|
chunksize: 2048
|
||||||
publish:
|
publish:
|
||||||
|
pubaudio: false
|
||||||
# idletimeout: 10s
|
# idletimeout: 10s
|
||||||
# closedelaytimeout: 4s
|
# closedelaytimeout: 4s
|
||||||
subscribe:
|
subscribe:
|
||||||
|
|||||||
@@ -2,39 +2,37 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"flag"
|
"flag"
|
||||||
|
|
||||||
"m7s.live/m7s/v5"
|
"m7s.live/m7s/v5"
|
||||||
"m7s.live/m7s/v5/pkg/util"
|
|
||||||
_ "m7s.live/m7s/v5/plugin/console"
|
_ "m7s.live/m7s/v5/plugin/console"
|
||||||
_ "m7s.live/m7s/v5/plugin/debug"
|
_ "m7s.live/m7s/v5/plugin/debug"
|
||||||
_ "m7s.live/m7s/v5/plugin/hdl"
|
_ "m7s.live/m7s/v5/plugin/hdl"
|
||||||
_ "m7s.live/m7s/v5/plugin/logrotate"
|
_ "m7s.live/m7s/v5/plugin/logrotate"
|
||||||
_ "m7s.live/m7s/v5/plugin/rtmp"
|
_ "m7s.live/m7s/v5/plugin/rtmp"
|
||||||
_ "m7s.live/m7s/v5/plugin/webrtc"
|
_ "m7s.live/m7s/v5/plugin/webrtc"
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
// func init() {
|
||||||
//全局推流鉴权
|
// //全局推流鉴权
|
||||||
m7s.DefaultServer.OnAuthPubs["RTMP"] = func(p *util.Promise[*m7s.Publisher]) {
|
// m7s.DefaultServer.OnAuthPubs["RTMP"] = func(p *util.Promise[*m7s.Publisher]) {
|
||||||
var pub = p.Value
|
// var pub = p.Value
|
||||||
if strings.Contains(pub.StreamPath, "20A222800207-2") {
|
// if strings.Contains(pub.StreamPath, "20A222800207-2") {
|
||||||
p.Fulfill(nil)
|
// p.Fulfill(nil)
|
||||||
} else {
|
// } else {
|
||||||
p.Fulfill(errors.New("auth failed"))
|
// p.Fulfill(errors.New("auth failed"))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//全局播放鉴权
|
// //全局播放鉴权
|
||||||
m7s.DefaultServer.OnAuthSubs["RTMP"] = func(p *util.Promise[*m7s.Subscriber]) {
|
// m7s.DefaultServer.OnAuthSubs["RTMP"] = func(p *util.Promise[*m7s.Subscriber]) {
|
||||||
var sub = p.Value
|
// var sub = p.Value
|
||||||
if strings.Contains(sub.StreamPath, "20A222800207-22") {
|
// if strings.Contains(sub.StreamPath, "20A222800207-22") {
|
||||||
p.Fulfill(nil)
|
// p.Fulfill(nil)
|
||||||
} else {
|
// } else {
|
||||||
p.Fulfill(errors.New("auth failed"))
|
// p.Fulfill(errors.New("auth failed"))
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
conf := flag.String("c", "config.yaml", "config file")
|
conf := flag.String("c", "config.yaml", "config file")
|
||||||
|
|||||||
691
pb/global.pb.go
691
pb/global.pb.go
@@ -1207,6 +1207,116 @@ func (x *TrackSnapShot) GetWrap() []*Wrap {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MemoryBlock struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
S uint32 `protobuf:"varint,1,opt,name=s,proto3" json:"s,omitempty"`
|
||||||
|
E uint32 `protobuf:"varint,2,opt,name=e,proto3" json:"e,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlock) Reset() {
|
||||||
|
*x = MemoryBlock{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_global_proto_msgTypes[17]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlock) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MemoryBlock) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MemoryBlock) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_global_proto_msgTypes[17]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use MemoryBlock.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MemoryBlock) Descriptor() ([]byte, []int) {
|
||||||
|
return file_global_proto_rawDescGZIP(), []int{17}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlock) GetS() uint32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.S
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlock) GetE() uint32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.E
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type MemoryBlockGroup struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Size uint32 `protobuf:"varint,1,opt,name=size,proto3" json:"size,omitempty"`
|
||||||
|
List []*MemoryBlock `protobuf:"bytes,2,rep,name=list,proto3" json:"list,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlockGroup) Reset() {
|
||||||
|
*x = MemoryBlockGroup{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_global_proto_msgTypes[18]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlockGroup) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*MemoryBlockGroup) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *MemoryBlockGroup) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_global_proto_msgTypes[18]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use MemoryBlockGroup.ProtoReflect.Descriptor instead.
|
||||||
|
func (*MemoryBlockGroup) Descriptor() ([]byte, []int) {
|
||||||
|
return file_global_proto_rawDescGZIP(), []int{18}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlockGroup) GetSize() uint32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Size
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *MemoryBlockGroup) GetList() []*MemoryBlock {
|
||||||
|
if x != nil {
|
||||||
|
return x.List
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type AudioTrackInfo struct {
|
type AudioTrackInfo struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -1224,7 +1334,7 @@ type AudioTrackInfo struct {
|
|||||||
func (x *AudioTrackInfo) Reset() {
|
func (x *AudioTrackInfo) Reset() {
|
||||||
*x = AudioTrackInfo{}
|
*x = AudioTrackInfo{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[17]
|
mi := &file_global_proto_msgTypes[19]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1237,7 +1347,7 @@ func (x *AudioTrackInfo) String() string {
|
|||||||
func (*AudioTrackInfo) ProtoMessage() {}
|
func (*AudioTrackInfo) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *AudioTrackInfo) ProtoReflect() protoreflect.Message {
|
func (x *AudioTrackInfo) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[17]
|
mi := &file_global_proto_msgTypes[19]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1250,7 +1360,7 @@ func (x *AudioTrackInfo) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use AudioTrackInfo.ProtoReflect.Descriptor instead.
|
// Deprecated: Use AudioTrackInfo.ProtoReflect.Descriptor instead.
|
||||||
func (*AudioTrackInfo) Descriptor() ([]byte, []int) {
|
func (*AudioTrackInfo) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{17}
|
return file_global_proto_rawDescGZIP(), []int{19}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *AudioTrackInfo) GetCodec() string {
|
func (x *AudioTrackInfo) GetCodec() string {
|
||||||
@@ -1309,12 +1419,13 @@ type TrackSnapShotResponse struct {
|
|||||||
|
|
||||||
Ring []*TrackSnapShot `protobuf:"bytes,1,rep,name=ring,proto3" json:"ring,omitempty"`
|
Ring []*TrackSnapShot `protobuf:"bytes,1,rep,name=ring,proto3" json:"ring,omitempty"`
|
||||||
Reader map[uint32]uint32 `protobuf:"bytes,2,rep,name=reader,proto3" json:"reader,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
Reader map[uint32]uint32 `protobuf:"bytes,2,rep,name=reader,proto3" json:"reader,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
|
||||||
|
Memory []*MemoryBlockGroup `protobuf:"bytes,3,rep,name=memory,proto3" json:"memory,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TrackSnapShotResponse) Reset() {
|
func (x *TrackSnapShotResponse) Reset() {
|
||||||
*x = TrackSnapShotResponse{}
|
*x = TrackSnapShotResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[18]
|
mi := &file_global_proto_msgTypes[20]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1327,7 +1438,7 @@ func (x *TrackSnapShotResponse) String() string {
|
|||||||
func (*TrackSnapShotResponse) ProtoMessage() {}
|
func (*TrackSnapShotResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *TrackSnapShotResponse) ProtoReflect() protoreflect.Message {
|
func (x *TrackSnapShotResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[18]
|
mi := &file_global_proto_msgTypes[20]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1340,7 +1451,7 @@ func (x *TrackSnapShotResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use TrackSnapShotResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use TrackSnapShotResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*TrackSnapShotResponse) Descriptor() ([]byte, []int) {
|
func (*TrackSnapShotResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{18}
|
return file_global_proto_rawDescGZIP(), []int{20}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TrackSnapShotResponse) GetRing() []*TrackSnapShot {
|
func (x *TrackSnapShotResponse) GetRing() []*TrackSnapShot {
|
||||||
@@ -1357,6 +1468,13 @@ func (x *TrackSnapShotResponse) GetReader() map[uint32]uint32 {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *TrackSnapShotResponse) GetMemory() []*MemoryBlockGroup {
|
||||||
|
if x != nil {
|
||||||
|
return x.Memory
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
type VideoTrackInfo struct {
|
type VideoTrackInfo struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
@@ -1375,7 +1493,7 @@ type VideoTrackInfo struct {
|
|||||||
func (x *VideoTrackInfo) Reset() {
|
func (x *VideoTrackInfo) Reset() {
|
||||||
*x = VideoTrackInfo{}
|
*x = VideoTrackInfo{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[19]
|
mi := &file_global_proto_msgTypes[21]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1388,7 +1506,7 @@ func (x *VideoTrackInfo) String() string {
|
|||||||
func (*VideoTrackInfo) ProtoMessage() {}
|
func (*VideoTrackInfo) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *VideoTrackInfo) ProtoReflect() protoreflect.Message {
|
func (x *VideoTrackInfo) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[19]
|
mi := &file_global_proto_msgTypes[21]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1401,7 +1519,7 @@ func (x *VideoTrackInfo) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use VideoTrackInfo.ProtoReflect.Descriptor instead.
|
// Deprecated: Use VideoTrackInfo.ProtoReflect.Descriptor instead.
|
||||||
func (*VideoTrackInfo) Descriptor() ([]byte, []int) {
|
func (*VideoTrackInfo) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{19}
|
return file_global_proto_rawDescGZIP(), []int{21}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *VideoTrackInfo) GetCodec() string {
|
func (x *VideoTrackInfo) GetCodec() string {
|
||||||
@@ -1471,7 +1589,7 @@ type SuccessResponse struct {
|
|||||||
func (x *SuccessResponse) Reset() {
|
func (x *SuccessResponse) Reset() {
|
||||||
*x = SuccessResponse{}
|
*x = SuccessResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[20]
|
mi := &file_global_proto_msgTypes[22]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1484,7 +1602,7 @@ func (x *SuccessResponse) String() string {
|
|||||||
func (*SuccessResponse) ProtoMessage() {}
|
func (*SuccessResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SuccessResponse) ProtoReflect() protoreflect.Message {
|
func (x *SuccessResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[20]
|
mi := &file_global_proto_msgTypes[22]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1497,7 +1615,7 @@ func (x *SuccessResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SuccessResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SuccessResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*SuccessResponse) Descriptor() ([]byte, []int) {
|
func (*SuccessResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{20}
|
return file_global_proto_rawDescGZIP(), []int{22}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SuccessResponse) GetSuccess() bool {
|
func (x *SuccessResponse) GetSuccess() bool {
|
||||||
@@ -1518,7 +1636,7 @@ type RequestWithId struct {
|
|||||||
func (x *RequestWithId) Reset() {
|
func (x *RequestWithId) Reset() {
|
||||||
*x = RequestWithId{}
|
*x = RequestWithId{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[21]
|
mi := &file_global_proto_msgTypes[23]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1531,7 +1649,7 @@ func (x *RequestWithId) String() string {
|
|||||||
func (*RequestWithId) ProtoMessage() {}
|
func (*RequestWithId) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RequestWithId) ProtoReflect() protoreflect.Message {
|
func (x *RequestWithId) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[21]
|
mi := &file_global_proto_msgTypes[23]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1544,7 +1662,7 @@ func (x *RequestWithId) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RequestWithId.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RequestWithId.ProtoReflect.Descriptor instead.
|
||||||
func (*RequestWithId) Descriptor() ([]byte, []int) {
|
func (*RequestWithId) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{21}
|
return file_global_proto_rawDescGZIP(), []int{23}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RequestWithId) GetId() uint32 {
|
func (x *RequestWithId) GetId() uint32 {
|
||||||
@@ -1567,7 +1685,7 @@ type SubscribersRequest struct {
|
|||||||
func (x *SubscribersRequest) Reset() {
|
func (x *SubscribersRequest) Reset() {
|
||||||
*x = SubscribersRequest{}
|
*x = SubscribersRequest{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[22]
|
mi := &file_global_proto_msgTypes[24]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1580,7 +1698,7 @@ func (x *SubscribersRequest) String() string {
|
|||||||
func (*SubscribersRequest) ProtoMessage() {}
|
func (*SubscribersRequest) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SubscribersRequest) ProtoReflect() protoreflect.Message {
|
func (x *SubscribersRequest) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[22]
|
mi := &file_global_proto_msgTypes[24]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1593,7 +1711,7 @@ func (x *SubscribersRequest) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SubscribersRequest.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SubscribersRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*SubscribersRequest) Descriptor() ([]byte, []int) {
|
func (*SubscribersRequest) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{22}
|
return file_global_proto_rawDescGZIP(), []int{24}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SubscribersRequest) GetStreamPath() string {
|
func (x *SubscribersRequest) GetStreamPath() string {
|
||||||
@@ -1631,7 +1749,7 @@ type RingReaderSnapShot struct {
|
|||||||
func (x *RingReaderSnapShot) Reset() {
|
func (x *RingReaderSnapShot) Reset() {
|
||||||
*x = RingReaderSnapShot{}
|
*x = RingReaderSnapShot{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[23]
|
mi := &file_global_proto_msgTypes[25]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1644,7 +1762,7 @@ func (x *RingReaderSnapShot) String() string {
|
|||||||
func (*RingReaderSnapShot) ProtoMessage() {}
|
func (*RingReaderSnapShot) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *RingReaderSnapShot) ProtoReflect() protoreflect.Message {
|
func (x *RingReaderSnapShot) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[23]
|
mi := &file_global_proto_msgTypes[25]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1657,7 +1775,7 @@ func (x *RingReaderSnapShot) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use RingReaderSnapShot.ProtoReflect.Descriptor instead.
|
// Deprecated: Use RingReaderSnapShot.ProtoReflect.Descriptor instead.
|
||||||
func (*RingReaderSnapShot) Descriptor() ([]byte, []int) {
|
func (*RingReaderSnapShot) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{23}
|
return file_global_proto_rawDescGZIP(), []int{25}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *RingReaderSnapShot) GetSequence() uint32 {
|
func (x *RingReaderSnapShot) GetSequence() uint32 {
|
||||||
@@ -1703,7 +1821,7 @@ type SubscriberSnapShot struct {
|
|||||||
func (x *SubscriberSnapShot) Reset() {
|
func (x *SubscriberSnapShot) Reset() {
|
||||||
*x = SubscriberSnapShot{}
|
*x = SubscriberSnapShot{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[24]
|
mi := &file_global_proto_msgTypes[26]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1716,7 +1834,7 @@ func (x *SubscriberSnapShot) String() string {
|
|||||||
func (*SubscriberSnapShot) ProtoMessage() {}
|
func (*SubscriberSnapShot) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SubscriberSnapShot) ProtoReflect() protoreflect.Message {
|
func (x *SubscriberSnapShot) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[24]
|
mi := &file_global_proto_msgTypes[26]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1729,7 +1847,7 @@ func (x *SubscriberSnapShot) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SubscriberSnapShot.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SubscriberSnapShot.ProtoReflect.Descriptor instead.
|
||||||
func (*SubscriberSnapShot) Descriptor() ([]byte, []int) {
|
func (*SubscriberSnapShot) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{24}
|
return file_global_proto_rawDescGZIP(), []int{26}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SubscriberSnapShot) GetId() uint32 {
|
func (x *SubscriberSnapShot) GetId() uint32 {
|
||||||
@@ -1781,7 +1899,7 @@ type SubscribersResponse struct {
|
|||||||
func (x *SubscribersResponse) Reset() {
|
func (x *SubscribersResponse) Reset() {
|
||||||
*x = SubscribersResponse{}
|
*x = SubscribersResponse{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_global_proto_msgTypes[25]
|
mi := &file_global_proto_msgTypes[27]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@@ -1794,7 +1912,7 @@ func (x *SubscribersResponse) String() string {
|
|||||||
func (*SubscribersResponse) ProtoMessage() {}
|
func (*SubscribersResponse) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *SubscribersResponse) ProtoReflect() protoreflect.Message {
|
func (x *SubscribersResponse) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_global_proto_msgTypes[25]
|
mi := &file_global_proto_msgTypes[27]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@@ -1807,7 +1925,7 @@ func (x *SubscribersResponse) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use SubscribersResponse.ProtoReflect.Descriptor instead.
|
// Deprecated: Use SubscribersResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*SubscribersResponse) Descriptor() ([]byte, []int) {
|
func (*SubscribersResponse) Descriptor() ([]byte, []int) {
|
||||||
return file_global_proto_rawDescGZIP(), []int{25}
|
return file_global_proto_rawDescGZIP(), []int{27}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *SubscribersResponse) GetTotal() int32 {
|
func (x *SubscribersResponse) GetTotal() int32 {
|
||||||
@@ -2015,171 +2133,182 @@ var file_global_proto_rawDesc = []byte{
|
|||||||
0x65, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6b,
|
0x65, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6b,
|
||||||
0x65, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x04, 0x77, 0x72, 0x61, 0x70, 0x18,
|
0x65, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x04, 0x77, 0x72, 0x61, 0x70, 0x18,
|
||||||
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x57, 0x72, 0x61, 0x70,
|
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x57, 0x72, 0x61, 0x70,
|
||||||
0x52, 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0xb0, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f,
|
0x52, 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0x29, 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79,
|
||||||
0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
|
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
|
||||||
0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12,
|
0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01,
|
||||||
0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
0x65, 0x22, 0x4c, 0x0a, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
|
||||||
0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20,
|
0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73,
|
0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73,
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66,
|
0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x65,
|
||||||
0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x1e, 0x0a,
|
0x6d, 0x6f, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22,
|
||||||
0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
|
0xb0, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e,
|
||||||
0x0d, 0x52, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a,
|
0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74,
|
||||||
0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x15, 0x54, 0x72,
|
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12,
|
||||||
0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65,
|
||||||
0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28,
|
0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||||
0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61,
|
0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x72,
|
0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
|
||||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x37,
|
0x52, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x61, 0x6d, 0x70,
|
||||||
0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52,
|
0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e,
|
0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
|
||||||
0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x52,
|
0x6c, 0x73, 0x22, 0xe9, 0x01, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
|
||||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
|
0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04,
|
||||||
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
|
0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73,
|
||||||
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c,
|
0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x04,
|
||||||
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb4, 0x01, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f,
|
0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02,
|
||||||
0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b,
|
||||||
0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12,
|
0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
0x2e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65,
|
||||||
0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20,
|
0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x03,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73,
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x72,
|
||||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66,
|
0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x6d, 0x65, 0x6d,
|
||||||
0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x14, 0x0a,
|
0x6f, 0x72, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
|
||||||
0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69,
|
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||||
0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20,
|
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
|
||||||
0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67,
|
0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb4,
|
||||||
0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x6f, 0x70, 0x22, 0x2b, 0x0a,
|
0x01, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66,
|
||||||
0x0f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
|
||||||
0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61,
|
||||||
0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x12, 0x53,
|
0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03,
|
||||||
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d,
|
||||||
0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x18,
|
0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x06,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74,
|
0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68,
|
||||||
0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01,
|
0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69,
|
||||||
0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70,
|
0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d,
|
||||||
0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70,
|
0x52, 0x03, 0x67, 0x6f, 0x70, 0x22, 0x2b, 0x0a, 0x0f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
|
||||||
0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x7a, 0x0a, 0x12, 0x52, 0x69, 0x6e, 0x67, 0x52,
|
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63,
|
||||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, 0x1a, 0x0a,
|
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65,
|
||||||
0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
|
||||||
0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d,
|
0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
|
||||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69,
|
0x02, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
||||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79,
|
0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72,
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x14, 0x0a,
|
0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73,
|
||||||
0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74,
|
0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67,
|
||||||
0x61, 0x74, 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
|
0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65,
|
||||||
0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
|
0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18,
|
||||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74,
|
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22,
|
||||||
0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
0x7a, 0x0a, 0x12, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x61,
|
||||||
|
0x70, 0x53, 0x68, 0x6f, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63,
|
||||||
|
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63,
|
||||||
|
0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x02,
|
||||||
|
0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12,
|
||||||
|
0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05,
|
||||||
|
0x64, 0x65, 0x6c, 0x61, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x04,
|
||||||
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x22, 0xe8, 0x01, 0x0a, 0x12,
|
||||||
|
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68,
|
||||||
|
0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02,
|
||||||
|
0x69, 0x64, 0x12, 0x38, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||||
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||||
|
0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0b,
|
||||||
|
0x61, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x64,
|
||||||
|
0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x0b, 0x61, 0x75, 0x64, 0x69,
|
||||||
|
0x6f, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x0b, 0x76, 0x69, 0x64, 0x65, 0x6f,
|
||||||
|
0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d,
|
||||||
|
0x37, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x61,
|
||||||
|
0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x0b, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x61, 0x64,
|
||||||
|
0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x8e, 0x01, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x73, 0x63,
|
||||||
|
0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14,
|
||||||
|
0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74,
|
||||||
|
0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18,
|
||||||
|
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a,
|
||||||
|
0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
||||||
|
0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69,
|
||||||
|
0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53,
|
||||||
|
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f,
|
||||||
|
0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x32, 0xca, 0x0a, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62,
|
||||||
|
0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e,
|
||||||
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||||
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74,
|
0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x49,
|
||||||
0x54, 0x69, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x61,
|
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4,
|
||||||
0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e,
|
0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x73, 0x69, 0x6e, 0x66,
|
||||||
0x52, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68,
|
0x6f, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67,
|
||||||
0x6f, 0x74, 0x52, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12,
|
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,
|
||||||
0x39, 0x0a, 0x0b, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x04,
|
0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x69, 0x6e, 0x67, 0x52,
|
0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93,
|
||||||
0x65, 0x61, 0x64, 0x65, 0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x0b, 0x76,
|
0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79,
|
||||||
0x69, 0x64, 0x65, 0x6f, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65,
|
0x12, 0x52, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x12, 0x12, 0x2e, 0x6d,
|
||||||
0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x22, 0x8e,
|
0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64,
|
||||||
0x01, 0x0a, 0x13, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65,
|
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18,
|
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14,
|
||||||
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x18, 0x0a, 0x07,
|
0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x2f,
|
||||||
0x70, 0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70,
|
0x7b, 0x69, 0x64, 0x7d, 0x12, 0x50, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12,
|
||||||
0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69,
|
0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
|
||||||
0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69,
|
0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
||||||
0x7a, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
|
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4,
|
||||||
0x32, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
|
0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72,
|
||||||
0x72, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x32,
|
0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x57, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||||
0xca, 0x0a, 0x0a, 0x06, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x79,
|
0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
||||||
0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e,
|
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73,
|
||||||
0x6d, 0x37, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f,
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70,
|
0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12,
|
||||||
0x69, 0x2f, 0x73, 0x79, 0x73, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x75, 0x6d,
|
0x5d, 0x0a, 0x08, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f,
|
||||||
0x6d, 0x61, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
|
||||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d,
|
|
||||||
0x37, 0x73, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
|
||||||
0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69,
|
|
||||||
0x2f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x52, 0x0a, 0x08, 0x53, 0x68, 0x75, 0x74,
|
|
||||||
0x64, 0x6f, 0x77, 0x6e, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65,
|
|
||||||
0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
|
||||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
|
||||||
0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x22, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73,
|
|
||||||
0x68, 0x75, 0x74, 0x64, 0x6f, 0x77, 0x6e, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x50, 0x0a, 0x07,
|
|
||||||
0x52, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65,
|
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
|
|
||||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
|
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
|
||||||
0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70,
|
0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
||||||
0x69, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x57,
|
0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d,
|
0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73,
|
||||||
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
|
0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x77, 0x61, 0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x67,
|
||||||
|
0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x6d,
|
||||||
|
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71,
|
||||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
||||||
0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82,
|
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82,
|
||||||
0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65,
|
0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65,
|
||||||
0x61, 0x6d, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x5d, 0x0a, 0x08, 0x57, 0x61, 0x69, 0x74, 0x4c,
|
0x61, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50,
|
||||||
0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
|
0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75,
|
||||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x6d, 0x37,
|
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x12, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e,
|
||||||
0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74,
|
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16,
|
0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
|
||||||
0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x77, 0x61,
|
0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3,
|
||||||
0x69, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x67, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
|
0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63,
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61,
|
||||||
0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x6d,
|
0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54,
|
||||||
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
|
0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f,
|
0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2f,
|
0x1a, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
|
||||||
0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12,
|
0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3,
|
||||||
0x6d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72,
|
0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f,
|
||||||
0x73, 0x12, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
|
0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65,
|
||||||
0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6d, 0x37, 0x73,
|
0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x56, 0x69,
|
||||||
0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
|
0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x12, 0x16, 0x2e, 0x6d,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61,
|
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71,
|
||||||
0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b,
|
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b,
|
||||||
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72,
|
0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
|
0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
|
||||||
0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x53, 0x6e, 0x61,
|
0x69, 0x64, 0x65, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b,
|
||||||
0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54,
|
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x5e,
|
||||||
0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70,
|
0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61,
|
0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
|
||||||
0x70, 0x69, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e,
|
0x68, 0x49, 0x64, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
|
||||||
0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a,
|
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02,
|
||||||
0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b,
|
0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62,
|
||||||
0x53, 0x6e, 0x61, 0x70, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
|
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a,
|
||||||
0x6d, 0x53, 0x6e, 0x61, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6d,
|
0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x37,
|
||||||
0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74,
|
0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26,
|
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66,
|
||||||
0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x74, 0x72, 0x61, 0x63,
|
0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93,
|
||||||
0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61,
|
0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f,
|
||||||
0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x5e, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75,
|
0x67, 0x65, 0x74, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x5f, 0x0a, 0x0a, 0x47, 0x65,
|
||||||
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65,
|
0x74, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47,
|
||||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x14, 0x2e, 0x6d, 0x37,
|
0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||||
0x73, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
|
||||||
0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12,
|
||||||
0x73, 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b,
|
0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x66, 0x6f, 0x72,
|
||||||
0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
|
0x6d, 0x69, 0x6c, 0x79, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x67, 0x0a, 0x0c, 0x4d,
|
||||||
0x66, 0x69, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
|
0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x6d, 0x37,
|
||||||
0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73,
|
0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65,
|
||||||
0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x63, 0x63,
|
||||||
0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69,
|
0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4,
|
||||||
0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x74, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
|
0x93, 0x02, 0x21, 0x22, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
||||||
0x65, 0x7d, 0x12, 0x5f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79,
|
0x2f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x04,
|
||||||
0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
|
0x79, 0x61, 0x6d, 0x6c, 0x42, 0x14, 0x5a, 0x12, 0x6d, 0x37, 0x73, 0x2e, 0x6c, 0x69, 0x76, 0x65,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65,
|
0x2f, 0x6d, 0x37, 0x73, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
0x6f, 0x33,
|
||||||
0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f,
|
|
||||||
0x6e, 0x66, 0x69, 0x67, 0x2f, 0x66, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x2f, 0x7b, 0x6e, 0x61,
|
|
||||||
0x6d, 0x65, 0x7d, 0x12, 0x67, 0x0a, 0x0c, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x43, 0x6f, 0x6e,
|
|
||||||
0x66, 0x69, 0x67, 0x12, 0x18, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79,
|
|
||||||
0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e,
|
|
||||||
0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
|
||||||
0x6e, 0x73, 0x65, 0x22, 0x27, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x19, 0x2f, 0x61, 0x70,
|
|
||||||
0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x2f,
|
|
||||||
0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x3a, 0x04, 0x79, 0x61, 0x6d, 0x6c, 0x42, 0x14, 0x5a, 0x12,
|
|
||||||
0x6d, 0x37, 0x73, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x2f, 0x6d, 0x37, 0x73, 0x2f, 0x76, 0x35, 0x2f,
|
|
||||||
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -2194,7 +2323,7 @@ func file_global_proto_rawDescGZIP() []byte {
|
|||||||
return file_global_proto_rawDescData
|
return file_global_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 31)
|
var file_global_proto_msgTypes = make([]protoimpl.MessageInfo, 33)
|
||||||
var file_global_proto_goTypes = []interface{}{
|
var file_global_proto_goTypes = []interface{}{
|
||||||
(*GetConfigRequest)(nil), // 0: m7s.GetConfigRequest
|
(*GetConfigRequest)(nil), // 0: m7s.GetConfigRequest
|
||||||
(*Formily)(nil), // 1: m7s.Formily
|
(*Formily)(nil), // 1: m7s.Formily
|
||||||
@@ -2213,82 +2342,86 @@ var file_global_proto_goTypes = []interface{}{
|
|||||||
(*StreamInfoResponse)(nil), // 14: m7s.StreamInfoResponse
|
(*StreamInfoResponse)(nil), // 14: m7s.StreamInfoResponse
|
||||||
(*Wrap)(nil), // 15: m7s.Wrap
|
(*Wrap)(nil), // 15: m7s.Wrap
|
||||||
(*TrackSnapShot)(nil), // 16: m7s.TrackSnapShot
|
(*TrackSnapShot)(nil), // 16: m7s.TrackSnapShot
|
||||||
(*AudioTrackInfo)(nil), // 17: m7s.AudioTrackInfo
|
(*MemoryBlock)(nil), // 17: m7s.MemoryBlock
|
||||||
(*TrackSnapShotResponse)(nil), // 18: m7s.TrackSnapShotResponse
|
(*MemoryBlockGroup)(nil), // 18: m7s.MemoryBlockGroup
|
||||||
(*VideoTrackInfo)(nil), // 19: m7s.VideoTrackInfo
|
(*AudioTrackInfo)(nil), // 19: m7s.AudioTrackInfo
|
||||||
(*SuccessResponse)(nil), // 20: m7s.SuccessResponse
|
(*TrackSnapShotResponse)(nil), // 20: m7s.TrackSnapShotResponse
|
||||||
(*RequestWithId)(nil), // 21: m7s.RequestWithId
|
(*VideoTrackInfo)(nil), // 21: m7s.VideoTrackInfo
|
||||||
(*SubscribersRequest)(nil), // 22: m7s.SubscribersRequest
|
(*SuccessResponse)(nil), // 22: m7s.SuccessResponse
|
||||||
(*RingReaderSnapShot)(nil), // 23: m7s.RingReaderSnapShot
|
(*RequestWithId)(nil), // 23: m7s.RequestWithId
|
||||||
(*SubscriberSnapShot)(nil), // 24: m7s.SubscriberSnapShot
|
(*SubscribersRequest)(nil), // 24: m7s.SubscribersRequest
|
||||||
(*SubscribersResponse)(nil), // 25: m7s.SubscribersResponse
|
(*RingReaderSnapShot)(nil), // 25: m7s.RingReaderSnapShot
|
||||||
nil, // 26: m7s.Formily.PropertiesEntry
|
(*SubscriberSnapShot)(nil), // 26: m7s.SubscriberSnapShot
|
||||||
nil, // 27: m7s.Formily.ComponentPropsEntry
|
(*SubscribersResponse)(nil), // 27: m7s.SubscribersResponse
|
||||||
nil, // 28: m7s.FormilyResponse.PropertiesEntry
|
nil, // 28: m7s.Formily.PropertiesEntry
|
||||||
nil, // 29: m7s.StreamWaitListResponse.ListEntry
|
nil, // 29: m7s.Formily.ComponentPropsEntry
|
||||||
nil, // 30: m7s.TrackSnapShotResponse.ReaderEntry
|
nil, // 30: m7s.FormilyResponse.PropertiesEntry
|
||||||
(*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp
|
nil, // 31: m7s.StreamWaitListResponse.ListEntry
|
||||||
(*anypb.Any)(nil), // 32: google.protobuf.Any
|
nil, // 32: m7s.TrackSnapShotResponse.ReaderEntry
|
||||||
(*emptypb.Empty)(nil), // 33: google.protobuf.Empty
|
(*timestamppb.Timestamp)(nil), // 33: google.protobuf.Timestamp
|
||||||
|
(*anypb.Any)(nil), // 34: google.protobuf.Any
|
||||||
|
(*emptypb.Empty)(nil), // 35: google.protobuf.Empty
|
||||||
}
|
}
|
||||||
var file_global_proto_depIdxs = []int32{
|
var file_global_proto_depIdxs = []int32{
|
||||||
26, // 0: m7s.Formily.properties:type_name -> m7s.Formily.PropertiesEntry
|
28, // 0: m7s.Formily.properties:type_name -> m7s.Formily.PropertiesEntry
|
||||||
27, // 1: m7s.Formily.componentProps:type_name -> m7s.Formily.ComponentPropsEntry
|
29, // 1: m7s.Formily.componentProps:type_name -> m7s.Formily.ComponentPropsEntry
|
||||||
28, // 2: m7s.FormilyResponse.properties:type_name -> m7s.FormilyResponse.PropertiesEntry
|
30, // 2: m7s.FormilyResponse.properties:type_name -> m7s.FormilyResponse.PropertiesEntry
|
||||||
6, // 3: m7s.SummaryResponse.memory:type_name -> m7s.Usage
|
6, // 3: m7s.SummaryResponse.memory:type_name -> m7s.Usage
|
||||||
6, // 4: m7s.SummaryResponse.hardDisk:type_name -> m7s.Usage
|
6, // 4: m7s.SummaryResponse.hardDisk:type_name -> m7s.Usage
|
||||||
5, // 5: m7s.SummaryResponse.netWork:type_name -> m7s.NetWorkInfo
|
5, // 5: m7s.SummaryResponse.netWork:type_name -> m7s.NetWorkInfo
|
||||||
31, // 6: m7s.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp
|
33, // 6: m7s.SysInfoResponse.startTime:type_name -> google.protobuf.Timestamp
|
||||||
8, // 7: m7s.SysInfoResponse.plugins:type_name -> m7s.PluginInfo
|
8, // 7: m7s.SysInfoResponse.plugins:type_name -> m7s.PluginInfo
|
||||||
14, // 8: m7s.StreamListResponse.list:type_name -> m7s.StreamInfoResponse
|
14, // 8: m7s.StreamListResponse.list:type_name -> m7s.StreamInfoResponse
|
||||||
29, // 9: m7s.StreamWaitListResponse.list:type_name -> m7s.StreamWaitListResponse.ListEntry
|
31, // 9: m7s.StreamWaitListResponse.list:type_name -> m7s.StreamWaitListResponse.ListEntry
|
||||||
17, // 10: m7s.StreamInfoResponse.audioTrack:type_name -> m7s.AudioTrackInfo
|
19, // 10: m7s.StreamInfoResponse.audioTrack:type_name -> m7s.AudioTrackInfo
|
||||||
19, // 11: m7s.StreamInfoResponse.videoTrack:type_name -> m7s.VideoTrackInfo
|
21, // 11: m7s.StreamInfoResponse.videoTrack:type_name -> m7s.VideoTrackInfo
|
||||||
31, // 12: m7s.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp
|
33, // 12: m7s.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp
|
||||||
31, // 13: m7s.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp
|
33, // 13: m7s.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp
|
||||||
15, // 14: m7s.TrackSnapShot.wrap:type_name -> m7s.Wrap
|
15, // 14: m7s.TrackSnapShot.wrap:type_name -> m7s.Wrap
|
||||||
16, // 15: m7s.TrackSnapShotResponse.ring:type_name -> m7s.TrackSnapShot
|
17, // 15: m7s.MemoryBlockGroup.list:type_name -> m7s.MemoryBlock
|
||||||
30, // 16: m7s.TrackSnapShotResponse.reader:type_name -> m7s.TrackSnapShotResponse.ReaderEntry
|
16, // 16: m7s.TrackSnapShotResponse.ring:type_name -> m7s.TrackSnapShot
|
||||||
31, // 17: m7s.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp
|
32, // 17: m7s.TrackSnapShotResponse.reader:type_name -> m7s.TrackSnapShotResponse.ReaderEntry
|
||||||
23, // 18: m7s.SubscriberSnapShot.audioReader:type_name -> m7s.RingReaderSnapShot
|
18, // 18: m7s.TrackSnapShotResponse.memory:type_name -> m7s.MemoryBlockGroup
|
||||||
23, // 19: m7s.SubscriberSnapShot.videoReader:type_name -> m7s.RingReaderSnapShot
|
33, // 19: m7s.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp
|
||||||
24, // 20: m7s.SubscribersResponse.list:type_name -> m7s.SubscriberSnapShot
|
25, // 20: m7s.SubscriberSnapShot.audioReader:type_name -> m7s.RingReaderSnapShot
|
||||||
1, // 21: m7s.Formily.PropertiesEntry.value:type_name -> m7s.Formily
|
25, // 21: m7s.SubscriberSnapShot.videoReader:type_name -> m7s.RingReaderSnapShot
|
||||||
32, // 22: m7s.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any
|
26, // 22: m7s.SubscribersResponse.list:type_name -> m7s.SubscriberSnapShot
|
||||||
1, // 23: m7s.FormilyResponse.PropertiesEntry.value:type_name -> m7s.Formily
|
1, // 23: m7s.Formily.PropertiesEntry.value:type_name -> m7s.Formily
|
||||||
33, // 24: m7s.Global.SysInfo:input_type -> google.protobuf.Empty
|
34, // 24: m7s.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any
|
||||||
33, // 25: m7s.Global.Summary:input_type -> google.protobuf.Empty
|
1, // 25: m7s.FormilyResponse.PropertiesEntry.value:type_name -> m7s.Formily
|
||||||
21, // 26: m7s.Global.Shutdown:input_type -> m7s.RequestWithId
|
35, // 26: m7s.Global.SysInfo:input_type -> google.protobuf.Empty
|
||||||
21, // 27: m7s.Global.Restart:input_type -> m7s.RequestWithId
|
35, // 27: m7s.Global.Summary:input_type -> google.protobuf.Empty
|
||||||
10, // 28: m7s.Global.StreamList:input_type -> m7s.StreamListRequest
|
23, // 28: m7s.Global.Shutdown:input_type -> m7s.RequestWithId
|
||||||
33, // 29: m7s.Global.WaitList:input_type -> google.protobuf.Empty
|
23, // 29: m7s.Global.Restart:input_type -> m7s.RequestWithId
|
||||||
13, // 30: m7s.Global.StreamInfo:input_type -> m7s.StreamSnapRequest
|
10, // 30: m7s.Global.StreamList:input_type -> m7s.StreamListRequest
|
||||||
22, // 31: m7s.Global.GetSubscribers:input_type -> m7s.SubscribersRequest
|
35, // 31: m7s.Global.WaitList:input_type -> google.protobuf.Empty
|
||||||
13, // 32: m7s.Global.AudioTrackSnap:input_type -> m7s.StreamSnapRequest
|
13, // 32: m7s.Global.StreamInfo:input_type -> m7s.StreamSnapRequest
|
||||||
13, // 33: m7s.Global.VideoTrackSnap:input_type -> m7s.StreamSnapRequest
|
24, // 33: m7s.Global.GetSubscribers:input_type -> m7s.SubscribersRequest
|
||||||
21, // 34: m7s.Global.StopSubscribe:input_type -> m7s.RequestWithId
|
13, // 34: m7s.Global.AudioTrackSnap:input_type -> m7s.StreamSnapRequest
|
||||||
0, // 35: m7s.Global.GetConfig:input_type -> m7s.GetConfigRequest
|
13, // 35: m7s.Global.VideoTrackSnap:input_type -> m7s.StreamSnapRequest
|
||||||
0, // 36: m7s.Global.GetFormily:input_type -> m7s.GetConfigRequest
|
23, // 36: m7s.Global.StopSubscribe:input_type -> m7s.RequestWithId
|
||||||
4, // 37: m7s.Global.ModifyConfig:input_type -> m7s.ModifyConfigRequest
|
0, // 37: m7s.Global.GetConfig:input_type -> m7s.GetConfigRequest
|
||||||
9, // 38: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse
|
0, // 38: m7s.Global.GetFormily:input_type -> m7s.GetConfigRequest
|
||||||
7, // 39: m7s.Global.Summary:output_type -> m7s.SummaryResponse
|
4, // 39: m7s.Global.ModifyConfig:input_type -> m7s.ModifyConfigRequest
|
||||||
33, // 40: m7s.Global.Shutdown:output_type -> google.protobuf.Empty
|
9, // 40: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse
|
||||||
33, // 41: m7s.Global.Restart:output_type -> google.protobuf.Empty
|
7, // 41: m7s.Global.Summary:output_type -> m7s.SummaryResponse
|
||||||
11, // 42: m7s.Global.StreamList:output_type -> m7s.StreamListResponse
|
35, // 42: m7s.Global.Shutdown:output_type -> google.protobuf.Empty
|
||||||
12, // 43: m7s.Global.WaitList:output_type -> m7s.StreamWaitListResponse
|
35, // 43: m7s.Global.Restart:output_type -> google.protobuf.Empty
|
||||||
14, // 44: m7s.Global.StreamInfo:output_type -> m7s.StreamInfoResponse
|
11, // 44: m7s.Global.StreamList:output_type -> m7s.StreamListResponse
|
||||||
25, // 45: m7s.Global.GetSubscribers:output_type -> m7s.SubscribersResponse
|
12, // 45: m7s.Global.WaitList:output_type -> m7s.StreamWaitListResponse
|
||||||
18, // 46: m7s.Global.AudioTrackSnap:output_type -> m7s.TrackSnapShotResponse
|
14, // 46: m7s.Global.StreamInfo:output_type -> m7s.StreamInfoResponse
|
||||||
18, // 47: m7s.Global.VideoTrackSnap:output_type -> m7s.TrackSnapShotResponse
|
27, // 47: m7s.Global.GetSubscribers:output_type -> m7s.SubscribersResponse
|
||||||
20, // 48: m7s.Global.StopSubscribe:output_type -> m7s.SuccessResponse
|
20, // 48: m7s.Global.AudioTrackSnap:output_type -> m7s.TrackSnapShotResponse
|
||||||
3, // 49: m7s.Global.GetConfig:output_type -> m7s.GetConfigResponse
|
20, // 49: m7s.Global.VideoTrackSnap:output_type -> m7s.TrackSnapShotResponse
|
||||||
3, // 50: m7s.Global.GetFormily:output_type -> m7s.GetConfigResponse
|
22, // 50: m7s.Global.StopSubscribe:output_type -> m7s.SuccessResponse
|
||||||
20, // 51: m7s.Global.ModifyConfig:output_type -> m7s.SuccessResponse
|
3, // 51: m7s.Global.GetConfig:output_type -> m7s.GetConfigResponse
|
||||||
38, // [38:52] is the sub-list for method output_type
|
3, // 52: m7s.Global.GetFormily:output_type -> m7s.GetConfigResponse
|
||||||
24, // [24:38] is the sub-list for method input_type
|
22, // 53: m7s.Global.ModifyConfig:output_type -> m7s.SuccessResponse
|
||||||
24, // [24:24] is the sub-list for extension type_name
|
40, // [40:54] is the sub-list for method output_type
|
||||||
24, // [24:24] is the sub-list for extension extendee
|
26, // [26:40] is the sub-list for method input_type
|
||||||
0, // [0:24] is the sub-list for field type_name
|
26, // [26:26] is the sub-list for extension type_name
|
||||||
|
26, // [26:26] is the sub-list for extension extendee
|
||||||
|
0, // [0:26] is the sub-list for field type_name
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_global_proto_init() }
|
func init() { file_global_proto_init() }
|
||||||
@@ -2502,7 +2635,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*AudioTrackInfo); i {
|
switch v := v.(*MemoryBlock); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2514,7 +2647,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*TrackSnapShotResponse); i {
|
switch v := v.(*MemoryBlockGroup); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2526,7 +2659,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*VideoTrackInfo); i {
|
switch v := v.(*AudioTrackInfo); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2538,7 +2671,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SuccessResponse); i {
|
switch v := v.(*TrackSnapShotResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2550,7 +2683,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*RequestWithId); i {
|
switch v := v.(*VideoTrackInfo); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2562,7 +2695,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SubscribersRequest); i {
|
switch v := v.(*SuccessResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2574,7 +2707,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*RingReaderSnapShot); i {
|
switch v := v.(*RequestWithId); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2586,7 +2719,7 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SubscriberSnapShot); i {
|
switch v := v.(*SubscribersRequest); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@@ -2598,6 +2731,30 @@ func file_global_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_global_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
|
file_global_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*RingReaderSnapShot); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_global_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*SubscriberSnapShot); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_global_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*SubscribersResponse); i {
|
switch v := v.(*SubscribersResponse); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@@ -2616,7 +2773,7 @@ func file_global_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_global_proto_rawDesc,
|
RawDescriptor: file_global_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 31,
|
NumMessages: 33,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 1,
|
NumServices: 1,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -197,6 +197,16 @@ message TrackSnapShot {
|
|||||||
repeated Wrap wrap = 5;
|
repeated Wrap wrap = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message MemoryBlock {
|
||||||
|
uint32 s = 1;
|
||||||
|
uint32 e = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message MemoryBlockGroup {
|
||||||
|
uint32 size = 1;
|
||||||
|
repeated MemoryBlock list = 2;
|
||||||
|
}
|
||||||
|
|
||||||
message AudioTrackInfo {
|
message AudioTrackInfo {
|
||||||
string codec = 1;
|
string codec = 1;
|
||||||
string delta = 2;
|
string delta = 2;
|
||||||
@@ -210,6 +220,7 @@ message AudioTrackInfo {
|
|||||||
message TrackSnapShotResponse {
|
message TrackSnapShotResponse {
|
||||||
repeated TrackSnapShot ring = 1;
|
repeated TrackSnapShot ring = 1;
|
||||||
map<uint32, uint32> reader = 2;
|
map<uint32, uint32> reader = 2;
|
||||||
|
repeated MemoryBlockGroup memory = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message VideoTrackInfo {
|
message VideoTrackInfo {
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
type AnnexB struct {
|
type AnnexB struct {
|
||||||
PTS time.Duration
|
PTS time.Duration
|
||||||
DTS time.Duration
|
DTS time.Duration
|
||||||
util.RecyclableBuffers
|
util.RecyclableMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
// DecodeConfig implements pkg.IAVFrame.
|
// DecodeConfig implements pkg.IAVFrame.
|
||||||
@@ -27,7 +27,7 @@ func (a *AnnexB) DecodeConfig(t *AVTrack, ctx ICodecCtx) error {
|
|||||||
|
|
||||||
// GetSize implements pkg.IAVFrame.
|
// GetSize implements pkg.IAVFrame.
|
||||||
func (a *AnnexB) GetSize() int {
|
func (a *AnnexB) GetSize() int {
|
||||||
return a.Length
|
return a.Size
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *AnnexB) GetTimestamp() time.Duration {
|
func (a *AnnexB) GetTimestamp() time.Duration {
|
||||||
@@ -41,7 +41,7 @@ func (a *AnnexB) Parse(t *AVTrack) (isIDR bool, isSeq bool, raw any, err error)
|
|||||||
|
|
||||||
// String implements pkg.IAVFrame.
|
// String implements pkg.IAVFrame.
|
||||||
func (a *AnnexB) String() string {
|
func (a *AnnexB) String() string {
|
||||||
return fmt.Sprintf("%d %d", a.DTS, a.Buffers.Length)
|
return fmt.Sprintf("%d %d", a.DTS, a.Memory.Size)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToRaw implements pkg.IAVFrame.
|
// ToRaw implements pkg.IAVFrame.
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ type (
|
|||||||
Raw any `json:"-" yaml:"-"` // 裸格式
|
Raw any `json:"-" yaml:"-"` // 裸格式
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ IAVFrame = (*AnnexB)(nil)
|
var _ IAVFrame = (*AnnexB)(nil)
|
||||||
|
|
||||||
func (frame *AVFrame) Reset() {
|
func (frame *AVFrame) Reset() {
|
||||||
frame.Timestamp = 0
|
frame.Timestamp = 0
|
||||||
for _, wrap := range frame.Wraps {
|
for _, wrap := range frame.Wraps {
|
||||||
@@ -98,7 +100,7 @@ func (nalus *Nalus) Append(bytes ...[]byte) {
|
|||||||
nalus.Nalus = append(nalus.Nalus, bytes)
|
nalus.Nalus = append(nalus.Nalus, bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (nalus *Nalus) ParseAVCC(reader *util.Buffers, naluSizeLen int) error {
|
func (nalus *Nalus) ParseAVCC(reader *util.MemoryReader, naluSizeLen int) error {
|
||||||
for reader.Length > 0 {
|
for reader.Length > 0 {
|
||||||
l, err := reader.ReadBE(naluSizeLen)
|
l, err := reader.ReadBE(naluSizeLen)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -122,20 +124,20 @@ func (obus *OBUs) Append(bytes ...[]byte) {
|
|||||||
obus.OBUs = append(obus.OBUs, bytes)
|
obus.OBUs = append(obus.OBUs, bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (obus *OBUs) ParseAVCC(reader *util.Buffers) error {
|
func (obus *OBUs) ParseAVCC(reader *util.MemoryReader) error {
|
||||||
var obuHeader av1.OBUHeader
|
var obuHeader av1.OBUHeader
|
||||||
|
startLen := reader.Length
|
||||||
for reader.Length > 0 {
|
for reader.Length > 0 {
|
||||||
offset := reader.Offset
|
offset := reader.Size - reader.Length
|
||||||
b, _ := reader.ReadByte()
|
b, _ := reader.ReadByte()
|
||||||
obuHeader.Unmarshal([]byte{b})
|
obuHeader.Unmarshal([]byte{b})
|
||||||
// if log.Trace {
|
// if log.Trace {
|
||||||
// vt.Trace("obu", zap.Any("type", obuHeader.Type), zap.Bool("iframe", vt.Value.IFrame))
|
// vt.Trace("obu", zap.Any("type", obuHeader.Type), zap.Bool("iframe", vt.Value.IFrame))
|
||||||
// }
|
// }
|
||||||
obuSize, _, _ := reader.LEB128Unmarshal()
|
obuSize, _, _ := reader.LEB128Unmarshal()
|
||||||
end := reader.Offset
|
end := reader.Size - reader.Length
|
||||||
size := end - offset + int(obuSize)
|
size := end - offset + int(obuSize)
|
||||||
reader = &util.Buffers{Buffers: reader.Buffers}
|
reader = &util.MemoryReader{Memory: reader.Memory, Length: startLen - offset}
|
||||||
reader.Skip(offset)
|
|
||||||
obu, err := reader.ReadBytes(size)
|
obu, err := reader.ReadBytes(size)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ type RingWriter struct {
|
|||||||
*util.Ring[AVFrame]
|
*util.Ring[AVFrame]
|
||||||
IDRingList //最近的关键帧位置,首屏渲染
|
IDRingList //最近的关键帧位置,首屏渲染
|
||||||
ReaderCount atomic.Int32
|
ReaderCount atomic.Int32
|
||||||
Allocator *util.ScalableMemoryAllocator
|
|
||||||
pool *util.Ring[AVFrame]
|
pool *util.Ring[AVFrame]
|
||||||
poolSize int
|
poolSize int
|
||||||
Size int
|
Size int
|
||||||
@@ -60,7 +59,7 @@ func (rb *RingWriter) Glow(size int) (newItem *util.Ring[AVFrame]) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (rb *RingWriter) Recycle(r *util.Ring[AVFrame]) {
|
func (rb *RingWriter) recycle(r *util.Ring[AVFrame]) {
|
||||||
rb.poolSize++
|
rb.poolSize++
|
||||||
r.Value.Reset()
|
r.Value.Reset()
|
||||||
if rb.pool == nil {
|
if rb.pool == nil {
|
||||||
@@ -72,23 +71,18 @@ func (rb *RingWriter) Recycle(r *util.Ring[AVFrame]) {
|
|||||||
|
|
||||||
func (rb *RingWriter) Reduce(size int) (r *util.Ring[AVFrame]) {
|
func (rb *RingWriter) Reduce(size int) (r *util.Ring[AVFrame]) {
|
||||||
r = rb.Unlink(size)
|
r = rb.Unlink(size)
|
||||||
if size > 1 {
|
|
||||||
for p := r.Next(); p != r; {
|
for p := r.Next(); p != r; {
|
||||||
next := p.Next() //先保存下一个节点
|
next := p.Next() //先保存下一个节点
|
||||||
if p.Value.discard {
|
if p.Value.TryLock() {
|
||||||
p.Prev().Unlink(1)
|
rb.recycle(p)
|
||||||
|
p.Value.Unlock()
|
||||||
|
} else {
|
||||||
|
p.Value.discard = true
|
||||||
|
dr := p.Prev().Unlink(1)
|
||||||
|
dr.Value.Reset()
|
||||||
}
|
}
|
||||||
// if p.Value.Discard() == 0 {
|
|
||||||
// rb.Recycle(p.Prev().Unlink(1))
|
|
||||||
// } else {
|
|
||||||
// // fmt.Println("Reduce", p.Value.ReaderCount())
|
|
||||||
// }
|
|
||||||
p = next
|
p = next
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// if r.Value.Discard() == 0 {
|
|
||||||
// rb.Recycle(r)
|
|
||||||
// }
|
|
||||||
rb.Size -= size
|
rb.Size -= size
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ type (
|
|||||||
Track
|
Track
|
||||||
*RingWriter
|
*RingWriter
|
||||||
ICodecCtx
|
ICodecCtx
|
||||||
|
Allocator *util.ScalableMemoryAllocator
|
||||||
SequenceFrame IAVFrame
|
SequenceFrame IAVFrame
|
||||||
WrapIndex int
|
WrapIndex int
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,14 +8,15 @@ const defaultBufSize = 65536
|
|||||||
|
|
||||||
type BufReader struct {
|
type BufReader struct {
|
||||||
reader io.Reader
|
reader io.Reader
|
||||||
buf RecyclableBuffers
|
allocator *ScalableMemoryAllocator
|
||||||
|
buf MemoryReader
|
||||||
BufLen int
|
BufLen int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBufReaderWithBufLen(reader io.Reader, bufLen int) (r *BufReader) {
|
func NewBufReaderWithBufLen(reader io.Reader, bufLen int) (r *BufReader) {
|
||||||
r = &BufReader{}
|
r = &BufReader{}
|
||||||
r.reader = reader
|
r.reader = reader
|
||||||
r.buf.ScalableMemoryAllocator = NewScalableMemoryAllocator(bufLen)
|
r.allocator = NewScalableMemoryAllocator(bufLen)
|
||||||
r.BufLen = bufLen
|
r.BufLen = bufLen
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -23,33 +24,33 @@ func NewBufReaderWithBufLen(reader io.Reader, bufLen int) (r *BufReader) {
|
|||||||
func NewBufReader(reader io.Reader) (r *BufReader) {
|
func NewBufReader(reader io.Reader) (r *BufReader) {
|
||||||
r = &BufReader{}
|
r = &BufReader{}
|
||||||
r.reader = reader
|
r.reader = reader
|
||||||
r.buf.ScalableMemoryAllocator = NewScalableMemoryAllocator(defaultBufSize)
|
r.allocator = NewScalableMemoryAllocator(defaultBufSize)
|
||||||
r.BufLen = defaultBufSize
|
r.BufLen = defaultBufSize
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *BufReader) GetAllocator() *ScalableMemoryAllocator {
|
|
||||||
return r.buf.ScalableMemoryAllocator
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *BufReader) eat() error {
|
func (r *BufReader) eat() error {
|
||||||
buf := r.buf.NextN(r.BufLen)
|
buf := r.allocator.Malloc(r.BufLen)
|
||||||
if n, err := r.reader.Read(buf); err != nil {
|
if n, err := r.reader.Read(buf); err != nil {
|
||||||
|
r.allocator.Free(buf)
|
||||||
return err
|
return err
|
||||||
} else if n < r.BufLen {
|
} else if n < r.BufLen {
|
||||||
r.buf.RecycleBack(r.BufLen - n)
|
r.buf.ReadFromBytes(buf[:n])
|
||||||
|
r.allocator.Free(buf[n:])
|
||||||
|
} else if n == r.BufLen {
|
||||||
|
r.buf.ReadFromBytes(buf)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *BufReader) ReadByte() (byte, error) {
|
func (r *BufReader) ReadByte() (b byte, err error) {
|
||||||
for r.buf.Length == 0 {
|
for ; r.buf.Length == 0 && err == nil; err = r.eat() {
|
||||||
err := r.eat()
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
}
|
||||||
|
if err == nil {
|
||||||
|
b, err = r.buf.ReadByte()
|
||||||
}
|
}
|
||||||
return r.buf.ReadByte()
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *BufReader) ReadBE(n int) (num int, err error) {
|
func (r *BufReader) ReadBE(n int) (num int, err error) {
|
||||||
@@ -85,17 +86,24 @@ func (r *BufReader) ReadBE32(n int) (num uint32, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *BufReader) ReadBytes(n int) (mem RecyclableBuffers, err error) {
|
func (r *BufReader) ReadBytes(n int) (mem RecyclableMemory, err error) {
|
||||||
mem.ScalableMemoryAllocator = r.buf.ScalableMemoryAllocator
|
mem.ScalableMemoryAllocator = r.allocator
|
||||||
for r.buf.RecycleFront(); n > 0 && err == nil; err = r.eat() {
|
for r.recycleFront(); n > 0 && err == nil; err = r.eat() {
|
||||||
if r.buf.Length > 0 {
|
if r.buf.Length > 0 {
|
||||||
if r.buf.Length >= n {
|
if r.buf.Length >= n {
|
||||||
mem.ReadFromBytes(r.buf.Buffers.Cut(n)...)
|
mem.ReadFromBytes(r.buf.ClipN(n)...)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
n -= r.buf.Length
|
n -= r.buf.Length
|
||||||
mem.ReadFromBytes(r.buf.CutAll()...)
|
mem.ReadFromBytes(r.buf.Memory.Buffers...)
|
||||||
|
r.buf = MemoryReader{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *BufReader) recycleFront() {
|
||||||
|
for _, buf := range r.buf.ClipFront() {
|
||||||
|
r.allocator.Free(buf)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,15 +4,30 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"io"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type limitReader struct {
|
||||||
|
reader io.Reader
|
||||||
|
limit int
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *limitReader) Read(p []byte) (n int, err error) {
|
||||||
|
if len(p) > l.limit {
|
||||||
|
p = p[:l.limit]
|
||||||
|
}
|
||||||
|
n, err = l.reader.Read(p)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func TestBufRead(t *testing.T) {
|
func TestBufRead(t *testing.T) {
|
||||||
t.Run(t.Name(), func(t *testing.T) {
|
t.Run(t.Name(), func(t *testing.T) {
|
||||||
var testData = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
|
var testData = []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}
|
||||||
testReader := bytes.NewReader(testData)
|
testReader := bytes.NewReader(testData)
|
||||||
reader := NewBufReader(testReader)
|
limitReader := &limitReader{reader: testReader, limit: 2}
|
||||||
|
reader := NewBufReader(limitReader)
|
||||||
reader.BufLen = 5
|
reader.BufLen = 5
|
||||||
b, err := reader.ReadByte()
|
b, err := reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -32,10 +47,6 @@ func TestBufRead(t *testing.T) {
|
|||||||
t.Error("read be error")
|
t.Error("read be error")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if reader.buf.Length != 0 {
|
|
||||||
t.Error("reader.buf.Length != 0")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
b, err = reader.ReadByte()
|
b, err = reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
@@ -50,16 +61,14 @@ func TestBufRead(t *testing.T) {
|
|||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(mem.Buffers.Buffers) != 2 {
|
reader2 := mem.NewReader()
|
||||||
t.Error("len(mem.Buffers.Buffers) != 2")
|
b, err = reader2.ReadByte()
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if mem.Buffers.Buffers[0][0] != 7 {
|
if b != 7 {
|
||||||
t.Error("mem.Buffers.Buffers[0][0] != 7")
|
t.Error("byte read error")
|
||||||
return
|
|
||||||
}
|
|
||||||
if mem.Buffers.Buffers[1][0] != 11 {
|
|
||||||
t.Error("mem.Buffers.Buffers[1][0] != 10")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
b, err = reader.ReadByte()
|
b, err = reader.ReadByte()
|
||||||
@@ -105,7 +114,7 @@ func BenchmarkBufRead(b *testing.B) {
|
|||||||
b.RunParallel(func(pb *testing.PB) {
|
b.RunParallel(func(pb *testing.PB) {
|
||||||
var testData = make([]byte, 10*1024*1024)
|
var testData = make([]byte, 10*1024*1024)
|
||||||
var err error
|
var err error
|
||||||
var mem RecyclableBuffers
|
var mem RecyclableMemory
|
||||||
for pb.Next() {
|
for pb.Next() {
|
||||||
rand.Read(testData)
|
rand.Read(testData)
|
||||||
testReader := bytes.NewReader(testData)
|
testReader := bytes.NewReader(testData)
|
||||||
|
|||||||
@@ -6,71 +6,105 @@ import (
|
|||||||
"slices"
|
"slices"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Buffers struct {
|
type Memory struct {
|
||||||
Offset int
|
Size int
|
||||||
offset int
|
|
||||||
Length int
|
|
||||||
curBuf []byte
|
|
||||||
curBufLen int
|
|
||||||
net.Buffers
|
net.Buffers
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBuffersFromBytes(b ...[]byte) *Buffers {
|
type MemoryReader struct {
|
||||||
return NewBuffers(net.Buffers(b))
|
Memory
|
||||||
|
Length int
|
||||||
|
offset0 int
|
||||||
|
offset1 int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewBuffers(buffers net.Buffers) *Buffers {
|
func NewMemoryFromBytes(b ...[]byte) *Memory {
|
||||||
ret := &Buffers{Buffers: buffers}
|
return NewMemory(b)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewReadableBuffersFromBytes(b ...[]byte) *MemoryReader {
|
||||||
|
buf := NewMemory(b)
|
||||||
|
return &MemoryReader{Memory: *buf, Length: buf.Size}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewMemory(buffers net.Buffers) *Memory {
|
||||||
|
ret := &Memory{Buffers: buffers}
|
||||||
for _, level0 := range buffers {
|
for _, level0 := range buffers {
|
||||||
ret.Length += len(level0)
|
ret.Size += len(level0)
|
||||||
}
|
}
|
||||||
ret.curBuf = buffers[0]
|
|
||||||
ret.curBufLen = len(buffers[0])
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) Pop() []byte {
|
func (buffers *Memory) ReadFromBytes(b ...[]byte) {
|
||||||
if buffers.Length == 0 {
|
buffers.Buffers = append(buffers.Buffers, b...)
|
||||||
|
for _, level0 := range b {
|
||||||
|
buffers.Size += len(level0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *Memory) Count() int {
|
||||||
|
return len(buffers.Buffers)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *Memory) Pop() []byte {
|
||||||
|
if buffers.Size == 0 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
l := len(buffers.Buffers) - 1
|
l := len(buffers.Buffers) - 1
|
||||||
last := buffers.Buffers[l]
|
last := buffers.Buffers[l]
|
||||||
buffers.Buffers = buffers.Buffers[:l]
|
buffers.Buffers = buffers.Buffers[:l]
|
||||||
buffers.Length -= len(last)
|
buffers.Size -= len(last)
|
||||||
if buffers.offset == l {
|
|
||||||
buffers.curBuf = nil
|
|
||||||
buffers.curBufLen = 0
|
|
||||||
}
|
|
||||||
return last
|
return last
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) MoveToEnd() {
|
// func (buffers *Buffers) WriteTo(w io.Writer) (n int64, err error) {
|
||||||
buffers.curBuf = nil
|
// var buf net.Buffers
|
||||||
buffers.curBufLen = 0
|
// for _, buffer := range buffers.Buffers {
|
||||||
buffers.offset = len(buffers.Buffers)
|
// buf = append(buf, buffer)
|
||||||
buffers.Offset = buffers.Length
|
// }
|
||||||
|
// return buf.WriteTo(w)
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (r Memory) NewReader() *MemoryReader {
|
||||||
|
var reader MemoryReader
|
||||||
|
reader.Memory = r
|
||||||
|
reader.Length = r.Size
|
||||||
|
return &reader
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *MemoryReader) ReadFromBytes(b ...[]byte) {
|
||||||
|
buffers.Memory.Buffers = append(buffers.Memory.Buffers, b...)
|
||||||
|
for _, level0 := range b {
|
||||||
|
buffers.Size += len(level0)
|
||||||
|
buffers.Length += len(level0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *MemoryReader) Pop() []byte {
|
||||||
|
panic("ReadableBuffers Pop not allowed")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *MemoryReader) GetCurrent() []byte {
|
||||||
|
return buffers.Memory.Buffers[buffers.offset0][buffers.offset1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
func (buffers *MemoryReader) MoveToEnd() {
|
||||||
|
buffers.offset0 = buffers.Count()
|
||||||
|
buffers.offset1 = 0
|
||||||
buffers.Length = 0
|
buffers.Length = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ReadFromBytes(b ...[]byte) {
|
func (buffers *MemoryReader) ReadBytesTo(buf []byte) (actual int) {
|
||||||
buffers.Buffers = append(buffers.Buffers, b...)
|
|
||||||
for _, level0 := range b {
|
|
||||||
buffers.Length += len(level0)
|
|
||||||
}
|
|
||||||
if buffers.curBuf == nil {
|
|
||||||
buffers.curBuf = buffers.Buffers[buffers.offset]
|
|
||||||
buffers.curBufLen = len(buffers.curBuf)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (buffers *Buffers) ReadBytesTo(buf []byte) (actual int) {
|
|
||||||
n := len(buf)
|
n := len(buf)
|
||||||
|
curBuf := buffers.GetCurrent()
|
||||||
|
curBufLen := len(curBuf)
|
||||||
if n > buffers.Length {
|
if n > buffers.Length {
|
||||||
if buffers.curBufLen > 0 {
|
if curBufLen > 0 {
|
||||||
actual += copy(buf, buffers.curBuf)
|
actual += copy(buf, curBuf)
|
||||||
buffers.offset++
|
buffers.offset0++
|
||||||
|
buffers.offset1 = 0
|
||||||
}
|
}
|
||||||
for _, b := range buffers.Buffers[buffers.offset:] {
|
for _, b := range buffers.Memory.Buffers[buffers.offset0:] {
|
||||||
actual += copy(buf[actual:], b)
|
actual += copy(buf[actual:], b)
|
||||||
}
|
}
|
||||||
buffers.MoveToEnd()
|
buffers.MoveToEnd()
|
||||||
@@ -78,15 +112,15 @@ func (buffers *Buffers) ReadBytesTo(buf []byte) (actual int) {
|
|||||||
}
|
}
|
||||||
l := n
|
l := n
|
||||||
for n > 0 {
|
for n > 0 {
|
||||||
if n < buffers.curBufLen {
|
if n < curBufLen {
|
||||||
actual += n
|
actual += n
|
||||||
copy(buf[l-n:], buffers.curBuf[:n])
|
copy(buf[l-n:], curBuf[:n])
|
||||||
buffers.forward(n)
|
buffers.forward(n)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
copy(buf[l-n:], buffers.curBuf)
|
copy(buf[l-n:], curBuf)
|
||||||
n -= buffers.curBufLen
|
n -= curBufLen
|
||||||
actual += buffers.curBufLen
|
actual += curBufLen
|
||||||
buffers.skipBuf()
|
buffers.skipBuf()
|
||||||
if buffers.Length == 0 && n > 0 {
|
if buffers.Length == 0 && n > 0 {
|
||||||
return
|
return
|
||||||
@@ -94,12 +128,12 @@ func (buffers *Buffers) ReadBytesTo(buf []byte) (actual int) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (buffers *Buffers) ReadByteTo(b ...*byte) (err error) {
|
func (reader *MemoryReader) ReadByteTo(b ...*byte) (err error) {
|
||||||
for i := range b {
|
for i := range b {
|
||||||
if buffers.Length == 0 {
|
if reader.Length == 0 {
|
||||||
return io.EOF
|
return io.EOF
|
||||||
}
|
}
|
||||||
*b[i], err = buffers.ReadByte()
|
*b[i], err = reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -107,31 +141,33 @@ func (buffers *Buffers) ReadByteTo(b ...*byte) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ReadByteMask(mask byte) (byte, error) {
|
func (reader *MemoryReader) ReadByteMask(mask byte) (byte, error) {
|
||||||
b, err := buffers.ReadByte()
|
b, err := reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
return b & mask, nil
|
return b & mask, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ReadByte() (byte, error) {
|
func (reader *MemoryReader) ReadByte() (b byte, err error) {
|
||||||
if buffers.Length == 0 {
|
if reader.Length == 0 {
|
||||||
return 0, io.EOF
|
return 0, io.EOF
|
||||||
}
|
}
|
||||||
if buffers.curBufLen == 1 {
|
curBuf := reader.GetCurrent()
|
||||||
defer buffers.skipBuf()
|
b = curBuf[0]
|
||||||
|
if len(curBuf) == 1 {
|
||||||
|
reader.skipBuf()
|
||||||
} else {
|
} else {
|
||||||
defer buffers.forward(1)
|
reader.forward(1)
|
||||||
}
|
}
|
||||||
return buffers.curBuf[0], nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) LEB128Unmarshal() (uint, int, error) {
|
func (reader *MemoryReader) LEB128Unmarshal() (uint, int, error) {
|
||||||
v := uint(0)
|
v := uint(0)
|
||||||
n := 0
|
n := 0
|
||||||
for i := 0; i < 8; i++ {
|
for i := 0; i < 8; i++ {
|
||||||
b, err := buffers.ReadByte()
|
b, err := reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
@@ -145,87 +181,82 @@ func (buffers *Buffers) LEB128Unmarshal() (uint, int, error) {
|
|||||||
|
|
||||||
return v, n, nil
|
return v, n, nil
|
||||||
}
|
}
|
||||||
|
func (reader *MemoryReader) getCurrentBufLen() int {
|
||||||
func (buffers *Buffers) Skip(n int) error {
|
return len(reader.Memory.Buffers[reader.offset0]) - reader.offset1
|
||||||
if n > buffers.Length {
|
}
|
||||||
|
func (reader *MemoryReader) Skip(n int) error {
|
||||||
|
if n > reader.Length {
|
||||||
return io.EOF
|
return io.EOF
|
||||||
}
|
}
|
||||||
|
curBufLen := reader.getCurrentBufLen()
|
||||||
for n > 0 {
|
for n > 0 {
|
||||||
if n < buffers.curBufLen {
|
if n < curBufLen {
|
||||||
buffers.forward(n)
|
reader.forward(n)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
n -= buffers.curBufLen
|
n -= curBufLen
|
||||||
buffers.skipBuf()
|
reader.skipBuf()
|
||||||
if buffers.Length == 0 && n > 0 {
|
if reader.Length == 0 && n > 0 {
|
||||||
return io.EOF
|
return io.EOF
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) forward(n int) {
|
func (reader *MemoryReader) forward(n int) {
|
||||||
buffers.curBuf = buffers.curBuf[n:]
|
reader.Length -= n
|
||||||
buffers.curBufLen -= n
|
reader.offset1 += n
|
||||||
buffers.Length -= n
|
|
||||||
buffers.Offset += n
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) skipBuf() {
|
func (buffers *MemoryReader) skipBuf() {
|
||||||
buffers.Offset += buffers.curBufLen
|
curBufLen := buffers.getCurrentBufLen()
|
||||||
buffers.Length -= buffers.curBufLen
|
buffers.Length -= curBufLen
|
||||||
buffers.offset++
|
buffers.offset0++
|
||||||
if buffers.Length > 0 {
|
buffers.offset1 = 0
|
||||||
buffers.curBuf = buffers.Buffers[buffers.offset]
|
|
||||||
buffers.curBufLen = len(buffers.curBuf)
|
|
||||||
} else {
|
|
||||||
buffers.curBuf = nil
|
|
||||||
buffers.curBufLen = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ReadBytes(n int) ([]byte, error) {
|
func (reader *MemoryReader) ReadBytes(n int) ([]byte, error) {
|
||||||
if n > buffers.Length {
|
if n > reader.Length {
|
||||||
return nil, io.EOF
|
return nil, io.EOF
|
||||||
}
|
}
|
||||||
b := make([]byte, n)
|
b := make([]byte, n)
|
||||||
actual := buffers.ReadBytesTo(b)
|
actual := reader.ReadBytesTo(b)
|
||||||
return b[:actual], nil
|
return b[:actual], nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) WriteTo(w io.Writer) (n int64, err error) {
|
// func (buffers *ReadableBuffers) WriteTo(w io.Writer) (n int64, err error) {
|
||||||
var buf net.Buffers
|
// var buf net.Buffers
|
||||||
if len(buffers.Buffers) > buffers.offset {
|
// if buffers.Count() > buffers.offset1 {
|
||||||
buf = append(buf, buffers.Buffers[buffers.offset:]...)
|
// buf = append(buf, buffers.Buffers[buffers.offset:]...)
|
||||||
}
|
// }
|
||||||
if buffers.curBufLen > 0 {
|
// if buffers.curBufLen > 0 {
|
||||||
buf[0] = buffers.curBuf
|
// buf[0] = buffers.curBuf
|
||||||
}
|
// }
|
||||||
buffers.MoveToEnd()
|
// buffers.MoveToEnd()
|
||||||
return buf.WriteTo(w)
|
// return buf.WriteTo(w)
|
||||||
}
|
// }
|
||||||
|
|
||||||
func (buffers *Buffers) ReadN(n int) (r net.Buffers, actual int) {
|
func (reader *MemoryReader) WriteNTo(n int, result *net.Buffers) (actual int) {
|
||||||
actual = buffers.WriteNTo(n, &r)
|
for actual = n; reader.Length > 0 && n > 0; reader.skipBuf() {
|
||||||
return
|
curBuf := reader.GetCurrent()
|
||||||
}
|
if len(curBuf) > n {
|
||||||
|
if result != nil {
|
||||||
func (buffers *Buffers) WriteNTo(n int, result *net.Buffers) (actual int) {
|
*result = append(*result, curBuf[:n])
|
||||||
for actual = n; buffers.Length > 0 && n > 0; buffers.skipBuf() {
|
}
|
||||||
if buffers.curBufLen > n {
|
reader.forward(n)
|
||||||
*result = append(*result, buffers.curBuf[:n])
|
|
||||||
buffers.forward(n)
|
|
||||||
return actual
|
return actual
|
||||||
}
|
}
|
||||||
*result = append(*result, buffers.curBuf)
|
if result != nil {
|
||||||
n -= buffers.curBufLen
|
*result = append(*result, curBuf)
|
||||||
|
}
|
||||||
|
n -= len(curBuf)
|
||||||
}
|
}
|
||||||
return actual - n
|
return actual - n
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ReadBE(n int) (num int, err error) {
|
func (reader *MemoryReader) ReadBE(n int) (num int, err error) {
|
||||||
for i := range n {
|
for i := range n {
|
||||||
b, err := buffers.ReadByte()
|
b, err := reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return -1, err
|
return -1, err
|
||||||
}
|
}
|
||||||
@@ -234,126 +265,41 @@ func (buffers *Buffers) ReadBE(n int) (num int, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) Consumes() (r net.Buffers) {
|
func (reader *MemoryReader) ClipN(n int) (r net.Buffers) {
|
||||||
for i := range buffers.offset {
|
reader.WriteNTo(n, nil)
|
||||||
r = append(r, buffers.Buffers[i])
|
return reader.ClipFront()
|
||||||
}
|
|
||||||
if buffers.curBufLen > 0 {
|
|
||||||
r = append(r, buffers.curBuf[:len(buffers.curBuf)-buffers.curBufLen])
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) ClipFront() (r net.Buffers) {
|
func (reader *MemoryReader) ClipFront() (r net.Buffers) {
|
||||||
if buffers.Offset == 0 {
|
offset := reader.Size - reader.Length
|
||||||
|
if offset == 0 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if buffers.Length == 0 {
|
buffers := &reader.Memory
|
||||||
|
if reader.Length == 0 {
|
||||||
r = buffers.Buffers
|
r = buffers.Buffers
|
||||||
buffers.Buffers = buffers.Buffers[:0]
|
buffers.Buffers = buffers.Buffers[:0]
|
||||||
buffers.curBuf = nil
|
|
||||||
buffers.curBufLen = 0
|
|
||||||
buffers.offset = 0
|
|
||||||
buffers.Offset = 0
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for i := range buffers.offset {
|
|
||||||
r = append(r, buffers.Buffers[i])
|
|
||||||
l := len(buffers.Buffers[i])
|
|
||||||
buffers.Offset -= l
|
|
||||||
}
|
|
||||||
if buffers.curBufLen > 0 {
|
|
||||||
l := len(buffers.Buffers[buffers.offset]) - buffers.curBufLen
|
|
||||||
r = append(r, buffers.Buffers[buffers.offset][:l])
|
|
||||||
buffers.Offset -= l
|
|
||||||
}
|
|
||||||
buffers.Buffers = buffers.Buffers[buffers.offset:]
|
|
||||||
buffers.Buffers[0] = buffers.curBuf
|
|
||||||
buffers.offset = 0
|
|
||||||
buffers.Offset = 0
|
|
||||||
return r
|
|
||||||
}
|
|
||||||
|
|
||||||
func (buffers *Buffers) ClipBack(n int) []byte {
|
|
||||||
lastBuf := buffers.Buffers[len(buffers.Buffers)-1]
|
|
||||||
lastBufLen := len(lastBuf)
|
|
||||||
if lastBufLen < n {
|
|
||||||
panic("ClipBack: n > lastBufLen")
|
|
||||||
}
|
|
||||||
ret := lastBuf[lastBufLen-n:]
|
|
||||||
buffers.Buffers[len(buffers.Buffers)-1] = lastBuf[:lastBufLen-n]
|
|
||||||
buffers.Length -= n
|
|
||||||
if buffers.Length > 0 {
|
|
||||||
if buffers.offset == len(buffers.Buffers)-1 {
|
|
||||||
buffers.curBuf = buffers.curBuf[:buffers.curBufLen-n]
|
|
||||||
buffers.curBufLen -= n
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
buffers.curBuf = nil
|
for i := range reader.offset0 {
|
||||||
buffers.curBufLen = 0
|
|
||||||
buffers.Length = 0
|
|
||||||
}
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
|
|
||||||
func (buffers *Buffers) CutAll() (r net.Buffers) {
|
|
||||||
r = append(r, buffers.curBuf)
|
|
||||||
for i := buffers.offset + 1; i < len(buffers.Buffers); i++ {
|
|
||||||
r = append(r, buffers.Buffers[i])
|
r = append(r, buffers.Buffers[i])
|
||||||
}
|
}
|
||||||
if len(buffers.Buffers[buffers.offset]) == buffers.curBufLen {
|
if reader.getCurrentBufLen() > 0 {
|
||||||
buffers.Buffers = buffers.Buffers[:buffers.offset]
|
r = append(r, buffers.Buffers[reader.offset0][:reader.offset1])
|
||||||
} else {
|
buffers.Buffers[reader.offset0] = reader.GetCurrent()
|
||||||
buffers.Buffers[buffers.offset] = buffers.Buffers[buffers.offset][:buffers.curBufLen]
|
|
||||||
buffers.offset++
|
|
||||||
}
|
}
|
||||||
buffers.Length = 0
|
if reader.offset0 > 0 {
|
||||||
buffers.curBuf = nil
|
buffers.Buffers = slices.Delete(buffers.Buffers, 0, reader.offset0)
|
||||||
buffers.curBufLen = 0
|
}
|
||||||
|
}
|
||||||
|
reader.Size -= offset
|
||||||
|
reader.offset0 = 0
|
||||||
|
reader.offset1 = 0
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (buffers *Buffers) Cut(n int) (r net.Buffers) {
|
func (buffers *Memory) ToBytes() []byte {
|
||||||
buffers.CutTo(n, &r)
|
ret := make([]byte, buffers.Size)
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (buffers *Buffers) CutTo(n int, result *net.Buffers) (actual int) {
|
|
||||||
for actual = n; buffers.Length > 0 && n > 0; {
|
|
||||||
if buffers.curBufLen > n {
|
|
||||||
*result = append(*result, buffers.curBuf[:n])
|
|
||||||
buffers.curBuf = buffers.curBuf[n:]
|
|
||||||
buffers.curBufLen -= n
|
|
||||||
buffers.Buffers[buffers.offset] = buffers.curBuf
|
|
||||||
buffers.Length -= n
|
|
||||||
return actual
|
|
||||||
}
|
|
||||||
*result = append(*result, buffers.curBuf)
|
|
||||||
n -= buffers.curBufLen
|
|
||||||
buffers.Length -= buffers.curBufLen
|
|
||||||
if len(buffers.Buffers[buffers.offset]) == buffers.curBufLen {
|
|
||||||
buffers.Buffers = slices.Delete(buffers.Buffers, buffers.offset, 1)
|
|
||||||
} else {
|
|
||||||
buffers.Buffers[buffers.offset] = buffers.Buffers[buffers.offset][:buffers.curBufLen]
|
|
||||||
buffers.offset++
|
|
||||||
}
|
|
||||||
if buffers.Length > 0 {
|
|
||||||
buffers.curBuf = buffers.Buffers[buffers.offset]
|
|
||||||
buffers.curBufLen = len(buffers.curBuf)
|
|
||||||
} else {
|
|
||||||
buffers.curBuf = nil
|
|
||||||
buffers.curBufLen = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return actual - n
|
|
||||||
}
|
|
||||||
|
|
||||||
func (buffers *Buffers) ToBytes() []byte {
|
|
||||||
ret := make([]byte, buffers.Length)
|
|
||||||
buffers.Read(ret)
|
buffers.Read(ret)
|
||||||
buffers.offset = 0
|
buffers.Size = 0
|
||||||
buffers.Offset = 0
|
|
||||||
buffers.Length = 0
|
|
||||||
buffers.curBuf = nil
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|||||||
0
pkg/util/fatal/latest.log
Normal file
0
pkg/util/fatal/latest.log
Normal file
278
pkg/util/mem.go
278
pkg/util/mem.go
@@ -1,33 +1,43 @@
|
|||||||
package util
|
package util
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Block [2]int
|
type Block struct {
|
||||||
|
start int
|
||||||
func (block Block) Len() int {
|
end int
|
||||||
return block[1] - block[0]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (block Block) Split() (int, int) {
|
func (block Block) Len() int {
|
||||||
return block[0], block[1]
|
return block.end - block.start
|
||||||
}
|
}
|
||||||
|
|
||||||
func (block *Block) Combine(s, e int) (ret bool) {
|
func (block *Block) Combine(s, e int) (ret bool) {
|
||||||
if ret = block[0] == e; ret {
|
if block.start == e {
|
||||||
block[0] = s
|
block.start = s
|
||||||
} else if ret = block[1] == s; ret {
|
} else if block.end == s {
|
||||||
block[1] = e
|
block.end = e
|
||||||
}
|
} else {
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (block *Block) CutFront(n int) bool {
|
||||||
|
if n > block.Len() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
block.start += n
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
type MemoryAllocator struct {
|
type MemoryAllocator struct {
|
||||||
start int64
|
start int64
|
||||||
memory []byte
|
memory []byte
|
||||||
Size int
|
|
||||||
blocks *List[Block]
|
blocks *List[Block]
|
||||||
|
Size int
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMemoryAllocator(size int) (ret *MemoryAllocator) {
|
func NewMemoryAllocator(size int) (ret *MemoryAllocator) {
|
||||||
@@ -41,188 +51,178 @@ func NewMemoryAllocator(size int) (ret *MemoryAllocator) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ma *MemoryAllocator) Malloc2(size int) (memory []byte, start, end int) {
|
func (ma *MemoryAllocator) Malloc(size int) (memory []byte) {
|
||||||
for be := ma.blocks.Front(); be != nil; be = be.Next() {
|
for be := ma.blocks.Front(); be != nil; be = be.Next() {
|
||||||
start, end = be.Value.Split()
|
if start := be.Value.start; be.Value.CutFront(size) {
|
||||||
if e := start + size; end >= e {
|
if be.Value.Len() == 0 {
|
||||||
memory = ma.memory[start:e]
|
|
||||||
if be.Value[0] = e; end == e {
|
|
||||||
ma.blocks.Remove(be)
|
ma.blocks.Remove(be)
|
||||||
}
|
}
|
||||||
end = e
|
memory = ma.memory[start:be.Value.start]
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ma *MemoryAllocator) Malloc(size int) (memory []byte) {
|
func (ma *MemoryAllocator) GetFreeSize() (ret int) {
|
||||||
memory, _, _ = ma.Malloc2(size)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ma *MemoryAllocator) Free2(start, end int) bool {
|
|
||||||
if start < 0 || end > ma.Size || start >= end {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
for e := ma.blocks.Front(); e != nil; e = e.Next() {
|
for e := ma.blocks.Front(); e != nil; e = e.Next() {
|
||||||
if e.Value.Combine(start, end) {
|
ret += e.Value.Len()
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
if end < e.Value[0] {
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ma *MemoryAllocator) free(start, end int) (ret bool) {
|
||||||
|
if start < 0 || end > ma.Size || start >= end {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ret = true
|
||||||
|
l := end - start
|
||||||
|
freeSize := ma.GetFreeSize()
|
||||||
|
defer func() {
|
||||||
|
if freeSize+l != ma.GetFreeSize() {
|
||||||
|
panic("freeSize")
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
for e := ma.blocks.Front(); e != nil; e = e.Next() {
|
||||||
|
if end < e.Value.start {
|
||||||
ma.blocks.InsertBefore(Block{start, end}, e)
|
ma.blocks.InsertBefore(Block{start, end}, e)
|
||||||
return true
|
return
|
||||||
|
}
|
||||||
|
// combine to next block
|
||||||
|
if e.Value.start == end {
|
||||||
|
e.Value.start = start
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// combine to previous block
|
||||||
|
if e.Value.end == start {
|
||||||
|
e.Value.end = end
|
||||||
|
// combine 3 blocks
|
||||||
|
if next := e.Next(); next != nil && next.Value.start == end {
|
||||||
|
e.Value.end = next.Value.end
|
||||||
|
ma.blocks.Remove(next)
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ma.blocks.PushBack(Block{start, end})
|
ma.blocks.PushBack(Block{start, end})
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ma *MemoryAllocator) Free(mem []byte) bool {
|
func (ma *MemoryAllocator) Free(mem []byte) bool {
|
||||||
ptr := uintptr(unsafe.Pointer(&mem[:1][0]))
|
ptr := uintptr(unsafe.Pointer(&mem[0]))
|
||||||
start := int(int64(ptr) - ma.start)
|
start := int(int64(ptr) - ma.start)
|
||||||
return ma.Free2(start, start+len(mem))
|
return ma.free(start, start+len(mem))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ma *MemoryAllocator) GetBlocks() (blocks []Block) {
|
func (ma *MemoryAllocator) GetBlocks() (blocks [][2]int) {
|
||||||
for e := ma.blocks.Front(); e != nil; e = e.Next() {
|
for e := ma.blocks.Front(); e != nil; e = e.Next() {
|
||||||
blocks = append(blocks, e.Value)
|
blocks = append(blocks, [2]int{e.Value.start, e.Value.end})
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScalableMemoryAllocator []*MemoryAllocator
|
var EnableCheckSize bool = true
|
||||||
|
|
||||||
|
type ScalableMemoryAllocator struct {
|
||||||
|
children []*MemoryAllocator
|
||||||
|
totalMalloc int64
|
||||||
|
totalFree int64
|
||||||
|
size int
|
||||||
|
}
|
||||||
|
|
||||||
func NewScalableMemoryAllocator(size int) (ret *ScalableMemoryAllocator) {
|
func NewScalableMemoryAllocator(size int) (ret *ScalableMemoryAllocator) {
|
||||||
return &ScalableMemoryAllocator{NewMemoryAllocator(size)}
|
return &ScalableMemoryAllocator{children: []*MemoryAllocator{NewMemoryAllocator(size)}, size: size}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) checkSize() {
|
||||||
|
var totalFree int
|
||||||
|
for _, child := range sma.children {
|
||||||
|
totalFree += child.GetFreeSize()
|
||||||
|
}
|
||||||
|
if totalFree != sma.size-(int(sma.totalMalloc)-int(sma.totalFree)) {
|
||||||
|
panic("CheckSize")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) addMallocCount(size int) {
|
||||||
|
sma.totalMalloc += int64(size)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) addFreeCount(size int) {
|
||||||
|
sma.totalFree += int64(size)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) GetTotalMalloc() int64 {
|
||||||
|
return sma.totalMalloc
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) GetTotalFree() int64 {
|
||||||
|
return sma.totalFree
|
||||||
|
}
|
||||||
|
|
||||||
|
func (sma *ScalableMemoryAllocator) GetChildren() []*MemoryAllocator {
|
||||||
|
return sma.children
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma *ScalableMemoryAllocator) Malloc(size int) (memory []byte) {
|
func (sma *ScalableMemoryAllocator) Malloc(size int) (memory []byte) {
|
||||||
if sma == nil {
|
if sma == nil {
|
||||||
return make([]byte, size)
|
return make([]byte, size)
|
||||||
}
|
}
|
||||||
memory, _, _, _ = sma.Malloc2(size)
|
if EnableCheckSize {
|
||||||
return memory
|
defer sma.checkSize()
|
||||||
|
}
|
||||||
|
defer sma.addMallocCount(size)
|
||||||
|
var child *MemoryAllocator
|
||||||
|
for _, child = range sma.children {
|
||||||
|
if memory = child.Malloc(size); memory != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
child = NewMemoryAllocator(max(child.Size*2, size))
|
||||||
|
sma.size += child.Size
|
||||||
|
memory = child.Malloc(size)
|
||||||
|
sma.children = append(sma.children, child)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma *ScalableMemoryAllocator) Malloc2(size int) (memory []byte, index, start, end int) {
|
|
||||||
for i, child := range *sma {
|
|
||||||
index = i
|
|
||||||
if memory, start, end = child.Malloc2(size); memory != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
n := NewMemoryAllocator(max((*sma)[index].Size*2, size))
|
|
||||||
index++
|
|
||||||
memory, start, end = n.Malloc2(size)
|
|
||||||
*sma = append(*sma, n)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
func (sma *ScalableMemoryAllocator) GetScalableMemoryAllocator() *ScalableMemoryAllocator {
|
func (sma *ScalableMemoryAllocator) GetScalableMemoryAllocator() *ScalableMemoryAllocator {
|
||||||
return sma
|
return sma
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma *ScalableMemoryAllocator) Free(mem []byte) bool {
|
func (sma *ScalableMemoryAllocator) Free(mem []byte) bool {
|
||||||
if sma == nil {
|
if sma == nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
ptr := uintptr(unsafe.Pointer(&mem[:1][0]))
|
if EnableCheckSize {
|
||||||
for _, child := range *sma {
|
defer sma.checkSize()
|
||||||
if start := int(int64(ptr) - child.start); child.Free2(start, start+len(mem)) {
|
}
|
||||||
|
ptr := int64(uintptr(unsafe.Pointer(&mem[0])))
|
||||||
|
size := len(mem)
|
||||||
|
for _, child := range sma.children {
|
||||||
|
if start := int(ptr - child.start); child.free(start, start+size) {
|
||||||
|
sma.addFreeCount(size)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma *ScalableMemoryAllocator) Free2(index, start, end int) bool {
|
type RecyclableMemory struct {
|
||||||
if index < 0 || index >= len(*sma) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return (*sma)[index].Free2(start, end)
|
|
||||||
}
|
|
||||||
|
|
||||||
// type RecyclableMemory struct {
|
|
||||||
// *ScalableMemoryAllocator
|
|
||||||
// mem []int
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func (r *RecyclableMemory) Malloc(size int) (memory []byte) {
|
|
||||||
// ret, i, start, end := r.Malloc2(size)
|
|
||||||
// // ml := len(r.mem)
|
|
||||||
// // if lastI, lastE := ml-3, ml-1; lastI > 0 && r.mem[lastI] == i && r.mem[lastE] == start {
|
|
||||||
// // r.mem[lastE] = end
|
|
||||||
// // } else {
|
|
||||||
// r.mem = append(r.mem, i, start, end)
|
|
||||||
// // }
|
|
||||||
// return ret
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func (r *RecyclableMemory) Pop() []int {
|
|
||||||
// l := len(r.mem)
|
|
||||||
// if l == 0 {
|
|
||||||
// return nil
|
|
||||||
// }
|
|
||||||
// ret := r.mem[l-3:]
|
|
||||||
// r.mem = r.mem[:l-3]
|
|
||||||
// return ret
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func (r *RecyclableMemory) Push(args ...int) {
|
|
||||||
// r.mem = append(r.mem, args...)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func (r *RecyclableMemory) Recycle() {
|
|
||||||
// for i := 0; i < len(r.mem); i += 3 {
|
|
||||||
// r.Free2(r.mem[i], r.mem[i+1], r.mem[i+2])
|
|
||||||
// }
|
|
||||||
// r.mem = r.mem[:0]
|
|
||||||
// }
|
|
||||||
|
|
||||||
// func (r *RecyclableMemory) RecycleBack(n int) {
|
|
||||||
// l := len(r.mem)
|
|
||||||
// end := &r.mem[l-1]
|
|
||||||
// start := *end - n
|
|
||||||
// r.Free2(r.mem[l-3], start, *end)
|
|
||||||
// *end = start
|
|
||||||
// if start == r.mem[l-2] {
|
|
||||||
// r.mem = r.mem[:l-3]
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
type RecyclableBuffers struct {
|
|
||||||
*ScalableMemoryAllocator
|
*ScalableMemoryAllocator
|
||||||
Buffers
|
Memory
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RecyclableBuffers) NextN(size int) (memory []byte) {
|
func (r *RecyclableMemory) NextN(size int) (memory []byte) {
|
||||||
memory = r.ScalableMemoryAllocator.Malloc(size)
|
memory = r.ScalableMemoryAllocator.Malloc(size)
|
||||||
r.Buffers.ReadFromBytes(memory)
|
r.Memory.ReadFromBytes(memory)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RecyclableBuffers) Recycle() {
|
func (r *RecyclableMemory) Recycle() {
|
||||||
for _, buf := range r.Buffers.Buffers {
|
for i, buf := range r.Memory.Buffers {
|
||||||
r.Free(buf)
|
ret := r.Free(buf)
|
||||||
|
if !ret {
|
||||||
|
fmt.Println(i)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RecyclableBuffers) RecycleBack(n int) {
|
|
||||||
r.Free(r.ClipBack(n))
|
|
||||||
}
|
|
||||||
|
|
||||||
func (r *RecyclableBuffers) RecycleFront() {
|
|
||||||
for _, buf := range r.Buffers.ClipFront() {
|
|
||||||
r.Free(buf)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// func (r *RecyclableBuffers) Cut(n int) (child RecyclableBuffers) {
|
|
||||||
// child.ScalableMemoryAllocator = r.ScalableMemoryAllocator
|
|
||||||
// child.ReadFromBytes(r.Buffers.Cut(n)...)
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
type IAllocator interface {
|
|
||||||
Malloc(int) []byte
|
|
||||||
Free([]byte) bool
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -105,9 +105,9 @@ func (p *HDLPlugin) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
copy(b[:4], flv[3])
|
copy(b[:4], flv[3])
|
||||||
gotFlvTag(flv[:3])
|
gotFlvTag(flv[:3])
|
||||||
rtmpData2FlvTag := func(t byte, data *rtmp.RTMPData) error {
|
rtmpData2FlvTag := func(t byte, data *rtmp.RTMPData) error {
|
||||||
WriteFLVTag(t, data.Timestamp, uint32(data.Length), b[4:])
|
WriteFLVTag(t, data.Timestamp, uint32(data.Size), b[4:])
|
||||||
defer binary.BigEndian.PutUint32(b[:4], uint32(data.Length)+11)
|
defer binary.BigEndian.PutUint32(b[:4], uint32(data.Size)+11)
|
||||||
return gotFlvTag(append(net.Buffers{b[:]}, data.Buffers.Buffers...))
|
return gotFlvTag(append(net.Buffers{b[:]}, data.Memory.Buffers...))
|
||||||
}
|
}
|
||||||
sub.Handle(m7s.SubscriberHandler{
|
sub.Handle(m7s.SubscriberHandler{
|
||||||
OnAudio: func(audio *rtmp.RTMPAudio) error {
|
OnAudio: func(audio *rtmp.RTMPAudio) error {
|
||||||
|
|||||||
@@ -51,13 +51,14 @@ func (puller *HDLPuller) Connect(p *m7s.Client) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var head util.RecyclableBuffers
|
var head util.RecyclableMemory
|
||||||
head, err = puller.BufReader.ReadBytes(13)
|
head, err = puller.BufReader.ReadBytes(13)
|
||||||
defer head.Recycle()
|
defer head.Recycle()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var flvHead [3]byte
|
var flvHead [3]byte
|
||||||
var version, flag byte
|
var version, flag byte
|
||||||
head.ReadByteTo(&flvHead[0], &flvHead[1], &flvHead[2], &version, &flag)
|
var reader = head.NewReader()
|
||||||
|
reader.ReadByteTo(&flvHead[0], &flvHead[1], &flvHead[2], &version, &flag)
|
||||||
if flvHead != [...]byte{'F', 'L', 'V'} {
|
if flvHead != [...]byte{'F', 'L', 'V'} {
|
||||||
err = errors.New("not flv file")
|
err = errors.New("not flv file")
|
||||||
} else {
|
} else {
|
||||||
@@ -101,7 +102,7 @@ func (puller *HDLPuller) Pull(p *m7s.Puller) (err error) {
|
|||||||
}
|
}
|
||||||
puller.ReadBE(3) // stream id always 0
|
puller.ReadBE(3) // stream id always 0
|
||||||
var frame rtmp.RTMPData
|
var frame rtmp.RTMPData
|
||||||
frame.RecyclableBuffers, err = puller.ReadBytes(int(dataSize))
|
frame.RecyclableMemory, err = puller.ReadBytes(int(dataSize))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
frame.Recycle()
|
frame.Recycle()
|
||||||
return err
|
return err
|
||||||
@@ -111,13 +112,9 @@ func (puller *HDLPuller) Pull(p *m7s.Puller) (err error) {
|
|||||||
// fmt.Println(t, offsetTs, timestamp, startTs, puller.absTS)
|
// fmt.Println(t, offsetTs, timestamp, startTs, puller.absTS)
|
||||||
switch t {
|
switch t {
|
||||||
case FLV_TAG_TYPE_AUDIO:
|
case FLV_TAG_TYPE_AUDIO:
|
||||||
if pubConf.PubAudio {
|
|
||||||
p.WriteAudio(frame.WrapAudio())
|
p.WriteAudio(frame.WrapAudio())
|
||||||
}
|
|
||||||
case FLV_TAG_TYPE_VIDEO:
|
case FLV_TAG_TYPE_VIDEO:
|
||||||
if pubConf.PubVideo {
|
|
||||||
p.WriteVideo(frame.WrapVideo())
|
p.WriteVideo(frame.WrapVideo())
|
||||||
}
|
|
||||||
case FLV_TAG_TYPE_SCRIPT:
|
case FLV_TAG_TYPE_SCRIPT:
|
||||||
p.Info("script")
|
p.Info("script")
|
||||||
frame.Recycle()
|
frame.Recycle()
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ type RTMPAudio struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPAudio) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
|
func (avcc *RTMPAudio) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
|
||||||
reader := avcc.Buffers
|
reader := avcc.NewReader()
|
||||||
var b, b0, b1 byte
|
var b, b0, b1 byte
|
||||||
b, err = reader.ReadByte()
|
b, err = reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -87,13 +87,13 @@ func (avcc *RTMPAudio) DecodeConfig(t *AVTrack, from ICodecCtx) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPAudio) ToRaw(codecCtx ICodecCtx) (any, error) {
|
func (avcc *RTMPAudio) ToRaw(codecCtx ICodecCtx) (any, error) {
|
||||||
reader := avcc.Buffers
|
reader := avcc.NewReader()
|
||||||
if _, ok := codecCtx.(*AACCtx); ok {
|
if _, ok := codecCtx.(*AACCtx); ok {
|
||||||
err := reader.Skip(2)
|
err := reader.Skip(2)
|
||||||
return reader.Buffers, err
|
return reader.Memory, err
|
||||||
} else {
|
} else {
|
||||||
err := reader.Skip(1)
|
err := reader.Skip(1)
|
||||||
return reader.Buffers, err
|
return reader.Memory, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ func (p *AVCDecoderConfigurationRecord) Marshal(b []byte) (n int) {
|
|||||||
|
|
||||||
var ErrDecconfInvalid = errors.New("decode error")
|
var ErrDecconfInvalid = errors.New("decode error")
|
||||||
|
|
||||||
func (ctx *H264Ctx) Unmarshal(b *util.Buffers) (err error) {
|
func (ctx *H264Ctx) Unmarshal(b *util.MemoryReader) (err error) {
|
||||||
if b.Length < 7 {
|
if b.Length < 7 {
|
||||||
err = errors.New("not enough len")
|
err = errors.New("not enough len")
|
||||||
return
|
return
|
||||||
@@ -263,8 +263,7 @@ var RTMP_AVC_HEAD = []byte{0x17, 0x00, 0x00, 0x00, 0x00, 0x01, 0x42, 0x00, 0x1E,
|
|||||||
|
|
||||||
var ErrHevc = errors.New("hevc parse config error")
|
var ErrHevc = errors.New("hevc parse config error")
|
||||||
|
|
||||||
|
func (ctx *H265Ctx) Unmarshal(b *util.MemoryReader) (err error) {
|
||||||
func (ctx *H265Ctx) Unmarshal(b *util.Buffers) (err error) {
|
|
||||||
if b.Length < 23 {
|
if b.Length < 23 {
|
||||||
err = errors.New("not enough len")
|
err = errors.New("not enough len")
|
||||||
return
|
return
|
||||||
@@ -704,7 +703,7 @@ func (p *AV1Ctx) GetInfo() string {
|
|||||||
return fmt.Sprintf("% 02X", p.ConfigOBUs)
|
return fmt.Sprintf("% 02X", p.ConfigOBUs)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *AV1Ctx) Unmarshal(data *util.Buffers) (err error) {
|
func (p *AV1Ctx) Unmarshal(data *util.MemoryReader) (err error) {
|
||||||
if data.Length < 4 {
|
if data.Length < 4 {
|
||||||
err = io.ErrShortWrite
|
err = io.ErrShortWrite
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -18,23 +18,22 @@ const (
|
|||||||
|
|
||||||
type RTMPData struct {
|
type RTMPData struct {
|
||||||
Timestamp uint32
|
Timestamp uint32
|
||||||
util.RecyclableBuffers
|
util.RecyclableMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPData) GetSize() int {
|
func (avcc *RTMPData) GetSize() int {
|
||||||
return avcc.Length
|
return avcc.Size
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPData) MarshalJSON() ([]byte, error) {
|
func (avcc *RTMPData) MarshalJSON() ([]byte, error) {
|
||||||
return []byte(fmt.Sprintf(`{"Timestamp":%d,"Size":%d,"Data":"%s"}`, avcc.Timestamp, avcc.Length, avcc.String())), nil
|
return []byte(fmt.Sprintf(`{"Timestamp":%d,"Size":%d,"Data":"%s"}`, avcc.Timestamp, avcc.Size, avcc.String())), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPData) String() string {
|
func (avcc *RTMPData) String() string {
|
||||||
reader := avcc.Buffers
|
reader := avcc.NewReader()
|
||||||
first10 := avcc.Malloc(10)
|
var bytes10 [10]byte
|
||||||
reader.ReadBytesTo(first10)
|
reader.ReadBytesTo(bytes10[:])
|
||||||
defer avcc.Free(first10)
|
return fmt.Sprintf("%d % 02X", avcc.Timestamp, bytes10[:])
|
||||||
return fmt.Sprintf("%d % 02X", avcc.Timestamp, first10)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPData) GetTimestamp() time.Duration {
|
func (avcc *RTMPData) GetTimestamp() time.Duration {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ type AVSender struct {
|
|||||||
|
|
||||||
func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
|
func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
|
||||||
// seq := frame.Sequence
|
// seq := frame.Sequence
|
||||||
payloadLen := frame.Length
|
payloadLen := frame.Size
|
||||||
if payloadLen == 0 {
|
if payloadLen == 0 {
|
||||||
err = errors.New("payload is empty")
|
err = errors.New("payload is empty")
|
||||||
// av.Error("payload is empty", zap.Error(err))
|
// av.Error("payload is empty", zap.Error(err))
|
||||||
@@ -37,10 +37,10 @@ func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
|
|||||||
// 当Chunk Type为0时(即Chunk12),
|
// 当Chunk Type为0时(即Chunk12),
|
||||||
if av.lastAbs == 0 {
|
if av.lastAbs == 0 {
|
||||||
av.SetTimestamp(frame.Timestamp)
|
av.SetTimestamp(frame.Timestamp)
|
||||||
err = av.sendChunk(frame.Buffers, &av.ChunkHeader, RTMP_CHUNK_HEAD_12)
|
err = av.sendChunk(frame.Memory.Buffers, &av.ChunkHeader, RTMP_CHUNK_HEAD_12)
|
||||||
} else {
|
} else {
|
||||||
av.SetTimestamp(frame.Timestamp - av.lastAbs)
|
av.SetTimestamp(frame.Timestamp - av.lastAbs)
|
||||||
err = av.sendChunk(frame.Buffers, &av.ChunkHeader, RTMP_CHUNK_HEAD_8)
|
err = av.sendChunk(frame.Memory.Buffers, &av.ChunkHeader, RTMP_CHUNK_HEAD_8)
|
||||||
}
|
}
|
||||||
av.lastAbs = frame.Timestamp
|
av.lastAbs = frame.Timestamp
|
||||||
// //数据被覆盖导致序号变了
|
// //数据被覆盖导致序号变了
|
||||||
@@ -75,7 +75,6 @@ func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
type RTMPReceiver struct {
|
type RTMPReceiver struct {
|
||||||
*m7s.Publisher
|
*m7s.Publisher
|
||||||
NetStream
|
NetStream
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ type NetConnection struct {
|
|||||||
AppName string
|
AppName string
|
||||||
tmpBuf util.Buffer //用来接收/发送小数据,复用内存
|
tmpBuf util.Buffer //用来接收/发送小数据,复用内存
|
||||||
chunkHeaderBuf util.Buffer
|
chunkHeaderBuf util.Buffer
|
||||||
writePool util.RecyclableBuffers
|
writePool util.RecyclableMemory
|
||||||
writing atomic.Bool // false 可写,true 不可写
|
writing atomic.Bool // false 可写,true 不可写
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +137,7 @@ func (conn *NetConnection) readChunk() (msg *Chunk, err error) {
|
|||||||
return nil, errors.New("get chunk type error :" + err.Error())
|
return nil, errors.New("get chunk type error :" + err.Error())
|
||||||
}
|
}
|
||||||
msgLen := int(chunk.MessageLength)
|
msgLen := int(chunk.MessageLength)
|
||||||
var mem util.RecyclableBuffers
|
var mem util.RecyclableMemory
|
||||||
if unRead := msgLen - chunk.bufLen; unRead < conn.readChunkSize {
|
if unRead := msgLen - chunk.bufLen; unRead < conn.readChunkSize {
|
||||||
mem, err = conn.ReadBytes(unRead)
|
mem, err = conn.ReadBytes(unRead)
|
||||||
} else {
|
} else {
|
||||||
@@ -147,15 +147,15 @@ func (conn *NetConnection) readChunk() (msg *Chunk, err error) {
|
|||||||
mem.Recycle()
|
mem.Recycle()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
conn.readSeqNum += uint32(mem.Length)
|
conn.readSeqNum += uint32(mem.Size)
|
||||||
if chunk.bufLen == 0 {
|
if chunk.bufLen == 0 {
|
||||||
chunk.AVData.RecyclableBuffers = mem
|
chunk.AVData.RecyclableMemory = mem
|
||||||
} else {
|
} else {
|
||||||
chunk.AVData.ReadFromBytes(mem.Buffers.Buffers...)
|
chunk.AVData.ReadFromBytes(mem.Buffers...)
|
||||||
}
|
}
|
||||||
|
|
||||||
chunk.bufLen += mem.Length
|
chunk.bufLen += mem.Size
|
||||||
if chunk.AVData.Length == msgLen {
|
if chunk.AVData.Size == msgLen {
|
||||||
msg = chunk
|
msg = chunk
|
||||||
switch chunk.MessageTypeID {
|
switch chunk.MessageTypeID {
|
||||||
case RTMP_MSG_AUDIO, RTMP_MSG_VIDEO:
|
case RTMP_MSG_AUDIO, RTMP_MSG_VIDEO:
|
||||||
@@ -237,7 +237,7 @@ func (conn *NetConnection) readChunkType(h *ChunkHeader, chunkType byte) (err er
|
|||||||
case 0:
|
case 0:
|
||||||
h.ExtendTimestamp = h.Timestamp
|
h.ExtendTimestamp = h.Timestamp
|
||||||
case 1, 2:
|
case 1, 2:
|
||||||
h.ExtendTimestamp += (h.Timestamp -0xffffff)
|
h.ExtendTimestamp += (h.Timestamp - 0xffffff)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch chunkType {
|
switch chunkType {
|
||||||
@@ -309,15 +309,16 @@ func (conn *NetConnection) SendMessage(t byte, msg RtmpMessage) (err error) {
|
|||||||
if sid, ok := msg.(HaveStreamID); ok {
|
if sid, ok := msg.(HaveStreamID); ok {
|
||||||
head.MessageStreamID = sid.GetStreamID()
|
head.MessageStreamID = sid.GetStreamID()
|
||||||
}
|
}
|
||||||
return conn.sendChunk(*util.NewBuffersFromBytes(conn.tmpBuf), head, RTMP_CHUNK_HEAD_12)
|
return conn.sendChunk(net.Buffers{conn.tmpBuf}, head, RTMP_CHUNK_HEAD_12)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (conn *NetConnection) sendChunk(r util.Buffers, head *ChunkHeader, headType byte) (err error) {
|
func (conn *NetConnection) sendChunk(data net.Buffers, head *ChunkHeader, headType byte) (err error) {
|
||||||
conn.chunkHeaderBuf.Reset()
|
conn.chunkHeaderBuf.Reset()
|
||||||
head.WriteTo(headType, &conn.chunkHeaderBuf)
|
head.WriteTo(headType, &conn.chunkHeaderBuf)
|
||||||
chunks := net.Buffers{conn.chunkHeaderBuf}
|
chunks := net.Buffers{conn.chunkHeaderBuf}
|
||||||
var chunk3 util.Buffer = conn.chunkHeaderBuf[conn.chunkHeaderBuf.Len():20]
|
var chunk3 util.Buffer = conn.chunkHeaderBuf[conn.chunkHeaderBuf.Len():20]
|
||||||
head.WriteTo(RTMP_CHUNK_HEAD_1, &chunk3)
|
head.WriteTo(RTMP_CHUNK_HEAD_1, &chunk3)
|
||||||
|
r := util.NewReadableBuffersFromBytes(data...)
|
||||||
for {
|
for {
|
||||||
r.WriteNTo(conn.WriteChunkSize, &chunks)
|
r.WriteNTo(conn.WriteChunkSize, &chunks)
|
||||||
if r.Length <= 0 {
|
if r.Length <= 0 {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ type RTMPVideo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPVideo) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
|
func (avcc *RTMPVideo) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
|
||||||
reader := avcc.Buffers
|
reader := avcc.NewReader()
|
||||||
var b0 byte
|
var b0 byte
|
||||||
b0, err = reader.ReadByte()
|
b0, err = reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -33,19 +33,19 @@ func (avcc *RTMPVideo) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error)
|
|||||||
switch fourCC {
|
switch fourCC {
|
||||||
case codec.FourCC_H264:
|
case codec.FourCC_H264:
|
||||||
var ctx H264Ctx
|
var ctx H264Ctx
|
||||||
if err = ctx.Unmarshal(&reader); err == nil {
|
if err = ctx.Unmarshal(reader); err == nil {
|
||||||
t.SequenceFrame = avcc
|
t.SequenceFrame = avcc
|
||||||
t.ICodecCtx = &ctx
|
t.ICodecCtx = &ctx
|
||||||
}
|
}
|
||||||
case codec.FourCC_H265:
|
case codec.FourCC_H265:
|
||||||
var ctx H265Ctx
|
var ctx H265Ctx
|
||||||
if err = ctx.Unmarshal(&reader); err == nil {
|
if err = ctx.Unmarshal(reader); err == nil {
|
||||||
t.SequenceFrame = avcc
|
t.SequenceFrame = avcc
|
||||||
t.ICodecCtx = &ctx
|
t.ICodecCtx = &ctx
|
||||||
}
|
}
|
||||||
case codec.FourCC_AV1:
|
case codec.FourCC_AV1:
|
||||||
var ctx AV1Ctx
|
var ctx AV1Ctx
|
||||||
if err = ctx.Unmarshal(&reader); err == nil {
|
if err = ctx.Unmarshal(reader); err == nil {
|
||||||
t.SequenceFrame = avcc
|
t.SequenceFrame = avcc
|
||||||
t.ICodecCtx = &ctx
|
t.ICodecCtx = &ctx
|
||||||
}
|
}
|
||||||
@@ -123,7 +123,7 @@ func (avcc *RTMPVideo) DecodeConfig(t *AVTrack, from ICodecCtx) (err error) {
|
|||||||
b.Write(h264ctx.PPS[0])
|
b.Write(h264ctx.PPS[0])
|
||||||
t.ICodecCtx = &ctx
|
t.ICodecCtx = &ctx
|
||||||
var seqFrame RTMPData
|
var seqFrame RTMPData
|
||||||
seqFrame.Buffers.ReadFromBytes(b)
|
seqFrame.Memory.ReadFromBytes(b)
|
||||||
t.SequenceFrame = seqFrame.WrapVideo()
|
t.SequenceFrame = seqFrame.WrapVideo()
|
||||||
if t.Enabled(context.TODO(), TraceLevel) {
|
if t.Enabled(context.TODO(), TraceLevel) {
|
||||||
codec := t.FourCC().String()
|
codec := t.FourCC().String()
|
||||||
@@ -136,7 +136,7 @@ func (avcc *RTMPVideo) DecodeConfig(t *AVTrack, from ICodecCtx) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPVideo) parseH264(ctx *H264Ctx, reader *util.Buffers) (any, error) {
|
func (avcc *RTMPVideo) parseH264(ctx *H264Ctx, reader *util.MemoryReader) (any, error) {
|
||||||
cts, err := reader.ReadBE(3)
|
cts, err := reader.ReadBE(3)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -150,7 +150,7 @@ func (avcc *RTMPVideo) parseH264(ctx *H264Ctx, reader *util.Buffers) (any, error
|
|||||||
return nalus, nil
|
return nalus, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPVideo) parseH265(ctx *H265Ctx, reader *util.Buffers) (any, error) {
|
func (avcc *RTMPVideo) parseH265(ctx *H265Ctx, reader *util.MemoryReader) (any, error) {
|
||||||
cts, err := reader.ReadBE(3)
|
cts, err := reader.ReadBE(3)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -164,7 +164,7 @@ func (avcc *RTMPVideo) parseH265(ctx *H265Ctx, reader *util.Buffers) (any, error
|
|||||||
return nalus, nil
|
return nalus, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPVideo) parseAV1(reader *util.Buffers) (any, error) {
|
func (avcc *RTMPVideo) parseAV1(reader *util.MemoryReader) (any, error) {
|
||||||
var obus OBUs
|
var obus OBUs
|
||||||
obus.PTS = time.Duration(avcc.Timestamp) * 90
|
obus.PTS = time.Duration(avcc.Timestamp) * 90
|
||||||
if err := obus.ParseAVCC(reader); err != nil {
|
if err := obus.ParseAVCC(reader); err != nil {
|
||||||
@@ -174,7 +174,7 @@ func (avcc *RTMPVideo) parseAV1(reader *util.Buffers) (any, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
|
func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
|
||||||
reader := avcc.Buffers
|
reader := avcc.NewReader()
|
||||||
b0, err := reader.ReadByte()
|
b0, err := reader.ReadByte()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -197,9 +197,9 @@ func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
case PacketTypeCodedFrames:
|
case PacketTypeCodedFrames:
|
||||||
if codecCtx.FourCC() == codec.FourCC_H265 {
|
if codecCtx.FourCC() == codec.FourCC_H265 {
|
||||||
return avcc.parseH265(codecCtx.(*H265Ctx), &reader)
|
return avcc.parseH265(codecCtx.(*H265Ctx), reader)
|
||||||
} else {
|
} else {
|
||||||
return avcc.parseAV1(&reader)
|
return avcc.parseAV1(reader)
|
||||||
}
|
}
|
||||||
case PacketTypeCodedFramesX:
|
case PacketTypeCodedFramesX:
|
||||||
}
|
}
|
||||||
@@ -217,9 +217,9 @@ func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
|
|||||||
// }
|
// }
|
||||||
} else {
|
} else {
|
||||||
if codecCtx.FourCC() == codec.FourCC_H265 {
|
if codecCtx.FourCC() == codec.FourCC_H265 {
|
||||||
return avcc.parseH265(codecCtx.(*H265Ctx), &reader)
|
return avcc.parseH265(codecCtx.(*H265Ctx), reader)
|
||||||
} else {
|
} else {
|
||||||
return avcc.parseH264(codecCtx.(*H264Ctx), &reader)
|
return avcc.parseH264(codecCtx.(*H264Ctx), reader)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
type RTPData struct {
|
type RTPData struct {
|
||||||
*webrtc.RTPCodecParameters
|
*webrtc.RTPCodecParameters
|
||||||
Packets []*rtp.Packet
|
Packets []*rtp.Packet
|
||||||
util.RecyclableBuffers
|
util.RecyclableMemory
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *RTPData) String() (s string) {
|
func (r *RTPData) String() (s string) {
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ func (h264 *RTPH264Ctx) CreateFrame(from *AVFrame) (frame IAVFrame, err error) {
|
|||||||
r.Packets = append(r.Packets, createPacket(h264.SPS[0]), createPacket(h264.PPS[0]))
|
r.Packets = append(r.Packets, createPacket(h264.SPS[0]), createPacket(h264.PPS[0]))
|
||||||
}
|
}
|
||||||
for _, nalu := range nalus.Nalus {
|
for _, nalu := range nalus.Nalus {
|
||||||
reader := util.NewBuffersFromBytes(nalu...)
|
reader := util.NewReadableBuffersFromBytes(nalu...)
|
||||||
if startIndex := len(r.Packets); reader.Length > 1460 {
|
if startIndex := len(r.Packets); reader.Length > 1460 {
|
||||||
//fu-a
|
//fu-a
|
||||||
for reader.Length > 0 {
|
for reader.Length > 0 {
|
||||||
@@ -136,7 +136,7 @@ func (h264 *RTPH264Ctx) CreateFrame(from *AVFrame) (frame IAVFrame, err error) {
|
|||||||
n := reader.ReadBytesTo(mem[1:])
|
n := reader.ReadBytesTo(mem[1:])
|
||||||
mem[0] = codec.NALU_FUA.Or(mem[1] & 0x60)
|
mem[0] = codec.NALU_FUA.Or(mem[1] & 0x60)
|
||||||
if n < 1459 {
|
if n < 1459 {
|
||||||
r.RecycleBack(1459 - n)
|
r.Free(mem[n+1:])
|
||||||
mem = mem[:n+1]
|
mem = mem[:n+1]
|
||||||
}
|
}
|
||||||
r.Packets = append(r.Packets, createPacket(mem))
|
r.Packets = append(r.Packets, createPacket(mem))
|
||||||
|
|||||||
@@ -179,20 +179,30 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
|
|||||||
var n int
|
var n int
|
||||||
var err error
|
var err error
|
||||||
if codecP := track.Codec(); track.Kind() == RTPCodecTypeAudio {
|
if codecP := track.Codec(); track.Kind() == RTPCodecTypeAudio {
|
||||||
|
if !publisher.PubAudio {
|
||||||
|
return
|
||||||
|
}
|
||||||
mem := util.NewScalableMemoryAllocator(1460 * 100)
|
mem := util.NewScalableMemoryAllocator(1460 * 100)
|
||||||
frame := &mrtp.RTPAudio{}
|
frame := &mrtp.RTPAudio{}
|
||||||
frame.RTPCodecParameters = &codecP
|
frame.RTPCodecParameters = &codecP
|
||||||
frame.ScalableMemoryAllocator = mem
|
frame.ScalableMemoryAllocator = mem
|
||||||
for {
|
for {
|
||||||
var packet rtp.Packet
|
var packet rtp.Packet
|
||||||
buf := frame.NextN(1460)
|
buf := frame.Malloc(1460)
|
||||||
if n, _, err = track.Read(buf); err == nil {
|
if n, _, err = track.Read(buf); err == nil {
|
||||||
err = packet.Unmarshal(buf[:n])
|
err = packet.Unmarshal(buf[:n])
|
||||||
frame.RecycleBack(1460 - n)
|
frame.ReadFromBytes(buf[:n])
|
||||||
|
if n < 1460 {
|
||||||
|
frame.Free(buf[n:])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if len(packet.Payload) == 0 {
|
||||||
|
frame.Free(frame.Pop())
|
||||||
|
continue
|
||||||
|
}
|
||||||
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {
|
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {
|
||||||
frame.Packets = append(frame.Packets, &packet)
|
frame.Packets = append(frame.Packets, &packet)
|
||||||
} else {
|
} else {
|
||||||
@@ -206,6 +216,9 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if !publisher.PubVideo {
|
||||||
|
return
|
||||||
|
}
|
||||||
var lastPLISent time.Time
|
var lastPLISent time.Time
|
||||||
mem := util.NewScalableMemoryAllocator(1460 * 100)
|
mem := util.NewScalableMemoryAllocator(1460 * 100)
|
||||||
frame := &mrtp.RTPVideo{}
|
frame := &mrtp.RTPVideo{}
|
||||||
@@ -220,18 +233,19 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
|
|||||||
lastPLISent = time.Now()
|
lastPLISent = time.Now()
|
||||||
}
|
}
|
||||||
var packet rtp.Packet
|
var packet rtp.Packet
|
||||||
buf := frame.NextN(1460)
|
buf := frame.Malloc(1460)
|
||||||
if n, _, err = track.Read(buf); err == nil {
|
if n, _, err = track.Read(buf); err == nil {
|
||||||
err = packet.Unmarshal(buf[:n])
|
err = packet.Unmarshal(buf[:n])
|
||||||
|
frame.ReadFromBytes(buf[:n])
|
||||||
if n < 1460 {
|
if n < 1460 {
|
||||||
frame.RecycleBack(1460 - n)
|
frame.Free(buf[n:])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(packet.Payload) == 0 {
|
if len(packet.Payload) == 0 {
|
||||||
frame.RecycleBack(n)
|
frame.Free(frame.Pop())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {
|
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ func (p *Publisher) writeAV(t *AVTrack, data IAVFrame) {
|
|||||||
|
|
||||||
func (p *Publisher) WriteVideo(data IAVFrame) (err error) {
|
func (p *Publisher) WriteVideo(data IAVFrame) (err error) {
|
||||||
if !p.PubVideo || p.IsStopped() {
|
if !p.PubVideo || p.IsStopped() {
|
||||||
|
data.Recycle()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t := p.VideoTrack.AVTrack
|
t := p.VideoTrack.AVTrack
|
||||||
@@ -276,6 +277,7 @@ func (p *Publisher) WriteVideo(data IAVFrame) (err error) {
|
|||||||
|
|
||||||
func (p *Publisher) WriteAudio(data IAVFrame) (err error) {
|
func (p *Publisher) WriteAudio(data IAVFrame) (err error) {
|
||||||
if !p.PubAudio || p.IsStopped() {
|
if !p.PubAudio || p.IsStopped() {
|
||||||
|
data.Recycle()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
t := p.AudioTrack.AVTrack
|
t := p.AudioTrack.AVTrack
|
||||||
|
|||||||
Reference in New Issue
Block a user