reply

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MIT Imports: 51 Imported by: 0

README


目录释义

目录 说明
./ 接收的数据处理区
json/ json的golang struct表述
ws_msg/ 弹幕服务器传回的Msg类型json的golang struct表述
0Init.go 最初始载入配置
F.go 附加功能
flvDecode.go 直播流转局域网直播流
Heartbeat.go 人气数据分派
Msg.go 消息数据分派
Reply.go 分派数据处理
gtk.go gtk弹幕窗模块
tts.go TTS语音模块

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ShowRev_old   float64
	ShowRev_start bool
)

功能区 ShowRev 显示营收

View Source
var (
	Ass_height = 720  //字幕高度
	Ass_width  = 1280 //字幕宽度
	Ass_font   = 50   //字幕字体大小
	Ass_T      = 7    //单条字幕显示时间
	Ass_loc    = 7    //字幕位置 小键盘对应的位置
)
View Source
var Danmu_mq = mq.New()
View Source
var Heart_map = map[string]func(replyF, int){
	"heartbeat": replyF.heartbeat,
}
View Source
var Msg_map = map[string]func(replyF, string){}/* 106 elements not displayed */

Msg类型数据处理方法map

View Source
var SaveToJson saveToJson
View Source
var StreamWs = websocket.New_server()

直播Web服务口

Functions

func Ass_f

func Ass_f(contextC context.Context, save_path string, filePath string, st time.Time)

设定字幕文件名,为""时停止输出

func Assf

func Assf(s string)

传入要显示的单条字幕

func AutoSend_silver_gift added in v0.5.8

func AutoSend_silver_gift()

自动发送即将过期的银瓜子礼物

func Autoskipf

func Autoskipf(s string) uint

func Danmuji_auto

func Danmuji_auto()

func Danmujif

func Danmujif(s string)

func Entry_danmu added in v0.5.8

func Entry_danmu()

进入房间发送弹幕

func Gui_show

func Gui_show(m ...string)

消息显示

func Heart

func Heart(b []byte)

HeartBeat类型,将人气4位byte转为字符串,并送到上述map指定的方法

func IsOn

func IsOn(s string) bool

功能开关选取函数

func Itos

func Itos(i []interface{}) string

func Jiezouf

func Jiezouf(s []string) bool

func Keep_medal_light added in v0.5.8

func Keep_medal_light()

保持所有牌子点亮

func Lessdanmuf

func Lessdanmuf(s string) (show bool)

func Msg

func Msg(b []byte)

Msg类型数据处理方法挑选 识别cmd字段类型,查找上述map中设置的方法,并将json转为字符串型传入

func Msg_senddanmu

func Msg_senddanmu(msg string)

弹幕发送 传入字符串即可发送 需要cookie

func Msg_showdanmu

func Msg_showdanmu(item Danmu_item)

弹幕显示 由于额外功能有些需要显示,为了统一管理,使用此方法进行处理

func PlayRecDanmu added in v0.5.10

func PlayRecDanmu(filePath string) (*websocket.Server, func())

func Reply

func Reply(b []byte)

返回数据分派 传入接受到的ws数据 判断进行解压,并对每个json对象进行分派

func Search_stream_tag added in v0.6.1

func Search_stream_tag(buf []byte, keyframe *slice.Buf[byte]) (front_buf []byte, last_available_offset int, err error)

this fuction read []byte and return flv header and all complete keyframe if possible. complete keyframe means the video and audio tags between two video key frames tag

func SendStreamWs added in v0.5.10

func SendStreamWs(item Danmu_item)

func Shortdanmuf

func Shortdanmuf(s string) string

func ShowRevf

func ShowRevf()

显示营收

func StartRecDanmu added in v0.5.10

func StartRecDanmu(c context.Context, filePath string)

弹幕回放

func StreamOCommon added in v0.5.10

func StreamOCommon(roomid int) (array []*c.Common)

获取实例的Common

func StreamOCut added in v0.8.0

func StreamOCut(roomid int, title ...string)

