mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
Refactor signaling for video and audio (#51)
* add audio and signal request. * disable audio by default. * fix SignalProvide. * disable estimator when track disabled.
This commit is contained in:
@ -18,18 +18,40 @@ type ICEServer struct {
|
||||
Credential string `mapstructure:"credential" json:"credential,omitempty"`
|
||||
}
|
||||
|
||||
type PeerVideo struct {
|
||||
Disabled bool `json:"disabled"`
|
||||
ID string `json:"id"`
|
||||
Video string `json:"video"` // TODO: Remove this, used for compatibility with old clients.
|
||||
Auto bool `json:"auto"`
|
||||
}
|
||||
|
||||
type PeerVideoRequest struct {
|
||||
Disabled *bool `json:"disabled,omitempty"`
|
||||
Selector *StreamSelector `json:"selector,omitempty"`
|
||||
Auto *bool `json:"auto,omitempty"`
|
||||
}
|
||||
|
||||
type PeerAudio struct {
|
||||
Disabled bool `json:"disabled"`
|
||||
}
|
||||
|
||||
type PeerAudioRequest struct {
|
||||
Disabled *bool `json:"disabled,omitempty"`
|
||||
}
|
||||
|
||||
type WebRTCPeer interface {
|
||||
CreateOffer(ICERestart bool) (*webrtc.SessionDescription, error)
|
||||
CreateAnswer() (*webrtc.SessionDescription, error)
|
||||
SetRemoteDescription(webrtc.SessionDescription) error
|
||||
SetCandidate(webrtc.ICECandidateInit) error
|
||||
|
||||
SetVideo(StreamSelector) error
|
||||
VideoID() (string, bool)
|
||||
SetPaused(isPaused bool) error
|
||||
Paused() bool
|
||||
SetVideoAuto(auto bool)
|
||||
VideoAuto() bool
|
||||
|
||||
SetVideo(PeerVideoRequest) error
|
||||
Video() PeerVideo
|
||||
SetAudio(PeerAudioRequest) error
|
||||
Audio() PeerAudio
|
||||
|
||||
SendCursorPosition(x, y int) error
|
||||
SendCursorImage(cur *CursorImage, img []byte) error
|
||||
|
Reference in New Issue
Block a user