stream-server/rtmp/connect.go

38 lines
846 B
Go
Raw Normal View History

2023-08-09 16:00:21 +05:00
package rtmp
import "fmt"
2023-08-09 16:00:21 +05:00
func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) {
if err := chnk_wrp_ptr.ReadPeerChunkSize(); err != nil {
return false
}
if err := chnk_wrp_ptr.ReadConnectCommand(); err != nil {
return false
2023-08-10 03:24:00 +05:00
}
if err := chnk_wrp_ptr.WriteWindowAckSize(); err != nil {
return false
}
if err := chnk_wrp_ptr.WritePeerBandwidth(); err != nil {
return false
}
if err := chnk_wrp_ptr.WriteChunkSize(); err != nil {
return false
}
2023-08-15 12:32:44 +05:00
if err := chnk_wrp_ptr.WriteConnectResponse(); err != nil {
return false
}
2023-08-15 14:27:54 +05:00
return true
2023-08-09 16:00:21 +05:00
}
func CreateStream(chnk_wrp_ptr *ChunkWrapper) (bool) {
if _, err := chnk_wrp_ptr.ReadChunk(); err != nil {
return false
}
if _, err := chnk_wrp_ptr.ReadChunk(); err != nil {
return false
}
full_msg_ptr, _ := chnk_wrp_ptr.ReadChunk()
fmt.Println(full_msg_ptr)
return true
}