crtmp

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosedByCaller = errors.New("tunnel closed by caller")

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode struct {
	Err error
	// contains filtered or unexported fields
}

func (*ErrorCode) Stringify

func (ec *ErrorCode) Stringify() string

type Tunnel

type Tunnel struct {
	// contains filtered or unexported fields
}

func NewTunnel

func NewTunnel(inUrl string, outUrlList []string) *Tunnel

@param inUrl 拉流rtmp url地址 @param outUrlList 推流rtmp url地址列表

func (*Tunnel) Close

func (t *Tunnel) Close()

`Start`函数调用成功后,可调用`Close`函数,主动关闭转推任务 `Close`函数允许调用多次

func (*Tunnel) Start

func (t *Tunnel) Start() (ret ErrorCode)

Start

@return ErrorCode.err:

  • 为nil时,表示任务启动成功,拉流和推流通道都已成功建立,并开始转推数据。
  • 不为nil时,表示任务失败,可以通过`code`得到是拉流还是推流失败。

func (*Tunnel) Wait

func (t *Tunnel) Wait() chan ErrorCode

`Start`函数调用成功后,可调用`Wait`函数,等待任务结束

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL