@@ -10,7 +10,6 @@ import (
10
10
11
11
ethcommon "github.com/ethereum/go-ethereum/common"
12
12
"github.com/golang/glog"
13
- "github.com/livepeer/go-livepeer/media"
14
13
"github.com/livepeer/go-livepeer/net"
15
14
"github.com/livepeer/go-livepeer/trickle"
16
15
)
@@ -47,29 +46,16 @@ type ExternalCapability struct {
47
46
type StreamInfo struct {
48
47
StreamID string
49
48
Capability string
50
- //Gateway fields
51
- StreamRequest []byte
52
- ExcludeOrchs []string
53
- OrchToken * JobToken
54
- OrchUrl string
55
- OrchPublishUrl string
56
- OrchSubscribeUrl string
57
- OrchControlUrl string
58
- OrchEventsUrl string
59
- OrchDataUrl string
60
- ControlPub * trickle.TricklePublisher
61
- StopControl func ()
62
49
63
50
//Orchestrator fields
64
51
Sender ethcommon.Address
52
+ StreamRequest []byte
65
53
pubChannel * trickle.TrickleLocalPublisher
66
54
subChannel * trickle.TrickleLocalPublisher
67
55
controlChannel * trickle.TrickleLocalPublisher
68
56
eventsChannel * trickle.TrickleLocalPublisher
69
57
dataChannel * trickle.TrickleLocalPublisher
70
58
//Stream fields
71
- Params interface {}
72
- DataWriter * media.SegmentWriter
73
59
JobParams string
74
60
StreamCtx context.Context
75
61
CancelStream context.CancelFunc
@@ -82,19 +68,13 @@ func (sd *StreamInfo) IsActive() bool {
82
68
return false
83
69
}
84
70
85
- if sd .controlChannel == nil && sd . ControlPub == nil {
71
+ if sd .controlChannel == nil {
86
72
return false
87
73
}
88
74
89
75
return true
90
76
}
91
77
92
- func (sd * StreamInfo ) ExcludeOrch (orchUrl string ) {
93
- sd .sdm .Lock ()
94
- defer sd .sdm .Unlock ()
95
- sd .ExcludeOrchs = append (sd .ExcludeOrchs , orchUrl )
96
- }
97
-
98
78
func (sd * StreamInfo ) UpdateParams (params string ) {
99
79
sd .sdm .Lock ()
100
80
defer sd .sdm .Unlock ()
@@ -123,7 +103,7 @@ func NewExternalCapabilities() *ExternalCapabilities {
123
103
}
124
104
}
125
105
126
- func (extCaps * ExternalCapabilities ) AddStream (streamID string , pipeline string , params interface {} , streamReq []byte ) (* StreamInfo , error ) {
106
+ func (extCaps * ExternalCapabilities ) AddStream (streamID string , capability string , streamReq []byte ) (* StreamInfo , error ) {
127
107
extCaps .capm .Lock ()
128
108
defer extCaps .capm .Unlock ()
129
109
_ , ok := extCaps .Streams [streamID ]
@@ -135,8 +115,7 @@ func (extCaps *ExternalCapabilities) AddStream(streamID string, pipeline string,
135
115
ctx , cancel := context .WithCancel (context .Background ())
136
116
stream := StreamInfo {
137
117
StreamID : streamID ,
138
- Capability : pipeline ,
139
- Params : params , // Store the interface value directly, not a pointer to it
118
+ Capability : capability ,
140
119
StreamRequest : streamReq ,
141
120
StreamCtx : ctx ,
142
121
CancelStream : cancel ,
@@ -147,15 +126,6 @@ func (extCaps *ExternalCapabilities) AddStream(streamID string, pipeline string,
147
126
go func () {
148
127
<- ctx .Done ()
149
128
150
- //gateway channels shutdown
151
- if stream .DataWriter != nil {
152
- stream .DataWriter .Close ()
153
- }
154
- if stream .ControlPub != nil {
155
- stream .StopControl ()
156
- stream .ControlPub .Close ()
157
- }
158
-
159
129
//orchestrator channels shutdown
160
130
if stream .pubChannel != nil {
161
131
stream .pubChannel .Close ()
0 commit comments