basic data loop handle (placeholder)

This commit is contained in:
Muaz Ahmad 2023-08-17 16:35:06 +05:00
parent 70d7ba474e
commit 050e8b104f
3 changed files with 18 additions and 3 deletions

View file

@ -1,7 +1,6 @@
package rtmp package rtmp
import ( import (
"fmt"
"os" "os"
) )
@ -53,8 +52,6 @@ func PublishAsKey(chnk_wrp_ptr *ChunkWrapper) (bool) {
if err := chnk_wrp_ptr.WritePublishResponse(); err != nil { if err := chnk_wrp_ptr.WritePublishResponse(); err != nil {
return false return false
} }
p, _ := chnk_wrp_ptr.ReadChunk()
fmt.Println(p)
return true return true
} }

17
rtmp/data_loop.go Normal file
View file

@ -0,0 +1,17 @@
package rtmp
import (
"fmt"
)
func HandleDataLoop(chnk_wrp_ptr *ChunkWrapper) {
for {
p, err := chnk_wrp_ptr.ReadChunk()
if err != nil {
return
}
if p != nil {
fmt.Println(p.msg_type, p.msg_len)
}
}
}

View file

@ -52,5 +52,6 @@ func handle_conn(conn net.Conn, stream_live *bool) {
if !PublishAsKey(chunk_wrapper) { if !PublishAsKey(chunk_wrapper) {
return return
} }
HandleDataLoop(chunk_wrapper)
*stream_live = false *stream_live = false
} }