mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-05 23:56:54 +08:00
rtmp: add new AMF0 encoder and encoder (#3069)
This improves performance, security and removes a dependency.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user