Documentation ¶
Overview ¶
Package message contains a RTMP message reader/writer.
Index ¶
- Constants
- type Acknowledge
- type Audio
- type AudioAACType
- type CommandAMF0
- type DataAMF0
- type ExtendedCodedFrames
- type ExtendedFramesX
- type ExtendedMPEG2TSSequenceStart
- type ExtendedMetadata
- type ExtendedSequenceEnd
- type ExtendedSequenceStart
- type ExtendedType
- type FourCC
- type Message
- type ReadWriter
- type Reader
- type SetChunkSize
- type SetPeerBandwidth
- type SetWindowAckSize
- type Type
- type UserControlPingRequest
- type UserControlPingResponse
- type UserControlSetBufferLength
- type UserControlStreamBegin
- type UserControlStreamDry
- type UserControlStreamEOF
- type UserControlStreamIsRecorded
- type UserControlType
- type Video
- type VideoType
- type Writer
Constants ¶
const ( CodecMPEG1Audio = 2 CodecLPCM = 3 CodecPCMA = 7 CodecPCMU = 8 CodecMPEG4Audio = 10 )
audio codecs
const ( Rate5512 = 0 Rate11025 = 1 Rate22050 = 2 Rate44100 = 3 )
audio rates
const ( Depth8 = 0 Depth16 = 1 )
audio depths
const (
// AudioChunkStreamID is the chunk stream ID that is usually used to send Audio{}
AudioChunkStreamID = 4
)
const (
CodecH264 = 7
)
supported video codecs
const (
// ControlChunkStreamID is the stream ID used for control messages.
ControlChunkStreamID = 2
)
const (
// VideoChunkStreamID is the chunk stream ID that is usually used to send Video{}
VideoChunkStreamID = 6
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Acknowledge ¶
type Acknowledge struct {
Value uint32
}
Acknowledge is an acknowledgement message.
type Audio ¶
type Audio struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 Codec uint8 Rate uint8 Depth uint8 IsStereo bool AACType AudioAACType // only for CodecMPEG4Audio Payload []byte }
Audio is an audio message.
type AudioAACType ¶
type AudioAACType uint8
AudioAACType is the AAC type of a Audio.
const ( AudioAACTypeConfig AudioAACType = 0 AudioAACTypeAU AudioAACType = 1 )
AudioAACType values.
type CommandAMF0 ¶
type CommandAMF0 struct { ChunkStreamID byte MessageStreamID uint32 Name string CommandID int Arguments []interface{} }
CommandAMF0 is a AMF0 command message.
type ExtendedCodedFrames ¶
type ExtendedCodedFrames struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 FourCC FourCC PTSDelta time.Duration Payload []byte }
ExtendedCodedFrames is a CodedFrames extended message.
type ExtendedFramesX ¶
type ExtendedFramesX struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 FourCC FourCC Payload []byte }
ExtendedFramesX is a FramesX extended message.
type ExtendedMPEG2TSSequenceStart ¶
type ExtendedMPEG2TSSequenceStart struct {
FourCC FourCC
}
ExtendedMPEG2TSSequenceStart is a MPEG2-TS sequence start extended message.
type ExtendedMetadata ¶
type ExtendedMetadata struct {
FourCC FourCC
}
ExtendedMetadata is a metadata extended message.
type ExtendedSequenceEnd ¶
type ExtendedSequenceEnd struct {
FourCC FourCC
}
ExtendedSequenceEnd is a sequence end extended message.
type ExtendedSequenceStart ¶
type ExtendedSequenceStart struct { ChunkStreamID byte MessageStreamID uint32 FourCC FourCC Config []byte }
ExtendedSequenceStart is a sequence start extended message.
type ExtendedType ¶
type ExtendedType uint8
ExtendedType is a message extended type.
const ( ExtendedTypeSequenceStart ExtendedType = 0 ExtendedTypeCodedFrames ExtendedType = 1 ExtendedTypeSequenceEnd ExtendedType = 2 ExtendedTypeFramesX ExtendedType = 3 ExtendedTypeMetadata ExtendedType = 4 ExtendedTypeMPEG2TSSequenceStart ExtendedType = 5 )
message extended types.
type Message ¶
type Message interface {
// contains filtered or unexported methods
}
Message is a message.
type ReadWriter ¶
type ReadWriter struct {
// contains filtered or unexported fields
}
ReadWriter is a message reader/writer.
func NewReadWriter ¶
func NewReadWriter( rw io.ReadWriter, bcrw *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 SetChunkSize ¶
type SetChunkSize struct {
Value uint32
}
SetChunkSize is a set chunk size message.
type SetPeerBandwidth ¶
SetPeerBandwidth is a set peer bandwidth message.
type SetWindowAckSize ¶
type SetWindowAckSize struct {
Value uint32
}
SetWindowAckSize is a set window acknowledgement message.
type Type ¶
type Type byte
Type is a message type.
const ( TypeSetChunkSize Type = 1 TypeAbortMessage Type = 2 TypeAcknowledge Type = 3 TypeSetWindowAckSize Type = 5 TypeSetPeerBandwidth Type = 6 TypeUserControl Type = 4 TypeCommandAMF3 Type = 17 TypeCommandAMF0 Type = 20 TypeDataAMF3 Type = 15 TypeDataAMF0 Type = 18 TypeAudio Type = 8 TypeVideo Type = 9 )
message types.
type UserControlPingRequest ¶
type UserControlPingRequest struct {
ServerTime uint32
}
UserControlPingRequest is a user control message.
type UserControlPingResponse ¶
type UserControlPingResponse struct {
ServerTime uint32
}
UserControlPingResponse is a user control message.
type UserControlSetBufferLength ¶
UserControlSetBufferLength is a user control message.
type UserControlStreamBegin ¶
type UserControlStreamBegin struct {
StreamID uint32
}
UserControlStreamBegin is a user control message.
type UserControlStreamDry ¶
type UserControlStreamDry struct {
StreamID uint32
}
UserControlStreamDry is a user control message.
type UserControlStreamEOF ¶
type UserControlStreamEOF struct {
StreamID uint32
}
UserControlStreamEOF is a user control message.
type UserControlStreamIsRecorded ¶
type UserControlStreamIsRecorded struct {
StreamID uint32
}
UserControlStreamIsRecorded is a user control message.
type UserControlType ¶
type UserControlType uint16
UserControlType is a user control type.
const ( UserControlTypeStreamBegin UserControlType = 0 UserControlTypeStreamEOF UserControlType = 1 UserControlTypeStreamDry UserControlType = 2 UserControlTypeSetBufferLength UserControlType = 3 UserControlTypeStreamIsRecorded UserControlType = 4 UserControlTypePingRequest UserControlType = 6 UserControlTypePingResponse UserControlType = 7 )
user control types.
type Video ¶
type Video struct { ChunkStreamID byte DTS time.Duration MessageStreamID uint32 Codec uint8 IsKeyFrame bool Type VideoType PTSDelta time.Duration Payload []byte }
Video is a video message.
Source Files ¶
- acknowledge.go
- audio.go
- command_amf0.go
- data_amf0.go
- extended_coded_frames.go
- extended_frames_x.go
- extended_metadata.go
- extended_mpeg2ts_sequence_start.go
- extended_sequence_end.go
- extended_sequence_start.go
- message.go
- reader.go
- readwriter.go
- set_chunk_size.go
- set_peer_bandwidth.go
- set_window_ack_size.go
- user_control_ping_request.go
- user_control_ping_response.go
- user_control_set_buffer_length.go
- user_control_stream_begin.go
- user_control_stream_dry.go
- user_control_stream_eof.go
- user_control_stream_is_recorded.go
- video.go
- writer.go