feat: grpc support

This commit is contained in:
langhuihui
2024-04-09 20:31:39 +08:00
parent e625fe51fc
commit 8284f956fe
21 changed files with 2843 additions and 115 deletions

View File

@@ -29,6 +29,10 @@ func (avcc *RTMPData) GetSize() int {
return avcc.Length
}
func (avcc *RTMPData) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf(`{"Timestamp":%d,"Size":%d,"Data":"%s"}`, avcc.Timestamp, avcc.Length, avcc.Print())), nil
}
func (avcc *RTMPData) Print() string {
return fmt.Sprintf("% 02X", avcc.Buffers.Buffers[0][:5])
}