Documentation ¶
Overview ¶
Package message contains a RTMP message reader/writer.
Index ¶
- Constants
- type Message
- type MsgAcknowledge
- type MsgAudio
- type MsgCommandAMF0
- type MsgDataAMF0
- type MsgSetChunkSize
- type MsgSetPeerBandwidth
- type MsgSetWindowAckSize
- type MsgUserControlPingRequest
- type MsgUserControlPingResponse
- type MsgUserControlSetBufferLength
- type MsgUserControlStreamBegin
- type MsgUserControlStreamDry
- type MsgUserControlStreamEOF
- type MsgUserControlStreamIsRecorded
- type MsgVideo
- type ReadWriter
- type Reader
- type Writer
Constants ¶
const ( UserControlTypeStreamBegin = 0 UserControlTypeStreamEOF = 1 UserControlTypeStreamDry = 2 UserControlTypeSetBufferLength = 3 UserControlTypeStreamIsRecorded = 4 UserControlTypePingRequest = 6 UserControlTypePingResponse = 7 )
user control types.
const (
// ControlChunkStreamID is the stream ID used for control messages.
ControlChunkStreamID = 2
)
const (
// MsgAudioChunkStreamID is the chunk stream ID that is usually used to send MsgAudio{}
MsgAudioChunkStreamID = 6
)
const (
// MsgVideoChunkStreamID is the chunk stream ID that is usually used to send MsgVideo{}
MsgVideoChunkStreamID = 6
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message interface { Unmarshal(*rawmessage.Message) error Marshal() (*rawmessage.Message, error) }
Message is a message.
type MsgAcknowledge ¶
type MsgAcknowledge struct {
Value uint32
}
MsgAcknowledge is an acknowledgement message.
func (*MsgAcknowledge) Marshal ¶
func (m *MsgAcknowledge) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgAcknowledge) Unmarshal ¶
func (m *MsgAcknowledge) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgAudio ¶
type MsgAudio struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 Rate uint8 Depth uint8 Channels uint8 AACType uint8 Payload []byte }
MsgAudio is an audio message.
type MsgCommandAMF0 ¶
type MsgCommandAMF0 struct { ChunkStreamID byte MessageStreamID uint32 Name string CommandID int Arguments []interface{} }
MsgCommandAMF0 is a AMF0 command message.
func (MsgCommandAMF0) Marshal ¶
func (m MsgCommandAMF0) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgCommandAMF0) Unmarshal ¶
func (m *MsgCommandAMF0) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgDataAMF0 ¶
MsgDataAMF0 is a AMF0 data message.
func (MsgDataAMF0) Marshal ¶
func (m MsgDataAMF0) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgDataAMF0) Unmarshal ¶
func (m *MsgDataAMF0) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgSetChunkSize ¶
type MsgSetChunkSize struct {
Value uint32
}
MsgSetChunkSize is a set chunk size message.
func (*MsgSetChunkSize) Marshal ¶
func (m *MsgSetChunkSize) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgSetChunkSize) Unmarshal ¶
func (m *MsgSetChunkSize) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgSetPeerBandwidth ¶
MsgSetPeerBandwidth is a set peer bandwidth message.
func (*MsgSetPeerBandwidth) Marshal ¶
func (m *MsgSetPeerBandwidth) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgSetPeerBandwidth) Unmarshal ¶
func (m *MsgSetPeerBandwidth) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgSetWindowAckSize ¶
type MsgSetWindowAckSize struct {
Value uint32
}
MsgSetWindowAckSize is a set window acknowledgement message.
func (*MsgSetWindowAckSize) Marshal ¶
func (m *MsgSetWindowAckSize) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgSetWindowAckSize) Unmarshal ¶
func (m *MsgSetWindowAckSize) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlPingRequest ¶
type MsgUserControlPingRequest struct {
ServerTime uint32
}
MsgUserControlPingRequest is a user control message.
func (MsgUserControlPingRequest) Marshal ¶
func (m MsgUserControlPingRequest) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlPingRequest) Unmarshal ¶
func (m *MsgUserControlPingRequest) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlPingResponse ¶
type MsgUserControlPingResponse struct {
ServerTime uint32
}
MsgUserControlPingResponse is a user control message.
func (MsgUserControlPingResponse) Marshal ¶
func (m MsgUserControlPingResponse) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlPingResponse) Unmarshal ¶
func (m *MsgUserControlPingResponse) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlSetBufferLength ¶
MsgUserControlSetBufferLength is a user control message.
func (MsgUserControlSetBufferLength) Marshal ¶
func (m MsgUserControlSetBufferLength) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlSetBufferLength) Unmarshal ¶
func (m *MsgUserControlSetBufferLength) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlStreamBegin ¶
type MsgUserControlStreamBegin struct {
StreamID uint32
}
MsgUserControlStreamBegin is a user control message.
func (MsgUserControlStreamBegin) Marshal ¶
func (m MsgUserControlStreamBegin) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlStreamBegin) Unmarshal ¶
func (m *MsgUserControlStreamBegin) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlStreamDry ¶
type MsgUserControlStreamDry struct {
StreamID uint32
}
MsgUserControlStreamDry is a user control message.
func (MsgUserControlStreamDry) Marshal ¶
func (m MsgUserControlStreamDry) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlStreamDry) Unmarshal ¶
func (m *MsgUserControlStreamDry) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlStreamEOF ¶
type MsgUserControlStreamEOF struct {
StreamID uint32
}
MsgUserControlStreamEOF is a user control message.
func (MsgUserControlStreamEOF) Marshal ¶
func (m MsgUserControlStreamEOF) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlStreamEOF) Unmarshal ¶
func (m *MsgUserControlStreamEOF) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgUserControlStreamIsRecorded ¶
type MsgUserControlStreamIsRecorded struct {
StreamID uint32
}
MsgUserControlStreamIsRecorded is a user control message.
func (MsgUserControlStreamIsRecorded) Marshal ¶
func (m MsgUserControlStreamIsRecorded) Marshal() (*rawmessage.Message, error)
Marshal implements Message.
func (*MsgUserControlStreamIsRecorded) Unmarshal ¶
func (m *MsgUserControlStreamIsRecorded) Unmarshal(raw *rawmessage.Message) error
Unmarshal implements Message.
type MsgVideo ¶
type MsgVideo struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 IsKeyFrame bool H264Type uint8 PTSDelta time.Duration Payload []byte }
MsgVideo is a video message.
type ReadWriter ¶
type ReadWriter struct {
// contains filtered or unexported fields
}
ReadWriter is a message reader/writer.
func NewReadWriter ¶
func NewReadWriter(bc *bytecounter.ReadWriter, checkAcknowledge bool) *ReadWriter
NewReadWriter allocates a ReadWriter.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader is a message reader.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer is a message writer.
func NewWriter ¶
func NewWriter(w *bytecounter.Writer, checkAcknowledge bool) *Writer
NewWriter allocates a Writer.
func (*Writer) SetAcknowledgeValue ¶
SetAcknowledgeValue sets the value of the last received acknowledge.
Source Files ¶
- message.go
- msg_acknowledge.go
- msg_audio.go
- msg_command_amf0.go
- msg_data_amf0.go
- msg_setchunksize.go
- msg_setpeerbandwidth.go
- msg_setwindowacksize.go
- msg_usercontrol.go
- msg_usercontrol_pingrequest.go
- msg_usercontrol_pingresponse.go
- msg_usercontrol_setbufferlength.go
- msg_usercontrol_streambegin.go
- msg_usercontrol_streamdry.go
- msg_usercontrol_streameof.go
- msg_usercontrol_streamisrecorded.go
- msg_video.go
- reader.go
- readwriter.go
- writer.go