mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
remove go-events
This commit is contained in:
committed by
Miroslav Šedivý
parent
cfc6bd417f
commit
5690a849e2
@ -19,13 +19,15 @@ type BroadcastManager interface {
|
||||
|
||||
type StreamSinkManager interface {
|
||||
Codec() codec.RTPCodec
|
||||
OnSample(listener func(sample Sample))
|
||||
|
||||
AddListener() error
|
||||
RemoveListener() error
|
||||
|
||||
ListenersCount() int
|
||||
Started() bool
|
||||
GetSampleChannel() (chan Sample)
|
||||
SetChangeFramerate(rate int16)
|
||||
SetAdaptiveFramerate(allow bool)
|
||||
}
|
||||
|
||||
type CaptureManager interface {
|
||||
|
@ -31,6 +31,8 @@ func ParseStr(codecName string) (codec RTPCodec, ok bool) {
|
||||
codec = VP8()
|
||||
case VP9().Name:
|
||||
codec = VP9()
|
||||
case AV1().Name:
|
||||
codec = AV1()
|
||||
case H264().Name:
|
||||
codec = H264()
|
||||
case Opus().Name:
|
||||
@ -48,6 +50,12 @@ func ParseStr(codecName string) (codec RTPCodec, ok bool) {
|
||||
return
|
||||
}
|
||||
|
||||
func IsVideo(codecType webrtc.RTPCodecType) (ok bool) {
|
||||
ok = codecType == webrtc.RTPCodecTypeVideo
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
type RTPCodec struct {
|
||||
Name string
|
||||
PayloadType webrtc.PayloadType
|
||||
@ -108,6 +116,21 @@ func H264() RTPCodec {
|
||||
},
|
||||
}
|
||||
}
|
||||
// TODO: Profile ID.
|
||||
func AV1() RTPCodec {
|
||||
return RTPCodec{
|
||||
Name: "av1",
|
||||
PayloadType: 96,
|
||||
Type: webrtc.RTPCodecTypeVideo,
|
||||
Capability: webrtc.RTPCodecCapability{
|
||||
MimeType: webrtc.MimeTypeAV1,
|
||||
ClockRate: 90000,
|
||||
Channels: 0,
|
||||
SDPFmtpLine: "",
|
||||
RTCPFeedback: RTCPFeedback,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func Opus() RTPCodec {
|
||||
return RTPCodec{
|
||||
|
@ -33,11 +33,18 @@ type KeyboardMap struct {
|
||||
Variant string
|
||||
}
|
||||
|
||||
type DesktopErrorMessage struct {
|
||||
Error_code uint8
|
||||
Message string
|
||||
Request_code uint8
|
||||
Minor_code uint8
|
||||
}
|
||||
|
||||
type DesktopManager interface {
|
||||
Start()
|
||||
Shutdown() error
|
||||
OnBeforeScreenSizeChange(listener func())
|
||||
OnAfterScreenSizeChange(listener func())
|
||||
GetBeforeScreenSizeChangeChannel() (chan bool)
|
||||
GetAfterScreenSizeChangeChannel() (chan int16)
|
||||
|
||||
// clipboard
|
||||
ReadClipboard() string
|
||||
@ -65,9 +72,9 @@ type DesktopManager interface {
|
||||
GetScreenshotImage() *image.RGBA
|
||||
|
||||
// xevent
|
||||
OnCursorChanged(listener func(serial uint64))
|
||||
OnClipboardUpdated(listener func())
|
||||
OnFileChooserDialogOpened(listener func())
|
||||
OnFileChooserDialogClosed(listener func())
|
||||
OnEventError(listener func(error_code uint8, message string, request_code uint8, minor_code uint8))
|
||||
GetCursorChangedChannel() (chan uint64)
|
||||
GetClipboardUpdatedChannel() (chan bool)
|
||||
GetFileChooserDialogOpenedChannel() (chan bool)
|
||||
GetFileChooserDialogClosedChannel() (chan bool)
|
||||
GetEventErrorChannel() (chan DesktopErrorMessage)
|
||||
}
|
||||
|
@ -7,6 +7,17 @@ type Member struct {
|
||||
Muted bool `json:"muted"`
|
||||
}
|
||||
|
||||
type SessionInformation struct {
|
||||
Type string
|
||||
Id string
|
||||
Session Session
|
||||
}
|
||||
|
||||
type HostInformation struct {
|
||||
Type string
|
||||
Id string
|
||||
}
|
||||
|
||||
type Session interface {
|
||||
ID() string
|
||||
Name() string
|
||||
@ -46,9 +57,6 @@ type SessionManager interface {
|
||||
Clear() error
|
||||
Broadcast(v interface{}, exclude interface{}) error
|
||||
AdminBroadcast(v interface{}, exclude interface{}) error
|
||||
OnHost(listener func(id string))
|
||||
OnHostCleared(listener func(id string))
|
||||
OnDestroy(listener func(id string, session Session))
|
||||
OnCreated(listener func(id string, session Session))
|
||||
OnConnected(listener func(id string, session Session))
|
||||
GetSessionChannel() (chan SessionInformation)
|
||||
GetHostChannel() (chan HostInformation)
|
||||
}
|
||||
|
Reference in New Issue
Block a user