实例切断

func StreamOStart added in v0.5.11

func StreamOStart(roomid int)

开始实例

func StreamOStatus added in v0.5.10

func StreamOStatus(roomid int) (Islive bool)

获取实例的录制状态

func StreamOStop added in v0.5.10

func StreamOStop(roomid int)

停止实例

-2 其他房间 -1 所有房间 针对某房间

func TTS added in v0.5.6

func TTS(msg string)

Types

type Ass

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

Ass 弹幕转字幕

type Autoskip

type Autoskip struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type Autoskip_item added in v0.5.6

type Autoskip_item struct {
	Exprie uint
	Num    uint
}

type Communicate added in v0.5.10

type Communicate struct {
	Buf *psync.Map
}

func (*Communicate) Count added in v0.5.10

func (t *Communicate) Count() int

func (*Communicate) Reset added in v0.5.10

func (t *Communicate) Reset()

func (*Communicate) Store added in v0.5.10

func (t *Communicate) Store(k interface{})

type DanmuReLiveTriger added in v0.7.3

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

func (*DanmuReLiveTriger) Check added in v0.7.3

func (t *DanmuReLiveTriger) Check(uid, msg string)

func (*DanmuReLiveTriger) Init added in v0.7.3

func (t *DanmuReLiveTriger) Init(c *c.Common)

type Danmu_item added in v0.5.10

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

Msg-弹幕处理

type Danmu_mq_t

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

type Danmuji

type Danmuji struct {
	Buf        map[string]string
	Inuse_auto bool
	// contains filtered or unexported fields
}

type Fmp4Decoder added in v0.5.10

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

func (*Fmp4Decoder) Init_fmp4 added in v0.5.10

func (t *Fmp4Decoder) Init_fmp4(buf []byte) (b []byte, err error)

func (*Fmp4Decoder) Search_stream_fmp4 added in v0.6.1

func (t *Fmp4Decoder) Search_stream_fmp4(buf []byte, keyframe *slice.Buf[byte]) (cu int, err error)

type Jiezou

type Jiezou struct {
	sync.Mutex
	// contains filtered or unexported fields
}

type Lessdanmu

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

type M4SStream added in v0.5.10

type M4SStream struct {
	Status *signal.Signal //IsLive()是否运行中

	Stream_msg *msgq.MsgType[[]byte] //流数据消息 tag:data

	Current_save_path string //明确的直播流保存目录

	Callback_start    func(*M4SStream) error //实例开始的回调
	Callback_startRec func(*M4SStream) error //录制开始的回调
	Callback_stopRec  func(*M4SStream)       //录制结束的回调
	Callback_stop     func(*M4SStream)       //实例结束的回调
	// contains filtered or unexported fields
}

func (*M4SStream) Common added in v0.5.10

func (t *M4SStream) Common() *c.Common

func (*M4SStream) LoadConfig added in v0.5.10

func (t *M4SStream) LoadConfig(common *c.Common) (e error)

func (*M4SStream) PusherToFile added in v0.8.0

func (t *M4SStream) PusherToFile(contextC context.Context, filepath string, startFunc func(*M4SStream) error, stopFunc func(*M4SStream) error) error

保存到文件

func (*M4SStream) PusherToHttp added in v0.8.0

func (t *M4SStream) PusherToHttp(w http.ResponseWriter, r *http.Request, startFunc func(*M4SStream) error, stopFunc func(*M4SStream) error) error

流服务推送方法

func (*M4SStream) Start added in v0.5.10

func (t *M4SStream) Start() bool

func (*M4SStream) Stop added in v0.5.10

func (t *M4SStream) Stop()

type M4SStream_Config added in v0.5.10

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

type SaveDanmuToDB added in v0.8.8

type SaveDanmuToDB struct {
	sync.Once
	// contains filtered or unexported fields
}

type SavestreamO added in v0.5.10

type SavestreamO struct {
	Roomid int
	IsRec  bool
}

type Shortdanmu

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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