webrtc 拉流

This commit is contained in:
yangjiechina
2024-03-28 18:14:54 +08:00
parent 7694237dc7
commit 1ec5c201b5
9 changed files with 351 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package stream
import (
"bytes"
"encoding/json"
"github.com/yangjiechina/avformat/utils"
"net/http"
"time"
)
@@ -35,6 +36,12 @@ func NewPublishHookEventInfo(stream, remoteAddr string, protocol SourceType) eve
return eventInfo{stream: stream, protocol: sourceTypeToStr(protocol), remoteAddr: remoteAddr}
}
type HookHandler interface {
Play(sink ISink, success func(), failure func(state utils.HookState))
PlayDone(sink ISink, success func(), failure func(state utils.HookState))
}
type HookSession interface {
send(url string, body interface{}, success func(response *http.Response), failure func(response *http.Response, err error)) error