mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-10-06 08:06:58 +08:00
rtmp: add new AMF0 encoder and encoder (#3069)
This improves performance, security and removes a dependency.
This commit is contained in:
@@ -14,8 +14,7 @@ type ExtendedSequenceStart struct {
|
||||
Config []byte
|
||||
}
|
||||
|
||||
// Unmarshal implements Message.
|
||||
func (m *ExtendedSequenceStart) Unmarshal(raw *rawmessage.Message) error {
|
||||
func (m *ExtendedSequenceStart) unmarshal(raw *rawmessage.Message) error {
|
||||
if len(raw.Body) < 6 {
|
||||
return fmt.Errorf("not enough bytes")
|
||||
}
|
||||
@@ -32,8 +31,7 @@ func (m ExtendedSequenceStart) marshalBodySize() int {
|
||||
return 5 + len(m.Config)
|
||||
}
|
||||
|
||||
// Marshal implements Message.
|
||||
func (m ExtendedSequenceStart) Marshal() (*rawmessage.Message, error) {
|
||||
func (m ExtendedSequenceStart) marshal() (*rawmessage.Message, error) {
|
||||
body := make([]byte, m.marshalBodySize())
|
||||
|
||||
body[0] = 0b10000000 | byte(ExtendedTypeSequenceStart)
|
||||
|
Reference in New Issue
Block a user