Basic create stream handle, void releasestream and fcpublish calls since no doc, and only going to accept stream data anyway

This commit is contained in:
Muaz Ahmad 2023-08-15 15:29:46 +05:00
parent 83c61128d8
commit a38fbea911
2 changed files with 16 additions and 1 deletions

View file

@ -1,5 +1,6 @@
package rtmp package rtmp
import "fmt"
func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) { func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) {
if err := chnk_wrp_ptr.ReadPeerChunkSize(); err != nil { if err := chnk_wrp_ptr.ReadPeerChunkSize(); err != nil {
@ -22,3 +23,15 @@ func NegotiateConnect(chnk_wrp_ptr *ChunkWrapper) (bool) {
} }
return true return true
} }
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
}

View file

@ -45,6 +45,8 @@ func handle_conn(conn net.Conn, stream_live *bool) {
if !NegotiateConnect(chunk_wrapper) { if !NegotiateConnect(chunk_wrapper) {
return return
} }
if !CreateStream(chunk_wrapper) {
return
}
*stream_live = false *stream_live = false
} }