本文整理匯總了Golang中github.com/ossrs/go-oryx/core.Agent.TiedSink方法的典型用法代碼示例。如果您正苦於以下問題:Golang Agent.TiedSink方法的具體用法?Golang Agent.TiedSink怎麽用?Golang Agent.TiedSink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/ossrs/go-oryx/core.Agent
的用法示例。
在下文中一共展示了Agent.TiedSink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: NewRtmpPublishAgent
func (v *AgentManager) NewRtmpPublishAgent(conn *protocol.RtmpConnection, wc core.WorkerContainer) (pub core.Agent, err error) {
v.lock.Lock()
defer v.lock.Unlock()
// finger the source agent out, which dup to other agent.
var dup core.Agent
if dup, err = v.getDupAgent(conn.Req.Uri()); err != nil {
return
}
// when dup source not nil, then the source is using.
if dup.TiedSink() != nil {
err = AgentBusyError
core.Error.Println("source busy. err is", err)
return
}
// create the publish agent
pub = &RtmpPublishAgent{
conn: conn,
wc: wc,
}
if err = pub.Open(); err != nil {
core.Warn.Println("open publish failed. err is", err)
return
}
// tie the publish agent to dup source.
if err = dup.Tie(pub); err != nil {
core.Error.Println("tie publish failed. err is", err)
return
}
return
}