rtmp: add new AMF0 encoder and encoder (#3069)

This improves performance, security and removes a dependency.
This commit is contained in:
Alessandro Ros
2024-02-24 19:11:42 +01:00
committed by GitHub
parent e06155b9b0
commit da7c5744b1
56 changed files with 1159 additions and 321 deletions

View File

@@ -12,8 +12,7 @@ type UserControlSetBufferLength struct {
BufferLength uint32
}
// Unmarshal implements Message.
func (m *UserControlSetBufferLength) Unmarshal(raw *rawmessage.Message) error {
func (m *UserControlSetBufferLength) unmarshal(raw *rawmessage.Message) error {
if raw.ChunkStreamID != ControlChunkStreamID {
return fmt.Errorf("unexpected chunk stream ID")
}
@@ -28,8 +27,7 @@ func (m *UserControlSetBufferLength) Unmarshal(raw *rawmessage.Message) error {
return nil
}
// Marshal implements Message.
func (m UserControlSetBufferLength) Marshal() (*rawmessage.Message, error) {
func (m UserControlSetBufferLength) marshal() (*rawmessage.Message, error) {
buf := make([]byte, 10)
buf[0] = byte(UserControlTypeSetBufferLength >> 8)