fix: memory

This commit is contained in:
langhuihui
2024-05-29 14:29:52 +08:00
parent 55446e3f57
commit 6902ac8b3d
26 changed files with 921 additions and 772 deletions

11
api.go
View File

@@ -129,6 +129,7 @@ func (s *Server) getStreamInfo(pub *Publisher) (res *pb.StreamInfoResponse, err
}
return
}
func (s *Server) StreamInfo(ctx context.Context, req *pb.StreamSnapRequest) (res *pb.StreamInfoResponse, err error) {
s.Call(func() {
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{}
if !pub.VideoTrack.IsEmpty() {
// 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)
for sub := range pub.Subscribers {
if sub.VideoReader == nil {

View File

@@ -15,6 +15,7 @@ webrtc:
rtmp:
chunksize: 2048
publish:
pubaudio: false
# idletimeout: 10s
# closedelaytimeout: 4s
subscribe:

View File

@@ -2,39 +2,37 @@ package main
import (
"context"
"errors"
"flag"
"m7s.live/m7s/v5"
"m7s.live/m7s/v5/pkg/util"
_ "m7s.live/m7s/v5/plugin/console"
_ "m7s.live/m7s/v5/plugin/debug"
_ "m7s.live/m7s/v5/plugin/hdl"
_ "m7s.live/m7s/v5/plugin/logrotate"
_ "m7s.live/m7s/v5/plugin/rtmp"
_ "m7s.live/m7s/v5/plugin/webrtc"
"strings"
)
func init() {
//全局推流鉴权
m7s.DefaultServer.OnAuthPubs["RTMP"] = func(p *util.Promise[*m7s.Publisher]) {
var pub = p.Value
if strings.Contains(pub.StreamPath, "20A222800207-2") {
p.Fulfill(nil)
} else {
p.Fulfill(errors.New("auth failed"))
}
}
//全局播放鉴权
m7s.DefaultServer.OnAuthSubs["RTMP"] = func(p *util.Promise[*m7s.Subscriber]) {
var sub = p.Value
if strings.Contains(sub.StreamPath, "20A222800207-22") {
p.Fulfill(nil)
} else {
p.Fulfill(errors.New("auth failed"))
}
}
}
// func init() {
// //全局推流鉴权
// m7s.DefaultServer.OnAuthPubs["RTMP"] = func(p *util.Promise[*m7s.Publisher]) {
// var pub = p.Value
// if strings.Contains(pub.StreamPath, "20A222800207-2") {
// p.Fulfill(nil)
// } else {
// p.Fulfill(errors.New("auth failed"))
// }
// }
// //全局播放鉴权
// m7s.DefaultServer.OnAuthSubs["RTMP"] = func(p *util.Promise[*m7s.Subscriber]) {
// var sub = p.Value
// if strings.Contains(sub.StreamPath, "20A222800207-22") {
// p.Fulfill(nil)
// } else {
// p.Fulfill(errors.New("auth failed"))
// }
// }
// }
func main() {
conf := flag.String("c", "config.yaml", "config file")

View File

@@ -1207,6 +1207,116 @@ func (x *TrackSnapShot) GetWrap() []*Wrap {
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 {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1224,7 +1334,7 @@ type AudioTrackInfo struct {
func (x *AudioTrackInfo) Reset() {
*x = AudioTrackInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[17]
mi := &file_global_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1237,7 +1347,7 @@ func (x *AudioTrackInfo) String() string {
func (*AudioTrackInfo) ProtoMessage() {}
func (x *AudioTrackInfo) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[17]
mi := &file_global_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1250,7 +1360,7 @@ func (x *AudioTrackInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use AudioTrackInfo.ProtoReflect.Descriptor instead.
func (*AudioTrackInfo) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{17}
return file_global_proto_rawDescGZIP(), []int{19}
}
func (x *AudioTrackInfo) GetCodec() string {
@@ -1309,12 +1419,13 @@ type TrackSnapShotResponse struct {
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"`
Memory []*MemoryBlockGroup `protobuf:"bytes,3,rep,name=memory,proto3" json:"memory,omitempty"`
}
func (x *TrackSnapShotResponse) Reset() {
*x = TrackSnapShotResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[18]
mi := &file_global_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1327,7 +1438,7 @@ func (x *TrackSnapShotResponse) String() string {
func (*TrackSnapShotResponse) ProtoMessage() {}
func (x *TrackSnapShotResponse) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[18]
mi := &file_global_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1340,7 +1451,7 @@ func (x *TrackSnapShotResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use TrackSnapShotResponse.ProtoReflect.Descriptor instead.
func (*TrackSnapShotResponse) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{18}
return file_global_proto_rawDescGZIP(), []int{20}
}
func (x *TrackSnapShotResponse) GetRing() []*TrackSnapShot {
@@ -1357,6 +1468,13 @@ func (x *TrackSnapShotResponse) GetReader() map[uint32]uint32 {
return nil
}
func (x *TrackSnapShotResponse) GetMemory() []*MemoryBlockGroup {
if x != nil {
return x.Memory
}
return nil
}
type VideoTrackInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -1375,7 +1493,7 @@ type VideoTrackInfo struct {
func (x *VideoTrackInfo) Reset() {
*x = VideoTrackInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[19]
mi := &file_global_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1388,7 +1506,7 @@ func (x *VideoTrackInfo) String() string {
func (*VideoTrackInfo) ProtoMessage() {}
func (x *VideoTrackInfo) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[19]
mi := &file_global_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1401,7 +1519,7 @@ func (x *VideoTrackInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use VideoTrackInfo.ProtoReflect.Descriptor instead.
func (*VideoTrackInfo) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{19}
return file_global_proto_rawDescGZIP(), []int{21}
}
func (x *VideoTrackInfo) GetCodec() string {
@@ -1471,7 +1589,7 @@ type SuccessResponse struct {
func (x *SuccessResponse) Reset() {
*x = SuccessResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[20]
mi := &file_global_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1484,7 +1602,7 @@ func (x *SuccessResponse) String() string {
func (*SuccessResponse) ProtoMessage() {}
func (x *SuccessResponse) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[20]
mi := &file_global_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1497,7 +1615,7 @@ func (x *SuccessResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SuccessResponse.ProtoReflect.Descriptor instead.
func (*SuccessResponse) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{20}
return file_global_proto_rawDescGZIP(), []int{22}
}
func (x *SuccessResponse) GetSuccess() bool {
@@ -1518,7 +1636,7 @@ type RequestWithId struct {
func (x *RequestWithId) Reset() {
*x = RequestWithId{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[21]
mi := &file_global_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1531,7 +1649,7 @@ func (x *RequestWithId) String() string {
func (*RequestWithId) ProtoMessage() {}
func (x *RequestWithId) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[21]
mi := &file_global_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1544,7 +1662,7 @@ func (x *RequestWithId) ProtoReflect() protoreflect.Message {
// Deprecated: Use RequestWithId.ProtoReflect.Descriptor instead.
func (*RequestWithId) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{21}
return file_global_proto_rawDescGZIP(), []int{23}
}
func (x *RequestWithId) GetId() uint32 {
@@ -1567,7 +1685,7 @@ type SubscribersRequest struct {
func (x *SubscribersRequest) Reset() {
*x = SubscribersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[22]
mi := &file_global_proto_msgTypes[24]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1580,7 +1698,7 @@ func (x *SubscribersRequest) String() string {
func (*SubscribersRequest) ProtoMessage() {}
func (x *SubscribersRequest) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[22]
mi := &file_global_proto_msgTypes[24]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1593,7 +1711,7 @@ func (x *SubscribersRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SubscribersRequest.ProtoReflect.Descriptor instead.
func (*SubscribersRequest) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{22}
return file_global_proto_rawDescGZIP(), []int{24}
}
func (x *SubscribersRequest) GetStreamPath() string {
@@ -1631,7 +1749,7 @@ type RingReaderSnapShot struct {
func (x *RingReaderSnapShot) Reset() {
*x = RingReaderSnapShot{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[23]
mi := &file_global_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1644,7 +1762,7 @@ func (x *RingReaderSnapShot) String() string {
func (*RingReaderSnapShot) ProtoMessage() {}
func (x *RingReaderSnapShot) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[23]
mi := &file_global_proto_msgTypes[25]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1657,7 +1775,7 @@ func (x *RingReaderSnapShot) ProtoReflect() protoreflect.Message {
// Deprecated: Use RingReaderSnapShot.ProtoReflect.Descriptor instead.
func (*RingReaderSnapShot) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{23}
return file_global_proto_rawDescGZIP(), []int{25}
}
func (x *RingReaderSnapShot) GetSequence() uint32 {
@@ -1703,7 +1821,7 @@ type SubscriberSnapShot struct {
func (x *SubscriberSnapShot) Reset() {
*x = SubscriberSnapShot{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[24]
mi := &file_global_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1716,7 +1834,7 @@ func (x *SubscriberSnapShot) String() string {
func (*SubscriberSnapShot) ProtoMessage() {}
func (x *SubscriberSnapShot) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[24]
mi := &file_global_proto_msgTypes[26]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1729,7 +1847,7 @@ func (x *SubscriberSnapShot) ProtoReflect() protoreflect.Message {
// Deprecated: Use SubscriberSnapShot.ProtoReflect.Descriptor instead.
func (*SubscriberSnapShot) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{24}
return file_global_proto_rawDescGZIP(), []int{26}
}
func (x *SubscriberSnapShot) GetId() uint32 {
@@ -1781,7 +1899,7 @@ type SubscribersResponse struct {
func (x *SubscribersResponse) Reset() {
*x = SubscribersResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_global_proto_msgTypes[25]
mi := &file_global_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1794,7 +1912,7 @@ func (x *SubscribersResponse) String() string {
func (*SubscribersResponse) ProtoMessage() {}
func (x *SubscribersResponse) ProtoReflect() protoreflect.Message {
mi := &file_global_proto_msgTypes[25]
mi := &file_global_proto_msgTypes[27]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1807,7 +1925,7 @@ func (x *SubscribersResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SubscribersResponse.ProtoReflect.Descriptor instead.
func (*SubscribersResponse) Descriptor() ([]byte, []int) {
return file_global_proto_rawDescGZIP(), []int{25}
return file_global_proto_rawDescGZIP(), []int{27}
}
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, 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,
0x52, 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0xb0, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f,
0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12,
0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66,
0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x1e, 0x0a,
0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a,
0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x22, 0xba, 0x01, 0x0a, 0x15, 0x54, 0x72,
0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61,
0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x04, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x72,
0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x37,
0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x1a, 0x39, 0x0a, 0x0b, 0x52,
0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb4, 0x01, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f,
0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64,
0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12,
0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66,
0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x14, 0x0a,
0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69,
0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67,
0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x67, 0x6f, 0x70, 0x22, 0x2b, 0x0a,
0x0f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x12, 0x53,
0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74,
0x68, 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, 0x22, 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,
0x52, 0x04, 0x77, 0x72, 0x61, 0x70, 0x22, 0x29, 0x0a, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79,
0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x0c, 0x0a, 0x01, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x01, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x01,
0x65, 0x22, 0x4c, 0x0a, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x04, 0x6c, 0x69, 0x73,
0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x65,
0x6d, 0x6f, 0x72, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22,
0xb0, 0x01, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74,
0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12,
0x0a, 0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65,
0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x03, 0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
0x0d, 0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65,
0x52, 0x61, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x61, 0x6d, 0x70,
0x6c, 0x65, 0x52, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
0x6c, 0x73, 0x22, 0xe9, 0x01, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04,
0x72, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x37, 0x73,
0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x04,
0x72, 0x69, 0x6e, 0x67, 0x12, 0x3e, 0x0a, 0x06, 0x72, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x02,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b,
0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x2e, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65,
0x61, 0x64, 0x65, 0x72, 0x12, 0x2d, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x18, 0x03,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x72,
0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x06, 0x6d, 0x65, 0x6d,
0x6f, 0x72, 0x79, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xb4,
0x01, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66,
0x6f, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x63, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x74, 0x61, 0x12, 0x12, 0x0a,
0x04, 0x6d, 0x65, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x74,
0x61, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03,
0x62, 0x70, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x70, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x03, 0x66, 0x70, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x18, 0x06,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x77, 0x69, 0x64, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68,
0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69,
0x67, 0x68, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x67, 0x6f, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d,
0x52, 0x03, 0x67, 0x6f, 0x70, 0x22, 0x2b, 0x0a, 0x0f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65,
0x73, 0x73, 0x22, 0x1f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52,
0x02, 0x69, 0x64, 0x22, 0x6a, 0x0a, 0x12, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65,
0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72,
0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73,
0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 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, 0x22,
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,
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, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e,
0x6d, 0x37, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x73, 0x79, 0x73, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x75, 0x6d,
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,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x79, 0x73, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x14, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x79, 0x73, 0x69, 0x6e, 0x66,
0x6f, 0x12, 0x4d, 0x0a, 0x07, 0x53, 0x75, 0x6d, 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, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72,
0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x57, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61,
0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 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, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 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, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x67, 0x6f,
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,
0x69, 0x2f, 0x72, 0x65, 0x73, 0x74, 0x61, 0x72, 0x74, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x57,
0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x16, 0x2e, 0x6d,
0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71,
0x70, 0x74, 0x79, 0x1a, 0x1b, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d,
0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73,
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,
0x6d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 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,
0x69, 0x73, 0x74, 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, 0x1b, 0x2e, 0x6d, 0x37,
0x73, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x57, 0x61, 0x69, 0x74, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16,
0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 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, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2f,
0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12,
0x6d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72,
0x73, 0x12, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62,
0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6d, 0x37, 0x73,
0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b,
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72,
0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
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, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54,
0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61,
0x70, 0x69, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e,
0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a,
0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b,
0x53, 0x6e, 0x61, 0x70, 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, 0x1a, 0x2e, 0x6d,
0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26,
0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x74, 0x72, 0x61, 0x63,
0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61,
0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x5e, 0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75,
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12, 0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74, 0x68, 0x49, 0x64, 0x1a, 0x14, 0x2e, 0x6d, 0x37,
0x73, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x73, 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b,
0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73,
0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69,
0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x67, 0x65, 0x74, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
0x65, 0x7d, 0x12, 0x5f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79,
0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65,
0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
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,
0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x2f, 0x69, 0x6e, 0x66, 0x6f, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50,
0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x6d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x53, 0x75,
0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x12, 0x17, 0x2e, 0x6d, 0x37, 0x73, 0x2e,
0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69,
0x62, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x75, 0x62, 0x73, 0x63,
0x72, 0x69, 0x62, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61,
0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x41, 0x75, 0x64, 0x69, 0x6f, 0x54,
0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 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, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70,
0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x75, 0x64, 0x69, 0x6f,
0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b, 0x73, 0x74, 0x72, 0x65,
0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0e, 0x56, 0x69,
0x64, 0x65, 0x6f, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x6e, 0x61, 0x70, 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, 0x1a, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b,
0x53, 0x6e, 0x61, 0x70, 0x53, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x69, 0x64, 0x65, 0x6f, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6e, 0x61, 0x70, 0x2f, 0x7b,
0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x50, 0x61, 0x74, 0x68, 0x3d, 0x2a, 0x2a, 0x7d, 0x12, 0x5e,
0x0a, 0x0d, 0x53, 0x74, 0x6f, 0x70, 0x53, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x12,
0x12, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x57, 0x69, 0x74,
0x68, 0x49, 0x64, 0x1a, 0x14, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x1d, 0x22, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x74, 0x6f, 0x70, 0x2f, 0x73, 0x75, 0x62,
0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x3a, 0x01, 0x2a, 0x12, 0x5a,
0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x15, 0x2e, 0x6d, 0x37,
0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1e, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f,
0x67, 0x65, 0x74, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x5f, 0x0a, 0x0a, 0x47, 0x65,
0x74, 0x46, 0x6f, 0x72, 0x6d, 0x69, 0x6c, 0x79, 0x12, 0x15, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47,
0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x16, 0x2e, 0x6d, 0x37, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 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 (
@@ -2194,7 +2323,7 @@ func file_global_proto_rawDescGZIP() []byte {
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{}{
(*GetConfigRequest)(nil), // 0: m7s.GetConfigRequest
(*Formily)(nil), // 1: m7s.Formily
@@ -2213,82 +2342,86 @@ var file_global_proto_goTypes = []interface{}{
(*StreamInfoResponse)(nil), // 14: m7s.StreamInfoResponse
(*Wrap)(nil), // 15: m7s.Wrap
(*TrackSnapShot)(nil), // 16: m7s.TrackSnapShot
(*AudioTrackInfo)(nil), // 17: m7s.AudioTrackInfo
(*TrackSnapShotResponse)(nil), // 18: m7s.TrackSnapShotResponse
(*VideoTrackInfo)(nil), // 19: m7s.VideoTrackInfo
(*SuccessResponse)(nil), // 20: m7s.SuccessResponse
(*RequestWithId)(nil), // 21: m7s.RequestWithId
(*SubscribersRequest)(nil), // 22: m7s.SubscribersRequest
(*RingReaderSnapShot)(nil), // 23: m7s.RingReaderSnapShot
(*SubscriberSnapShot)(nil), // 24: m7s.SubscriberSnapShot
(*SubscribersResponse)(nil), // 25: m7s.SubscribersResponse
nil, // 26: m7s.Formily.PropertiesEntry
nil, // 27: m7s.Formily.ComponentPropsEntry
nil, // 28: m7s.FormilyResponse.PropertiesEntry
nil, // 29: m7s.StreamWaitListResponse.ListEntry
nil, // 30: m7s.TrackSnapShotResponse.ReaderEntry
(*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp
(*anypb.Any)(nil), // 32: google.protobuf.Any
(*emptypb.Empty)(nil), // 33: google.protobuf.Empty
(*MemoryBlock)(nil), // 17: m7s.MemoryBlock
(*MemoryBlockGroup)(nil), // 18: m7s.MemoryBlockGroup
(*AudioTrackInfo)(nil), // 19: m7s.AudioTrackInfo
(*TrackSnapShotResponse)(nil), // 20: m7s.TrackSnapShotResponse
(*VideoTrackInfo)(nil), // 21: m7s.VideoTrackInfo
(*SuccessResponse)(nil), // 22: m7s.SuccessResponse
(*RequestWithId)(nil), // 23: m7s.RequestWithId
(*SubscribersRequest)(nil), // 24: m7s.SubscribersRequest
(*RingReaderSnapShot)(nil), // 25: m7s.RingReaderSnapShot
(*SubscriberSnapShot)(nil), // 26: m7s.SubscriberSnapShot
(*SubscribersResponse)(nil), // 27: m7s.SubscribersResponse
nil, // 28: m7s.Formily.PropertiesEntry
nil, // 29: m7s.Formily.ComponentPropsEntry
nil, // 30: m7s.FormilyResponse.PropertiesEntry
nil, // 31: m7s.StreamWaitListResponse.ListEntry
nil, // 32: m7s.TrackSnapShotResponse.ReaderEntry
(*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{
26, // 0: m7s.Formily.properties:type_name -> m7s.Formily.PropertiesEntry
27, // 1: m7s.Formily.componentProps:type_name -> m7s.Formily.ComponentPropsEntry
28, // 2: m7s.FormilyResponse.properties:type_name -> m7s.FormilyResponse.PropertiesEntry
28, // 0: m7s.Formily.properties:type_name -> m7s.Formily.PropertiesEntry
29, // 1: m7s.Formily.componentProps:type_name -> m7s.Formily.ComponentPropsEntry
30, // 2: m7s.FormilyResponse.properties:type_name -> m7s.FormilyResponse.PropertiesEntry
6, // 3: m7s.SummaryResponse.memory:type_name -> m7s.Usage
6, // 4: m7s.SummaryResponse.hardDisk:type_name -> m7s.Usage
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
14, // 8: m7s.StreamListResponse.list:type_name -> m7s.StreamInfoResponse
29, // 9: m7s.StreamWaitListResponse.list:type_name -> m7s.StreamWaitListResponse.ListEntry
17, // 10: m7s.StreamInfoResponse.audioTrack:type_name -> m7s.AudioTrackInfo
19, // 11: m7s.StreamInfoResponse.videoTrack:type_name -> m7s.VideoTrackInfo
31, // 12: m7s.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp
31, // 13: m7s.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp
31, // 9: m7s.StreamWaitListResponse.list:type_name -> m7s.StreamWaitListResponse.ListEntry
19, // 10: m7s.StreamInfoResponse.audioTrack:type_name -> m7s.AudioTrackInfo
21, // 11: m7s.StreamInfoResponse.videoTrack:type_name -> m7s.VideoTrackInfo
33, // 12: m7s.StreamInfoResponse.startTime:type_name -> google.protobuf.Timestamp
33, // 13: m7s.TrackSnapShot.writeTime:type_name -> google.protobuf.Timestamp
15, // 14: m7s.TrackSnapShot.wrap:type_name -> m7s.Wrap
16, // 15: m7s.TrackSnapShotResponse.ring:type_name -> m7s.TrackSnapShot
30, // 16: m7s.TrackSnapShotResponse.reader:type_name -> m7s.TrackSnapShotResponse.ReaderEntry
31, // 17: m7s.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp
23, // 18: m7s.SubscriberSnapShot.audioReader:type_name -> m7s.RingReaderSnapShot
23, // 19: m7s.SubscriberSnapShot.videoReader:type_name -> m7s.RingReaderSnapShot
24, // 20: m7s.SubscribersResponse.list:type_name -> m7s.SubscriberSnapShot
1, // 21: m7s.Formily.PropertiesEntry.value:type_name -> m7s.Formily
32, // 22: m7s.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any
1, // 23: m7s.FormilyResponse.PropertiesEntry.value:type_name -> m7s.Formily
33, // 24: m7s.Global.SysInfo:input_type -> google.protobuf.Empty
33, // 25: m7s.Global.Summary:input_type -> google.protobuf.Empty
21, // 26: m7s.Global.Shutdown:input_type -> m7s.RequestWithId
21, // 27: m7s.Global.Restart:input_type -> m7s.RequestWithId
10, // 28: m7s.Global.StreamList:input_type -> m7s.StreamListRequest
33, // 29: m7s.Global.WaitList:input_type -> google.protobuf.Empty
13, // 30: m7s.Global.StreamInfo:input_type -> m7s.StreamSnapRequest
22, // 31: m7s.Global.GetSubscribers:input_type -> m7s.SubscribersRequest
13, // 32: m7s.Global.AudioTrackSnap:input_type -> m7s.StreamSnapRequest
13, // 33: m7s.Global.VideoTrackSnap:input_type -> m7s.StreamSnapRequest
21, // 34: m7s.Global.StopSubscribe:input_type -> m7s.RequestWithId
0, // 35: m7s.Global.GetConfig:input_type -> m7s.GetConfigRequest
0, // 36: m7s.Global.GetFormily:input_type -> m7s.GetConfigRequest
4, // 37: m7s.Global.ModifyConfig:input_type -> m7s.ModifyConfigRequest
9, // 38: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse
7, // 39: m7s.Global.Summary:output_type -> m7s.SummaryResponse
33, // 40: m7s.Global.Shutdown:output_type -> google.protobuf.Empty
33, // 41: m7s.Global.Restart:output_type -> google.protobuf.Empty
11, // 42: m7s.Global.StreamList:output_type -> m7s.StreamListResponse
12, // 43: m7s.Global.WaitList:output_type -> m7s.StreamWaitListResponse
14, // 44: m7s.Global.StreamInfo:output_type -> m7s.StreamInfoResponse
25, // 45: m7s.Global.GetSubscribers:output_type -> m7s.SubscribersResponse
18, // 46: m7s.Global.AudioTrackSnap:output_type -> m7s.TrackSnapShotResponse
18, // 47: m7s.Global.VideoTrackSnap:output_type -> m7s.TrackSnapShotResponse
20, // 48: m7s.Global.StopSubscribe:output_type -> m7s.SuccessResponse
3, // 49: m7s.Global.GetConfig:output_type -> m7s.GetConfigResponse
3, // 50: m7s.Global.GetFormily:output_type -> m7s.GetConfigResponse
20, // 51: m7s.Global.ModifyConfig:output_type -> m7s.SuccessResponse
38, // [38:52] is the sub-list for method output_type
24, // [24:38] is the sub-list for method input_type
24, // [24:24] is the sub-list for extension type_name
24, // [24:24] is the sub-list for extension extendee
0, // [0:24] is the sub-list for field type_name
17, // 15: m7s.MemoryBlockGroup.list:type_name -> m7s.MemoryBlock
16, // 16: m7s.TrackSnapShotResponse.ring:type_name -> m7s.TrackSnapShot
32, // 17: m7s.TrackSnapShotResponse.reader:type_name -> m7s.TrackSnapShotResponse.ReaderEntry
18, // 18: m7s.TrackSnapShotResponse.memory:type_name -> m7s.MemoryBlockGroup
33, // 19: m7s.SubscriberSnapShot.startTime:type_name -> google.protobuf.Timestamp
25, // 20: m7s.SubscriberSnapShot.audioReader:type_name -> m7s.RingReaderSnapShot
25, // 21: m7s.SubscriberSnapShot.videoReader:type_name -> m7s.RingReaderSnapShot
26, // 22: m7s.SubscribersResponse.list:type_name -> m7s.SubscriberSnapShot
1, // 23: m7s.Formily.PropertiesEntry.value:type_name -> m7s.Formily
34, // 24: m7s.Formily.ComponentPropsEntry.value:type_name -> google.protobuf.Any
1, // 25: m7s.FormilyResponse.PropertiesEntry.value:type_name -> m7s.Formily
35, // 26: m7s.Global.SysInfo:input_type -> google.protobuf.Empty
35, // 27: m7s.Global.Summary:input_type -> google.protobuf.Empty
23, // 28: m7s.Global.Shutdown:input_type -> m7s.RequestWithId
23, // 29: m7s.Global.Restart:input_type -> m7s.RequestWithId
10, // 30: m7s.Global.StreamList:input_type -> m7s.StreamListRequest
35, // 31: m7s.Global.WaitList:input_type -> google.protobuf.Empty
13, // 32: m7s.Global.StreamInfo:input_type -> m7s.StreamSnapRequest
24, // 33: m7s.Global.GetSubscribers:input_type -> m7s.SubscribersRequest
13, // 34: m7s.Global.AudioTrackSnap:input_type -> m7s.StreamSnapRequest
13, // 35: m7s.Global.VideoTrackSnap:input_type -> m7s.StreamSnapRequest
23, // 36: m7s.Global.StopSubscribe:input_type -> m7s.RequestWithId
0, // 37: m7s.Global.GetConfig:input_type -> m7s.GetConfigRequest
0, // 38: m7s.Global.GetFormily:input_type -> m7s.GetConfigRequest
4, // 39: m7s.Global.ModifyConfig:input_type -> m7s.ModifyConfigRequest
9, // 40: m7s.Global.SysInfo:output_type -> m7s.SysInfoResponse
7, // 41: m7s.Global.Summary:output_type -> m7s.SummaryResponse
35, // 42: m7s.Global.Shutdown:output_type -> google.protobuf.Empty
35, // 43: m7s.Global.Restart:output_type -> google.protobuf.Empty
11, // 44: m7s.Global.StreamList:output_type -> m7s.StreamListResponse
12, // 45: m7s.Global.WaitList:output_type -> m7s.StreamWaitListResponse
14, // 46: m7s.Global.StreamInfo:output_type -> m7s.StreamInfoResponse
27, // 47: m7s.Global.GetSubscribers:output_type -> m7s.SubscribersResponse
20, // 48: m7s.Global.AudioTrackSnap:output_type -> m7s.TrackSnapShotResponse
20, // 49: m7s.Global.VideoTrackSnap:output_type -> m7s.TrackSnapShotResponse
22, // 50: m7s.Global.StopSubscribe:output_type -> m7s.SuccessResponse
3, // 51: m7s.Global.GetConfig:output_type -> m7s.GetConfigResponse
3, // 52: m7s.Global.GetFormily:output_type -> m7s.GetConfigResponse
22, // 53: m7s.Global.ModifyConfig:output_type -> m7s.SuccessResponse
40, // [40:54] is the sub-list for method output_type
26, // [26:40] is the sub-list for method input_type
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() }
@@ -2502,7 +2635,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AudioTrackInfo); i {
switch v := v.(*MemoryBlock); i {
case 0:
return &v.state
case 1:
@@ -2514,7 +2647,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TrackSnapShotResponse); i {
switch v := v.(*MemoryBlockGroup); i {
case 0:
return &v.state
case 1:
@@ -2526,7 +2659,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VideoTrackInfo); i {
switch v := v.(*AudioTrackInfo); i {
case 0:
return &v.state
case 1:
@@ -2538,7 +2671,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SuccessResponse); i {
switch v := v.(*TrackSnapShotResponse); i {
case 0:
return &v.state
case 1:
@@ -2550,7 +2683,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RequestWithId); i {
switch v := v.(*VideoTrackInfo); i {
case 0:
return &v.state
case 1:
@@ -2562,7 +2695,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubscribersRequest); i {
switch v := v.(*SuccessResponse); i {
case 0:
return &v.state
case 1:
@@ -2574,7 +2707,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RingReaderSnapShot); i {
switch v := v.(*RequestWithId); i {
case 0:
return &v.state
case 1:
@@ -2586,7 +2719,7 @@ func file_global_proto_init() {
}
}
file_global_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SubscriberSnapShot); i {
switch v := v.(*SubscribersRequest); i {
case 0:
return &v.state
case 1:
@@ -2598,6 +2731,30 @@ func file_global_proto_init() {
}
}
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 {
case 0:
return &v.state
@@ -2616,7 +2773,7 @@ func file_global_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_global_proto_rawDesc,
NumEnums: 0,
NumMessages: 31,
NumMessages: 33,
NumExtensions: 0,
NumServices: 1,
},

View File

@@ -197,6 +197,16 @@ message TrackSnapShot {
repeated Wrap wrap = 5;
}
message MemoryBlock {
uint32 s = 1;
uint32 e = 2;
}
message MemoryBlockGroup {
uint32 size = 1;
repeated MemoryBlock list = 2;
}
message AudioTrackInfo {
string codec = 1;
string delta = 2;
@@ -210,6 +220,7 @@ message AudioTrackInfo {
message TrackSnapShotResponse {
repeated TrackSnapShot ring = 1;
map<uint32, uint32> reader = 2;
repeated MemoryBlockGroup memory = 3;
}
message VideoTrackInfo {

View File

@@ -11,7 +11,7 @@ import (
type AnnexB struct {
PTS time.Duration
DTS time.Duration
util.RecyclableBuffers
util.RecyclableMemory
}
// DecodeConfig implements pkg.IAVFrame.
@@ -27,7 +27,7 @@ func (a *AnnexB) DecodeConfig(t *AVTrack, ctx ICodecCtx) error {
// GetSize implements pkg.IAVFrame.
func (a *AnnexB) GetSize() int {
return a.Length
return a.Size
}
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.
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.

View File

@@ -62,7 +62,9 @@ type (
Raw any `json:"-" yaml:"-"` // 裸格式
}
)
var _ IAVFrame = (*AnnexB)(nil)
func (frame *AVFrame) Reset() {
frame.Timestamp = 0
for _, wrap := range frame.Wraps {
@@ -98,7 +100,7 @@ func (nalus *Nalus) Append(bytes ...[]byte) {
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 {
l, err := reader.ReadBE(naluSizeLen)
if err != nil {
@@ -122,20 +124,20 @@ func (obus *OBUs) Append(bytes ...[]byte) {
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
startLen := reader.Length
for reader.Length > 0 {
offset := reader.Offset
offset := reader.Size - reader.Length
b, _ := reader.ReadByte()
obuHeader.Unmarshal([]byte{b})
// if log.Trace {
// vt.Trace("obu", zap.Any("type", obuHeader.Type), zap.Bool("iframe", vt.Value.IFrame))
// }
obuSize, _, _ := reader.LEB128Unmarshal()
end := reader.Offset
end := reader.Size - reader.Length
size := end - offset + int(obuSize)
reader = &util.Buffers{Buffers: reader.Buffers}
reader.Skip(offset)
reader = &util.MemoryReader{Memory: reader.Memory, Length: startLen - offset}
obu, err := reader.ReadBytes(size)
if err != nil {
return err

View File

@@ -17,7 +17,6 @@ type RingWriter struct {
*util.Ring[AVFrame]
IDRingList //最近的关键帧位置,首屏渲染
ReaderCount atomic.Int32
Allocator *util.ScalableMemoryAllocator
pool *util.Ring[AVFrame]
poolSize int
Size int
@@ -60,7 +59,7 @@ func (rb *RingWriter) Glow(size int) (newItem *util.Ring[AVFrame]) {
return
}
func (rb *RingWriter) Recycle(r *util.Ring[AVFrame]) {
func (rb *RingWriter) recycle(r *util.Ring[AVFrame]) {
rb.poolSize++
r.Value.Reset()
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]) {
r = rb.Unlink(size)
if size > 1 {
for p := r.Next(); p != r; {
next := p.Next() //先保存下一个节点
if p.Value.discard {
p.Prev().Unlink(1)
if p.Value.TryLock() {
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
}
}
// if r.Value.Discard() == 0 {
// rb.Recycle(r)
// }
rb.Size -= size
return
}

View File

@@ -37,6 +37,7 @@ type (
Track
*RingWriter
ICodecCtx
Allocator *util.ScalableMemoryAllocator
SequenceFrame IAVFrame
WrapIndex int
}

View File

@@ -8,14 +8,15 @@ const defaultBufSize = 65536
type BufReader struct {
reader io.Reader
buf RecyclableBuffers
allocator *ScalableMemoryAllocator
buf MemoryReader
BufLen int
}
func NewBufReaderWithBufLen(reader io.Reader, bufLen int) (r *BufReader) {
r = &BufReader{}
r.reader = reader
r.buf.ScalableMemoryAllocator = NewScalableMemoryAllocator(bufLen)
r.allocator = NewScalableMemoryAllocator(bufLen)
r.BufLen = bufLen
return
}
@@ -23,33 +24,33 @@ func NewBufReaderWithBufLen(reader io.Reader, bufLen int) (r *BufReader) {
func NewBufReader(reader io.Reader) (r *BufReader) {
r = &BufReader{}
r.reader = reader
r.buf.ScalableMemoryAllocator = NewScalableMemoryAllocator(defaultBufSize)
r.allocator = NewScalableMemoryAllocator(defaultBufSize)
r.BufLen = defaultBufSize
return
}
func (r *BufReader) GetAllocator() *ScalableMemoryAllocator {
return r.buf.ScalableMemoryAllocator
}
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 {
r.allocator.Free(buf)
return err
} 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
}
func (r *BufReader) ReadByte() (byte, error) {
for r.buf.Length == 0 {
err := r.eat()
if err != nil {
return 0, err
func (r *BufReader) ReadByte() (b byte, err error) {
for ; r.buf.Length == 0 && err == nil; err = r.eat() {
}
if err == nil {
b, err = r.buf.ReadByte()
}
return r.buf.ReadByte()
return
}
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
}
func (r *BufReader) ReadBytes(n int) (mem RecyclableBuffers, err error) {
mem.ScalableMemoryAllocator = r.buf.ScalableMemoryAllocator
for r.buf.RecycleFront(); n > 0 && err == nil; err = r.eat() {
func (r *BufReader) ReadBytes(n int) (mem RecyclableMemory, err error) {
mem.ScalableMemoryAllocator = r.allocator
for r.recycleFront(); n > 0 && err == nil; err = r.eat() {
if r.buf.Length > 0 {
if r.buf.Length >= n {
mem.ReadFromBytes(r.buf.Buffers.Cut(n)...)
mem.ReadFromBytes(r.buf.ClipN(n)...)
return
}
n -= r.buf.Length
mem.ReadFromBytes(r.buf.CutAll()...)
mem.ReadFromBytes(r.buf.Memory.Buffers...)
r.buf = MemoryReader{}
}
}
return
}
func (r *BufReader) recycleFront() {
for _, buf := range r.buf.ClipFront() {
r.allocator.Free(buf)
}
}

View File

@@ -4,15 +4,30 @@ import (
"bufio"
"bytes"
"encoding/binary"
"io"
"math/rand"
"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) {
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}
testReader := bytes.NewReader(testData)
reader := NewBufReader(testReader)
limitReader := &limitReader{reader: testReader, limit: 2}
reader := NewBufReader(limitReader)
reader.BufLen = 5
b, err := reader.ReadByte()
if err != nil {
@@ -32,10 +47,6 @@ func TestBufRead(t *testing.T) {
t.Error("read be error")
return
}
if reader.buf.Length != 0 {
t.Error("reader.buf.Length != 0")
return
}
b, err = reader.ReadByte()
if err != nil {
t.Error(err)
@@ -50,16 +61,14 @@ func TestBufRead(t *testing.T) {
t.Error(err)
return
}
if len(mem.Buffers.Buffers) != 2 {
t.Error("len(mem.Buffers.Buffers) != 2")
reader2 := mem.NewReader()
b, err = reader2.ReadByte()
if err != nil {
t.Error(err)
return
}
if mem.Buffers.Buffers[0][0] != 7 {
t.Error("mem.Buffers.Buffers[0][0] != 7")
return
}
if mem.Buffers.Buffers[1][0] != 11 {
t.Error("mem.Buffers.Buffers[1][0] != 10")
if b != 7 {
t.Error("byte read error")
return
}
b, err = reader.ReadByte()
@@ -105,7 +114,7 @@ func BenchmarkBufRead(b *testing.B) {
b.RunParallel(func(pb *testing.PB) {
var testData = make([]byte, 10*1024*1024)
var err error
var mem RecyclableBuffers
var mem RecyclableMemory
for pb.Next() {
rand.Read(testData)
testReader := bytes.NewReader(testData)

View File

@@ -6,71 +6,105 @@ import (
"slices"
)
type Buffers struct {
Offset int
offset int
Length int
curBuf []byte
curBufLen int
type Memory struct {
Size int
net.Buffers
}
func NewBuffersFromBytes(b ...[]byte) *Buffers {
return NewBuffers(net.Buffers(b))
type MemoryReader struct {
Memory
Length int
offset0 int
offset1 int
}
func NewBuffers(buffers net.Buffers) *Buffers {
ret := &Buffers{Buffers: buffers}
func NewMemoryFromBytes(b ...[]byte) *Memory {
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 {
ret.Length += len(level0)
ret.Size += len(level0)
}
ret.curBuf = buffers[0]
ret.curBufLen = len(buffers[0])
return ret
}
func (buffers *Buffers) Pop() []byte {
if buffers.Length == 0 {
func (buffers *Memory) ReadFromBytes(b ...[]byte) {
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
}
l := len(buffers.Buffers) - 1
last := buffers.Buffers[l]
buffers.Buffers = buffers.Buffers[:l]
buffers.Length -= len(last)
if buffers.offset == l {
buffers.curBuf = nil
buffers.curBufLen = 0
}
buffers.Size -= len(last)
return last
}
func (buffers *Buffers) MoveToEnd() {
buffers.curBuf = nil
buffers.curBufLen = 0
buffers.offset = len(buffers.Buffers)
buffers.Offset = buffers.Length
// func (buffers *Buffers) WriteTo(w io.Writer) (n int64, err error) {
// var buf net.Buffers
// for _, buffer := range buffers.Buffers {
// buf = append(buf, buffer)
// }
// 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
}
func (buffers *Buffers) ReadFromBytes(b ...[]byte) {
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) {
func (buffers *MemoryReader) ReadBytesTo(buf []byte) (actual int) {
n := len(buf)
curBuf := buffers.GetCurrent()
curBufLen := len(curBuf)
if n > buffers.Length {
if buffers.curBufLen > 0 {
actual += copy(buf, buffers.curBuf)
buffers.offset++
if curBufLen > 0 {
actual += copy(buf, curBuf)
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)
}
buffers.MoveToEnd()
@@ -78,15 +112,15 @@ func (buffers *Buffers) ReadBytesTo(buf []byte) (actual int) {
}
l := n
for n > 0 {
if n < buffers.curBufLen {
if n < curBufLen {
actual += n
copy(buf[l-n:], buffers.curBuf[:n])
copy(buf[l-n:], curBuf[:n])
buffers.forward(n)
break
}
copy(buf[l-n:], buffers.curBuf)
n -= buffers.curBufLen
actual += buffers.curBufLen
copy(buf[l-n:], curBuf)
n -= curBufLen
actual += curBufLen
buffers.skipBuf()
if buffers.Length == 0 && n > 0 {
return
@@ -94,12 +128,12 @@ func (buffers *Buffers) ReadBytesTo(buf []byte) (actual int) {
}
return
}
func (buffers *Buffers) ReadByteTo(b ...*byte) (err error) {
func (reader *MemoryReader) ReadByteTo(b ...*byte) (err error) {
for i := range b {
if buffers.Length == 0 {
if reader.Length == 0 {
return io.EOF
}
*b[i], err = buffers.ReadByte()
*b[i], err = reader.ReadByte()
if err != nil {
return
}
@@ -107,31 +141,33 @@ func (buffers *Buffers) ReadByteTo(b ...*byte) (err error) {
return
}
func (buffers *Buffers) ReadByteMask(mask byte) (byte, error) {
b, err := buffers.ReadByte()
func (reader *MemoryReader) ReadByteMask(mask byte) (byte, error) {
b, err := reader.ReadByte()
if err != nil {
return 0, err
}
return b & mask, nil
}
func (buffers *Buffers) ReadByte() (byte, error) {
if buffers.Length == 0 {
func (reader *MemoryReader) ReadByte() (b byte, err error) {
if reader.Length == 0 {
return 0, io.EOF
}
if buffers.curBufLen == 1 {
defer buffers.skipBuf()
curBuf := reader.GetCurrent()
b = curBuf[0]
if len(curBuf) == 1 {
reader.skipBuf()
} 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)
n := 0
for i := 0; i < 8; i++ {
b, err := buffers.ReadByte()
b, err := reader.ReadByte()
if err != nil {
return 0, 0, err
}
@@ -145,87 +181,82 @@ func (buffers *Buffers) LEB128Unmarshal() (uint, int, error) {
return v, n, nil
}
func (buffers *Buffers) Skip(n int) error {
if n > buffers.Length {
func (reader *MemoryReader) getCurrentBufLen() int {
return len(reader.Memory.Buffers[reader.offset0]) - reader.offset1
}
func (reader *MemoryReader) Skip(n int) error {
if n > reader.Length {
return io.EOF
}
curBufLen := reader.getCurrentBufLen()
for n > 0 {
if n < buffers.curBufLen {
buffers.forward(n)
if n < curBufLen {
reader.forward(n)
break
}
n -= buffers.curBufLen
buffers.skipBuf()
if buffers.Length == 0 && n > 0 {
n -= curBufLen
reader.skipBuf()
if reader.Length == 0 && n > 0 {
return io.EOF
}
}
return nil
}
func (buffers *Buffers) forward(n int) {
buffers.curBuf = buffers.curBuf[n:]
buffers.curBufLen -= n
buffers.Length -= n
buffers.Offset += n
func (reader *MemoryReader) forward(n int) {
reader.Length -= n
reader.offset1 += n
}
func (buffers *Buffers) skipBuf() {
buffers.Offset += buffers.curBufLen
buffers.Length -= 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
}
func (buffers *MemoryReader) skipBuf() {
curBufLen := buffers.getCurrentBufLen()
buffers.Length -= curBufLen
buffers.offset0++
buffers.offset1 = 0
}
func (buffers *Buffers) ReadBytes(n int) ([]byte, error) {
if n > buffers.Length {
func (reader *MemoryReader) ReadBytes(n int) ([]byte, error) {
if n > reader.Length {
return nil, io.EOF
}
b := make([]byte, n)
actual := buffers.ReadBytesTo(b)
actual := reader.ReadBytesTo(b)
return b[:actual], nil
}
func (buffers *Buffers) WriteTo(w io.Writer) (n int64, err error) {
var buf net.Buffers
if len(buffers.Buffers) > buffers.offset {
buf = append(buf, buffers.Buffers[buffers.offset:]...)
}
if buffers.curBufLen > 0 {
buf[0] = buffers.curBuf
}
buffers.MoveToEnd()
return buf.WriteTo(w)
}
// func (buffers *ReadableBuffers) WriteTo(w io.Writer) (n int64, err error) {
// var buf net.Buffers
// if buffers.Count() > buffers.offset1 {
// buf = append(buf, buffers.Buffers[buffers.offset:]...)
// }
// if buffers.curBufLen > 0 {
// buf[0] = buffers.curBuf
// }
// buffers.MoveToEnd()
// return buf.WriteTo(w)
// }
func (buffers *Buffers) ReadN(n int) (r net.Buffers, actual int) {
actual = buffers.WriteNTo(n, &r)
return
}
func (buffers *Buffers) WriteNTo(n int, result *net.Buffers) (actual int) {
for actual = n; buffers.Length > 0 && n > 0; buffers.skipBuf() {
if buffers.curBufLen > n {
*result = append(*result, buffers.curBuf[:n])
buffers.forward(n)
func (reader *MemoryReader) WriteNTo(n int, result *net.Buffers) (actual int) {
for actual = n; reader.Length > 0 && n > 0; reader.skipBuf() {
curBuf := reader.GetCurrent()
if len(curBuf) > n {
if result != nil {
*result = append(*result, curBuf[:n])
}
reader.forward(n)
return actual
}
*result = append(*result, buffers.curBuf)
n -= buffers.curBufLen
if result != nil {
*result = append(*result, curBuf)
}
n -= len(curBuf)
}
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 {
b, err := buffers.ReadByte()
b, err := reader.ReadByte()
if err != nil {
return -1, err
}
@@ -234,126 +265,41 @@ func (buffers *Buffers) ReadBE(n int) (num int, err error) {
return
}
func (buffers *Buffers) Consumes() (r net.Buffers) {
for i := range buffers.offset {
r = append(r, buffers.Buffers[i])
}
if buffers.curBufLen > 0 {
r = append(r, buffers.curBuf[:len(buffers.curBuf)-buffers.curBufLen])
}
return
func (reader *MemoryReader) ClipN(n int) (r net.Buffers) {
reader.WriteNTo(n, nil)
return reader.ClipFront()
}
func (buffers *Buffers) ClipFront() (r net.Buffers) {
if buffers.Offset == 0 {
func (reader *MemoryReader) ClipFront() (r net.Buffers) {
offset := reader.Size - reader.Length
if offset == 0 {
return
}
if buffers.Length == 0 {
buffers := &reader.Memory
if reader.Length == 0 {
r = buffers.Buffers
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 {
buffers.curBuf = nil
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++ {
for i := range reader.offset0 {
r = append(r, buffers.Buffers[i])
}
if len(buffers.Buffers[buffers.offset]) == buffers.curBufLen {
buffers.Buffers = buffers.Buffers[:buffers.offset]
} else {
buffers.Buffers[buffers.offset] = buffers.Buffers[buffers.offset][:buffers.curBufLen]
buffers.offset++
if reader.getCurrentBufLen() > 0 {
r = append(r, buffers.Buffers[reader.offset0][:reader.offset1])
buffers.Buffers[reader.offset0] = reader.GetCurrent()
}
buffers.Length = 0
buffers.curBuf = nil
buffers.curBufLen = 0
if reader.offset0 > 0 {
buffers.Buffers = slices.Delete(buffers.Buffers, 0, reader.offset0)
}
}
reader.Size -= offset
reader.offset0 = 0
reader.offset1 = 0
return
}
func (buffers *Buffers) Cut(n int) (r net.Buffers) {
buffers.CutTo(n, &r)
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)
func (buffers *Memory) ToBytes() []byte {
ret := make([]byte, buffers.Size)
buffers.Read(ret)
buffers.offset = 0
buffers.Offset = 0
buffers.Length = 0
buffers.curBuf = nil
buffers.Size = 0
return ret
}

View File

View File

@@ -1,33 +1,43 @@
package util
import (
"fmt"
"unsafe"
)
type Block [2]int
func (block Block) Len() int {
return block[1] - block[0]
type Block struct {
start int
end int
}
func (block Block) Split() (int, int) {
return block[0], block[1]
func (block Block) Len() int {
return block.end - block.start
}
func (block *Block) Combine(s, e int) (ret bool) {
if ret = block[0] == e; ret {
block[0] = s
} else if ret = block[1] == s; ret {
block[1] = e
}
if block.start == e {
block.start = s
} else if block.end == s {
block.end = e
} else {
return
}
return true
}
func (block *Block) CutFront(n int) bool {
if n > block.Len() {
return false
}
block.start += n
return true
}
type MemoryAllocator struct {
start int64
memory []byte
Size int
blocks *List[Block]
Size int
}
func NewMemoryAllocator(size int) (ret *MemoryAllocator) {
@@ -41,188 +51,178 @@ func NewMemoryAllocator(size int) (ret *MemoryAllocator) {
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() {
start, end = be.Value.Split()
if e := start + size; end >= e {
memory = ma.memory[start:e]
if be.Value[0] = e; end == e {
if start := be.Value.start; be.Value.CutFront(size) {
if be.Value.Len() == 0 {
ma.blocks.Remove(be)
}
end = e
memory = ma.memory[start:be.Value.start]
return
}
}
return
}
func (ma *MemoryAllocator) Malloc(size int) (memory []byte) {
memory, _, _ = ma.Malloc2(size)
return
}
func (ma *MemoryAllocator) Free2(start, end int) bool {
if start < 0 || end > ma.Size || start >= end {
return false
}
func (ma *MemoryAllocator) GetFreeSize() (ret int) {
for e := ma.blocks.Front(); e != nil; e = e.Next() {
if e.Value.Combine(start, end) {
return true
ret += e.Value.Len()
}
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)
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})
return true
return
}
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)
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() {
blocks = append(blocks, e.Value)
blocks = append(blocks, [2]int{e.Value.start, e.Value.end})
}
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) {
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) {
if sma == nil {
return make([]byte, size)
}
memory, _, _, _ = sma.Malloc2(size)
return memory
if EnableCheckSize {
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 {
return sma
}
func (sma *ScalableMemoryAllocator) Free(mem []byte) bool {
if sma == nil {
return false
}
ptr := uintptr(unsafe.Pointer(&mem[:1][0]))
for _, child := range *sma {
if start := int(int64(ptr) - child.start); child.Free2(start, start+len(mem)) {
if EnableCheckSize {
defer sma.checkSize()
}
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 false
}
func (sma *ScalableMemoryAllocator) Free2(index, start, end int) bool {
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 {
type RecyclableMemory struct {
*ScalableMemoryAllocator
Buffers
Memory
}
func (r *RecyclableBuffers) NextN(size int) (memory []byte) {
func (r *RecyclableMemory) NextN(size int) (memory []byte) {
memory = r.ScalableMemoryAllocator.Malloc(size)
r.Buffers.ReadFromBytes(memory)
r.Memory.ReadFromBytes(memory)
return
}
func (r *RecyclableBuffers) Recycle() {
for _, buf := range r.Buffers.Buffers {
r.Free(buf)
func (r *RecyclableMemory) Recycle() {
for i, buf := range r.Memory.Buffers {
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
}

View File

@@ -105,9 +105,9 @@ func (p *HDLPlugin) ServeHTTP(w http.ResponseWriter, r *http.Request) {
copy(b[:4], flv[3])
gotFlvTag(flv[:3])
rtmpData2FlvTag := func(t byte, data *rtmp.RTMPData) error {
WriteFLVTag(t, data.Timestamp, uint32(data.Length), b[4:])
defer binary.BigEndian.PutUint32(b[:4], uint32(data.Length)+11)
return gotFlvTag(append(net.Buffers{b[:]}, data.Buffers.Buffers...))
WriteFLVTag(t, data.Timestamp, uint32(data.Size), b[4:])
defer binary.BigEndian.PutUint32(b[:4], uint32(data.Size)+11)
return gotFlvTag(append(net.Buffers{b[:]}, data.Memory.Buffers...))
}
sub.Handle(m7s.SubscriberHandler{
OnAudio: func(audio *rtmp.RTMPAudio) error {

View File

@@ -51,13 +51,14 @@ func (puller *HDLPuller) Connect(p *m7s.Client) (err error) {
}
}
if err == nil {
var head util.RecyclableBuffers
var head util.RecyclableMemory
head, err = puller.BufReader.ReadBytes(13)
defer head.Recycle()
if err == nil {
var flvHead [3]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'} {
err = errors.New("not flv file")
} else {
@@ -101,7 +102,7 @@ func (puller *HDLPuller) Pull(p *m7s.Puller) (err error) {
}
puller.ReadBE(3) // stream id always 0
var frame rtmp.RTMPData
frame.RecyclableBuffers, err = puller.ReadBytes(int(dataSize))
frame.RecyclableMemory, err = puller.ReadBytes(int(dataSize))
if err != nil {
frame.Recycle()
return err
@@ -111,13 +112,9 @@ func (puller *HDLPuller) Pull(p *m7s.Puller) (err error) {
// fmt.Println(t, offsetTs, timestamp, startTs, puller.absTS)
switch t {
case FLV_TAG_TYPE_AUDIO:
if pubConf.PubAudio {
p.WriteAudio(frame.WrapAudio())
}
case FLV_TAG_TYPE_VIDEO:
if pubConf.PubVideo {
p.WriteVideo(frame.WrapVideo())
}
case FLV_TAG_TYPE_SCRIPT:
p.Info("script")
frame.Recycle()

View File

@@ -10,7 +10,7 @@ type RTMPAudio struct {
}
func (avcc *RTMPAudio) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
reader := avcc.Buffers
reader := avcc.NewReader()
var b, b0, b1 byte
b, err = reader.ReadByte()
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) {
reader := avcc.Buffers
reader := avcc.NewReader()
if _, ok := codecCtx.(*AACCtx); ok {
err := reader.Skip(2)
return reader.Buffers, err
return reader.Memory, err
} else {
err := reader.Skip(1)
return reader.Buffers, err
return reader.Memory, err
}
}

View File

@@ -199,7 +199,7 @@ func (p *AVCDecoderConfigurationRecord) Marshal(b []byte) (n int) {
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 {
err = errors.New("not enough len")
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")
func (ctx *H265Ctx) Unmarshal(b *util.Buffers) (err error) {
func (ctx *H265Ctx) Unmarshal(b *util.MemoryReader) (err error) {
if b.Length < 23 {
err = errors.New("not enough len")
return
@@ -704,7 +703,7 @@ func (p *AV1Ctx) GetInfo() string {
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 {
err = io.ErrShortWrite
return

View File

@@ -18,23 +18,22 @@ const (
type RTMPData struct {
Timestamp uint32
util.RecyclableBuffers
util.RecyclableMemory
}
func (avcc *RTMPData) GetSize() int {
return avcc.Length
return avcc.Size
}
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 {
reader := avcc.Buffers
first10 := avcc.Malloc(10)
reader.ReadBytesTo(first10)
defer avcc.Free(first10)
return fmt.Sprintf("%d % 02X", avcc.Timestamp, first10)
reader := avcc.NewReader()
var bytes10 [10]byte
reader.ReadBytesTo(bytes10[:])
return fmt.Sprintf("%d % 02X", avcc.Timestamp, bytes10[:])
}
func (avcc *RTMPData) GetTimestamp() time.Duration {

View File

@@ -15,7 +15,7 @@ type AVSender struct {
func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
// seq := frame.Sequence
payloadLen := frame.Length
payloadLen := frame.Size
if payloadLen == 0 {
err = errors.New("payload is empty")
// av.Error("payload is empty", zap.Error(err))
@@ -37,10 +37,10 @@ func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
// 当Chunk Type为0时(即Chunk12),
if av.lastAbs == 0 {
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 {
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
// //数据被覆盖导致序号变了
@@ -75,7 +75,6 @@ func (av *AVSender) SendFrame(frame *RTMPData) (err error) {
// }
// }
type RTMPReceiver struct {
*m7s.Publisher
NetStream

View File

@@ -58,7 +58,7 @@ type NetConnection struct {
AppName string
tmpBuf util.Buffer //用来接收/发送小数据,复用内存
chunkHeaderBuf util.Buffer
writePool util.RecyclableBuffers
writePool util.RecyclableMemory
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())
}
msgLen := int(chunk.MessageLength)
var mem util.RecyclableBuffers
var mem util.RecyclableMemory
if unRead := msgLen - chunk.bufLen; unRead < conn.readChunkSize {
mem, err = conn.ReadBytes(unRead)
} else {
@@ -147,15 +147,15 @@ func (conn *NetConnection) readChunk() (msg *Chunk, err error) {
mem.Recycle()
return nil, err
}
conn.readSeqNum += uint32(mem.Length)
conn.readSeqNum += uint32(mem.Size)
if chunk.bufLen == 0 {
chunk.AVData.RecyclableBuffers = mem
chunk.AVData.RecyclableMemory = mem
} else {
chunk.AVData.ReadFromBytes(mem.Buffers.Buffers...)
chunk.AVData.ReadFromBytes(mem.Buffers...)
}
chunk.bufLen += mem.Length
if chunk.AVData.Length == msgLen {
chunk.bufLen += mem.Size
if chunk.AVData.Size == msgLen {
msg = chunk
switch chunk.MessageTypeID {
case RTMP_MSG_AUDIO, RTMP_MSG_VIDEO:
@@ -237,7 +237,7 @@ func (conn *NetConnection) readChunkType(h *ChunkHeader, chunkType byte) (err er
case 0:
h.ExtendTimestamp = h.Timestamp
case 1, 2:
h.ExtendTimestamp += (h.Timestamp -0xffffff)
h.ExtendTimestamp += (h.Timestamp - 0xffffff)
}
} else {
switch chunkType {
@@ -309,15 +309,16 @@ func (conn *NetConnection) SendMessage(t byte, msg RtmpMessage) (err error) {
if sid, ok := msg.(HaveStreamID); ok {
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()
head.WriteTo(headType, &conn.chunkHeaderBuf)
chunks := net.Buffers{conn.chunkHeaderBuf}
var chunk3 util.Buffer = conn.chunkHeaderBuf[conn.chunkHeaderBuf.Len():20]
head.WriteTo(RTMP_CHUNK_HEAD_1, &chunk3)
r := util.NewReadableBuffersFromBytes(data...)
for {
r.WriteNTo(conn.WriteChunkSize, &chunks)
if r.Length <= 0 {

View File

@@ -17,7 +17,7 @@ type RTMPVideo struct {
}
func (avcc *RTMPVideo) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error) {
reader := avcc.Buffers
reader := avcc.NewReader()
var b0 byte
b0, err = reader.ReadByte()
if err != nil {
@@ -33,19 +33,19 @@ func (avcc *RTMPVideo) Parse(t *AVTrack) (isIDR, isSeq bool, raw any, err error)
switch fourCC {
case codec.FourCC_H264:
var ctx H264Ctx
if err = ctx.Unmarshal(&reader); err == nil {
if err = ctx.Unmarshal(reader); err == nil {
t.SequenceFrame = avcc
t.ICodecCtx = &ctx
}
case codec.FourCC_H265:
var ctx H265Ctx
if err = ctx.Unmarshal(&reader); err == nil {
if err = ctx.Unmarshal(reader); err == nil {
t.SequenceFrame = avcc
t.ICodecCtx = &ctx
}
case codec.FourCC_AV1:
var ctx AV1Ctx
if err = ctx.Unmarshal(&reader); err == nil {
if err = ctx.Unmarshal(reader); err == nil {
t.SequenceFrame = avcc
t.ICodecCtx = &ctx
}
@@ -123,7 +123,7 @@ func (avcc *RTMPVideo) DecodeConfig(t *AVTrack, from ICodecCtx) (err error) {
b.Write(h264ctx.PPS[0])
t.ICodecCtx = &ctx
var seqFrame RTMPData
seqFrame.Buffers.ReadFromBytes(b)
seqFrame.Memory.ReadFromBytes(b)
t.SequenceFrame = seqFrame.WrapVideo()
if t.Enabled(context.TODO(), TraceLevel) {
codec := t.FourCC().String()
@@ -136,7 +136,7 @@ func (avcc *RTMPVideo) DecodeConfig(t *AVTrack, from ICodecCtx) (err error) {
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)
if err != nil {
return nil, err
@@ -150,7 +150,7 @@ func (avcc *RTMPVideo) parseH264(ctx *H264Ctx, reader *util.Buffers) (any, error
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)
if err != nil {
return nil, err
@@ -164,7 +164,7 @@ func (avcc *RTMPVideo) parseH265(ctx *H265Ctx, reader *util.Buffers) (any, error
return nalus, nil
}
func (avcc *RTMPVideo) parseAV1(reader *util.Buffers) (any, error) {
func (avcc *RTMPVideo) parseAV1(reader *util.MemoryReader) (any, error) {
var obus OBUs
obus.PTS = time.Duration(avcc.Timestamp) * 90
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) {
reader := avcc.Buffers
reader := avcc.NewReader()
b0, err := reader.ReadByte()
if err != nil {
return nil, err
@@ -197,9 +197,9 @@ func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
return nil, nil
case PacketTypeCodedFrames:
if codecCtx.FourCC() == codec.FourCC_H265 {
return avcc.parseH265(codecCtx.(*H265Ctx), &reader)
return avcc.parseH265(codecCtx.(*H265Ctx), reader)
} else {
return avcc.parseAV1(&reader)
return avcc.parseAV1(reader)
}
case PacketTypeCodedFramesX:
}
@@ -217,9 +217,9 @@ func (avcc *RTMPVideo) ToRaw(codecCtx ICodecCtx) (any, error) {
// }
} else {
if codecCtx.FourCC() == codec.FourCC_H265 {
return avcc.parseH265(codecCtx.(*H265Ctx), &reader)
return avcc.parseH265(codecCtx.(*H265Ctx), reader)
} else {
return avcc.parseH264(codecCtx.(*H264Ctx), &reader)
return avcc.parseH264(codecCtx.(*H264Ctx), reader)
}
}
}

View File

@@ -15,7 +15,7 @@ import (
type RTPData struct {
*webrtc.RTPCodecParameters
Packets []*rtp.Packet
util.RecyclableBuffers
util.RecyclableMemory
}
func (r *RTPData) String() (s string) {

View File

@@ -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]))
}
for _, nalu := range nalus.Nalus {
reader := util.NewBuffersFromBytes(nalu...)
reader := util.NewReadableBuffersFromBytes(nalu...)
if startIndex := len(r.Packets); reader.Length > 1460 {
//fu-a
for reader.Length > 0 {
@@ -136,7 +136,7 @@ func (h264 *RTPH264Ctx) CreateFrame(from *AVFrame) (frame IAVFrame, err error) {
n := reader.ReadBytesTo(mem[1:])
mem[0] = codec.NALU_FUA.Or(mem[1] & 0x60)
if n < 1459 {
r.RecycleBack(1459 - n)
r.Free(mem[n+1:])
mem = mem[:n+1]
}
r.Packets = append(r.Packets, createPacket(mem))

View File

@@ -179,20 +179,30 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
var n int
var err error
if codecP := track.Codec(); track.Kind() == RTPCodecTypeAudio {
if !publisher.PubAudio {
return
}
mem := util.NewScalableMemoryAllocator(1460 * 100)
frame := &mrtp.RTPAudio{}
frame.RTPCodecParameters = &codecP
frame.ScalableMemoryAllocator = mem
for {
var packet rtp.Packet
buf := frame.NextN(1460)
buf := frame.Malloc(1460)
if n, _, err = track.Read(buf); err == nil {
err = packet.Unmarshal(buf[:n])
frame.RecycleBack(1460 - n)
frame.ReadFromBytes(buf[:n])
if n < 1460 {
frame.Free(buf[n:])
}
}
if err != nil {
return
}
if len(packet.Payload) == 0 {
frame.Free(frame.Pop())
continue
}
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {
frame.Packets = append(frame.Packets, &packet)
} else {
@@ -206,6 +216,9 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
}
}
} else {
if !publisher.PubVideo {
return
}
var lastPLISent time.Time
mem := util.NewScalableMemoryAllocator(1460 * 100)
frame := &mrtp.RTPVideo{}
@@ -220,18 +233,19 @@ func (conf *WebRTCPlugin) Push_(w http.ResponseWriter, r *http.Request) {
lastPLISent = time.Now()
}
var packet rtp.Packet
buf := frame.NextN(1460)
buf := frame.Malloc(1460)
if n, _, err = track.Read(buf); err == nil {
err = packet.Unmarshal(buf[:n])
frame.ReadFromBytes(buf[:n])
if n < 1460 {
frame.RecycleBack(1460 - n)
frame.Free(buf[n:])
}
}
if err != nil {
return
}
if len(packet.Payload) == 0 {
frame.RecycleBack(n)
frame.Free(frame.Pop())
continue
}
if len(frame.Packets) == 0 || packet.Timestamp == frame.Packets[0].Timestamp {

View File

@@ -170,6 +170,7 @@ func (p *Publisher) writeAV(t *AVTrack, data IAVFrame) {
func (p *Publisher) WriteVideo(data IAVFrame) (err error) {
if !p.PubVideo || p.IsStopped() {
data.Recycle()
return
}
t := p.VideoTrack.AVTrack
@@ -276,6 +277,7 @@ func (p *Publisher) WriteVideo(data IAVFrame) (err error) {
func (p *Publisher) WriteAudio(data IAVFrame) (err error) {
if !p.PubAudio || p.IsStopped() {
data.Recycle()
return
}
t := p.AudioTrack.AVTrack