provides cancelation when a component stop responding it closes all resources

This commit is contained in:
Leandro Moreira
2024-01-31 00:21:15 -03:00
parent 1e29f3c4ab
commit a903aa17d7
6 changed files with 97 additions and 43 deletions

View File

@@ -1,8 +1,10 @@
package entities
import (
"context"
"fmt"
astisrt "github.com/asticode/go-astisrt/pkg"
"github.com/pion/webrtc/v3"
)
@@ -67,6 +69,15 @@ type Track struct {
Type TrackType
}
type StreamParameters struct {
WebRTCConn *webrtc.PeerConnection
Cancel context.CancelFunc
Ctx context.Context
SRTConnection *astisrt.Connection
VideoTrack *webrtc.TrackLocalStaticSample
MetadataTrack *webrtc.DataChannel
}
type Config struct {
HTTPPort int32 `required:"true" default:"8080"`
HTTPHost string `required:"true" default:"0.0.0.0"`