From 313236e3d30e20dd443cb7b52b4ff71b3a07250c Mon Sep 17 00:00:00 2001 From: David Zhao Date: Thu, 31 Dec 2020 14:21:19 -0800 Subject: [PATCH] server to support mutes --- pkg/rtc/datatrack.go | 7 +- pkg/rtc/interfaces.go | 8 +- pkg/rtc/mediatrack.go | 12 ++- pkg/rtc/participant.go | 114 ++++++++++++++----------- pkg/rtc/room.go | 8 +- pkg/rtc/utils.go | 7 +- pkg/service/rtc.go | 2 + proto/livekit/model.pb.go | 41 +++++---- proto/livekit/rtc.pb.go | 170 +++++++++++++++++++++----------------- proto/model.proto | 1 + proto/rtc.proto | 11 +-- 11 files changed, 231 insertions(+), 150 deletions(-) diff --git a/pkg/rtc/datatrack.go b/pkg/rtc/datatrack.go index 080d2457a..19188d235 100644 --- a/pkg/rtc/datatrack.go +++ b/pkg/rtc/datatrack.go @@ -15,7 +15,7 @@ const ( ) // DataTrack wraps a WebRTC DataChannel to satisfy the PublishedTrack interface -// it shall forward tracks to all of its subscribers +// it shall forward publishedTracks to all of its subscribers type DataTrack struct { id string participantId string @@ -65,6 +65,11 @@ func (t *DataTrack) StreamID() string { return t.dataChannel.Label() } +// DataTrack cannot be muted +func (t *DataTrack) IsMuted() bool { + return false +} + func (t *DataTrack) AddSubscriber(participant Participant) error { label := PackDataTrackLabel(t.participantId, t.ID(), t.dataChannel.Label()) downChannel, err := participant.PeerConnection().CreateDataChannel(label, t.dataChannelOptions()) diff --git a/pkg/rtc/interfaces.go b/pkg/rtc/interfaces.go index 45ed1aa91..ab22a66e3 100644 --- a/pkg/rtc/interfaces.go +++ b/pkg/rtc/interfaces.go @@ -57,20 +57,25 @@ type Participant interface { HandleNegotiate(sd webrtc.SessionDescription) error SetRemoteDescription(sdp webrtc.SessionDescription) error AddICECandidate(candidate webrtc.ICECandidateInit) error - AddSubscriber(op Participant) error RemoveSubscriber(peerId string) SendJoinResponse(info *livekit.RoomInfo, otherParticipants []Participant) error SendParticipantUpdate(participants []*livekit.ParticipantInfo) error + SetTrackMuted(trackId string, muted bool) Start() Close() error // callbacks + // OnOffer - offer is ready for remote peer OnOffer(func(webrtc.SessionDescription)) + // OnICECandidate - ice candidate discovered for local peer OnICECandidate(func(c *webrtc.ICECandidateInit)) OnStateChange(func(p Participant, oldState livekit.ParticipantInfo_State)) + // OnTrackPublished - remote added a remoteTrack OnTrackPublished(func(Participant, PublishedTrack)) + // OnTrackUpdated - one of its publishedTracks changed in status + OnTrackUpdated(callback func(Participant, PublishedTrack)) OnClose(func(Participant)) // package methods @@ -87,6 +92,7 @@ type PublishedTrack interface { ID() string Kind() livekit.TrackInfo_Type StreamID() string + IsMuted() bool AddSubscriber(participant Participant) error RemoveSubscriber(participantId string) RemoveAllSubscribers() diff --git a/pkg/rtc/mediatrack.go b/pkg/rtc/mediatrack.go index 788a40407..cdc497158 100644 --- a/pkg/rtc/mediatrack.go +++ b/pkg/rtc/mediatrack.go @@ -27,6 +27,7 @@ type MediaTrack struct { ctx context.Context id string participantId string + muted bool // source remoteTrack remoteTrack *webrtc.TrackRemote // channel to send RTCP packets to the source @@ -82,11 +83,15 @@ func (t *MediaTrack) StreamID() string { return t.remoteTrack.StreamID() } +func (t *MediaTrack) IsMuted() bool { + return t.muted +} + // subscribes participant to current remoteTrack // creates and add necessary forwarders and starts them func (t *MediaTrack) AddSubscriber(participant Participant) error { codec := t.remoteTrack.Codec() - // pack ID to identify all tracks + // pack ID to identify all publishedTracks packedId := PackTrackId(t.participantId, t.id) // using DownTrack from ion-sfu @@ -191,6 +196,11 @@ func (t *MediaTrack) forwardRTPWorker() { "track", t.id) } + if t.muted { + // short circuit when track is muted + continue + } + //logger.GetLogger().Debugw("read packet from remoteTrack", // "participantId", t.participantId, // "remoteTrack", t.remoteTrack.ID()) diff --git a/pkg/rtc/participant.go b/pkg/rtc/participant.go index 217165c2b..c772ef89f 100644 --- a/pkg/rtc/participant.go +++ b/pkg/rtc/participant.go @@ -24,31 +24,29 @@ const ( ) type ParticipantImpl struct { - id string - peerConn PeerConnection - sigConn SignalConnection - ctx context.Context - cancel context.CancelFunc - mediaEngine *webrtc.MediaEngine - name string - state livekit.ParticipantInfo_State - bi *buffer.Interceptor - rtcpCh chan []rtcp.Packet - downTracks map[string][]*sfu.DownTrack + id string + peerConn PeerConnection + sigConn SignalConnection + ctx context.Context + cancel context.CancelFunc + mediaEngine *webrtc.MediaEngine + name string + state livekit.ParticipantInfo_State + bi *buffer.Interceptor + rtcpCh chan []rtcp.Packet + subscribedTracks map[string][]*sfu.DownTrack + publishedTracks map[string]PublishedTrack // publishedTracks that the peer is publishing - lock sync.RWMutex - tracks map[string]PublishedTrack // tracks that the peer is publishing - once sync.Once + lock sync.RWMutex + once sync.Once // callbacks & handlers - // onTrackPublished - remote peer added a remoteTrack onTrackPublished func(Participant, PublishedTrack) - // onOffer - offer is ready for remote peer - onOffer func(webrtc.SessionDescription) - // OnIceCandidate - ice candidate discovered for local peer - onICECandidate func(c *webrtc.ICECandidateInit) - onStateChange func(p Participant, oldState livekit.ParticipantInfo_State) - onClose func(Participant) + onTrackUpdated func(Participant, PublishedTrack) + onOffer func(webrtc.SessionDescription) + onICECandidate func(c *webrtc.ICECandidateInit) + onStateChange func(p Participant, oldState livekit.ParticipantInfo_State) + onClose func(Participant) } func NewPeerConnection(conf *WebRTCConfig) (*webrtc.PeerConnection, error) { @@ -68,19 +66,19 @@ func NewParticipant(pc PeerConnection, sc SignalConnection, name string) (*Parti ctx, cancel := context.WithCancel(context.Background()) participant := &ParticipantImpl{ - id: utils.NewGuid(utils.ParticipantPrefix), - name: name, - peerConn: pc, - sigConn: sc, - ctx: ctx, - cancel: cancel, - bi: bi, - rtcpCh: make(chan []rtcp.Packet, 10), - downTracks: make(map[string][]*sfu.DownTrack), - state: livekit.ParticipantInfo_JOINING, - lock: sync.RWMutex{}, - tracks: make(map[string]PublishedTrack, 0), - mediaEngine: me, + id: utils.NewGuid(utils.ParticipantPrefix), + name: name, + peerConn: pc, + sigConn: sc, + ctx: ctx, + cancel: cancel, + bi: bi, + rtcpCh: make(chan []rtcp.Packet, 10), + subscribedTracks: make(map[string][]*sfu.DownTrack), + state: livekit.ParticipantInfo_JOINING, + lock: sync.RWMutex{}, + publishedTracks: make(map[string]PublishedTrack, 0), + mediaEngine: me, } log := logger.GetLogger() @@ -141,7 +139,7 @@ func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo { State: p.state, } - for _, t := range p.tracks { + for _, t := range p.publishedTracks { info.Tracks = append(info.Tracks, ToProtoTrack(t)) } return info @@ -164,6 +162,10 @@ func (p *ParticipantImpl) OnStateChange(callback func(p Participant, oldState li p.onStateChange = callback } +func (p *ParticipantImpl) OnTrackUpdated(callback func(Participant, PublishedTrack)) { + p.onTrackUpdated = callback +} + func (p *ParticipantImpl) OnClose(callback func(Participant)) { p.onClose = callback } @@ -291,12 +293,12 @@ func (p *ParticipantImpl) Close() error { return p.peerConn.Close() } -// Subscribes otherPeer to all of the tracks +// Subscribes otherPeer to all of the publishedTracks func (p *ParticipantImpl) AddSubscriber(op Participant) error { p.lock.RLock() defer p.lock.RUnlock() - for _, track := range p.tracks { + for _, track := range p.publishedTracks { logger.GetLogger().Debugw("subscribing to remoteTrack", "srcParticipant", p.ID(), "dstParticipant", op.ID(), @@ -312,7 +314,7 @@ func (p *ParticipantImpl) RemoveSubscriber(participantId string) { p.lock.RLock() defer p.lock.RUnlock() - for _, track := range p.tracks { + for _, track := range p.publishedTracks { track.RemoveSubscriber(participantId) } } @@ -341,13 +343,33 @@ func (p *ParticipantImpl) SendParticipantUpdate(participants []*livekit.Particip }) } +func (p *ParticipantImpl) SetTrackMuted(trackId string, muted bool) { + p.lock.RLock() + defer p.lock.RUnlock() + track := p.publishedTracks[trackId] + if track == nil { + return + } + updated := false + + switch t := track.(type) { + case *MediaTrack: + updated = t.muted != muted + t.muted = muted + } + + if updated && p.onTrackUpdated != nil { + p.onTrackUpdated(p, track) + } +} + func (p *ParticipantImpl) PeerConnection() PeerConnection { return p.peerConn } func (p *ParticipantImpl) AddDownTrack(streamId string, dt *sfu.DownTrack) { p.lock.Lock() - p.downTracks[streamId] = append(p.downTracks[streamId], dt) + p.subscribedTracks[streamId] = append(p.subscribedTracks[streamId], dt) p.lock.Unlock() dt.OnBind(func() { go p.scheduleDownTrackBindingReports(streamId) @@ -357,14 +379,14 @@ func (p *ParticipantImpl) AddDownTrack(streamId string, dt *sfu.DownTrack) { func (p *ParticipantImpl) RemoveDownTrack(streamId string, dt *sfu.DownTrack) { p.lock.Lock() defer p.lock.Unlock() - tracks := p.downTracks[streamId] + tracks := p.subscribedTracks[streamId] newTracks := make([]*sfu.DownTrack, 0, len(tracks)) for _, track := range tracks { if track != dt { newTracks = append(newTracks, track) } } - p.downTracks[streamId] = newTracks + p.subscribedTracks[streamId] = newTracks } func (p *ParticipantImpl) updateState(state livekit.ParticipantInfo_State) { @@ -400,7 +422,7 @@ func (p *ParticipantImpl) onDataChannel(dc *webrtc.DataChannel) { dt := NewDataTrack(p.id, dc) p.lock.Lock() - p.tracks[dt.id] = dt + p.publishedTracks[dt.id] = dt p.lock.Unlock() dt.Start() @@ -410,7 +432,7 @@ func (p *ParticipantImpl) onDataChannel(dc *webrtc.DataChannel) { func (p *ParticipantImpl) handleTrackPublished(track PublishedTrack) { p.lock.Lock() - p.tracks[track.ID()] = track + p.publishedTracks[track.ID()] = track p.lock.Unlock() track.Start() @@ -430,7 +452,7 @@ func (p *ParticipantImpl) scheduleDownTrackBindingReports(streamId string) { var sd []rtcp.SourceDescriptionChunk p.lock.RLock() - dts := p.downTracks[streamId] + dts := p.subscribedTracks[streamId] for _, dt := range dts { if !dt.IsBound() { continue @@ -465,7 +487,7 @@ func (p *ParticipantImpl) scheduleDownTrackBindingReports(streamId string) { } // downTracksRTCPWorker sends SenderReports periodically when the participant is subscribed to -// other tracks in the room. +// other publishedTracks in the room. func (p *ParticipantImpl) downTracksRTCPWorker() { for { time.Sleep(5 * time.Second) @@ -473,7 +495,7 @@ func (p *ParticipantImpl) downTracksRTCPWorker() { var pkts []rtcp.Packet var sd []rtcp.SourceDescriptionChunk p.lock.RLock() - for _, dts := range p.downTracks { + for _, dts := range p.subscribedTracks { for _, dt := range dts { if !dt.IsBound() { continue diff --git a/pkg/rtc/room.go b/pkg/rtc/room.go index 85514ad8f..800fba600 100644 --- a/pkg/rtc/room.go +++ b/pkg/rtc/room.go @@ -64,14 +64,14 @@ func (r *Room) Join(participant Participant) error { log := logger.GetLogger() - // it's important to set this before connection, we don't want to miss out on any tracks + // it's important to set this before connection, we don't want to miss out on any publishedTracks participant.OnTrackPublished(r.onTrackAdded) participant.OnStateChange(func(p Participant, oldState livekit.ParticipantInfo_State) { log.Debugw("participant state changed", "state", p.State(), "participant", p.ID()) r.broadcastParticipantState(p) if oldState == livekit.ParticipantInfo_JOINING && p.State() == livekit.ParticipantInfo_JOINED { - // subscribe participant to existing tracks + // subscribe participant to existing publishedTracks for _, op := range r.participants { if p.ID() == op.ID() { // don't send to itself @@ -152,6 +152,10 @@ func (r *Room) onTrackAdded(participant Participant, track PublishedTrack) { } } +func (r *Room) onTrackMuted(p Participant, track PublishedTrack) { + r.broadcastParticipantState(p) +} + func (r *Room) broadcastParticipantState(p Participant) { r.lock.RLock() defer r.lock.RUnlock() diff --git a/pkg/rtc/utils.go b/pkg/rtc/utils.go index 1e7463b9a..df36e18dd 100644 --- a/pkg/rtc/utils.go +++ b/pkg/rtc/utils.go @@ -89,9 +89,10 @@ func FromProtoTrickle(trickle *livekit.Trickle) webrtc.ICECandidateInit { func ToProtoTrack(t PublishedTrack) *livekit.TrackInfo { return &livekit.TrackInfo{ - Sid: t.ID(), - Type: t.Kind(), - Name: t.StreamID(), + Sid: t.ID(), + Type: t.Kind(), + Name: t.StreamID(), + Muted: t.IsMuted(), } } diff --git a/pkg/service/rtc.go b/pkg/service/rtc.go index 1bfd9d2de..83d8ba809 100644 --- a/pkg/service/rtc.go +++ b/pkg/service/rtc.go @@ -158,6 +158,8 @@ func (s *RTCService) ServeHTTP(w http.ResponseWriter, r *http.Request) { // jsonError(http.StatusInternalServerError, "could not handle trickle", err.Error())) return } + case *livekit.SignalRequest_Mute: + participant.SetTrackMuted(msg.Mute.TrackSid, msg.Mute.Muted) } } diff --git a/proto/livekit/model.pb.go b/proto/livekit/model.pb.go index a7a10424f..a31064827 100644 --- a/proto/livekit/model.pb.go +++ b/proto/livekit/model.pb.go @@ -484,9 +484,10 @@ type TrackInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` - Type TrackInfo_Type `protobuf:"varint,2,opt,name=type,proto3,enum=livekit.TrackInfo_Type" json:"type,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Sid string `protobuf:"bytes,1,opt,name=sid,proto3" json:"sid,omitempty"` + Type TrackInfo_Type `protobuf:"varint,2,opt,name=type,proto3,enum=livekit.TrackInfo_Type" json:"type,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Muted bool `protobuf:"varint,4,opt,name=muted,proto3" json:"muted,omitempty"` } func (x *TrackInfo) Reset() { @@ -542,6 +543,13 @@ func (x *TrackInfo) GetName() string { return "" } +func (x *TrackInfo) GetMuted() bool { + if x != nil { + return x.Muted + } + return false +} + type DataMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -668,24 +676,25 @@ var file_model_proto_rawDesc = []byte{ 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x4a, 0x4f, 0x49, 0x4e, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4a, 0x4f, 0x49, 0x4e, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, - 0x44, 0x49, 0x53, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, 0x86, + 0x44, 0x49, 0x53, 0x43, 0x4f, 0x4e, 0x4e, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x22, 0x9c, 0x01, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, - 0x26, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, - 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x44, 0x45, 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, - 0x04, 0x44, 0x41, 0x54, 0x41, 0x10, 0x02, 0x22, 0x46, 0x0a, 0x0b, 0x44, 0x61, 0x74, 0x61, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x04, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, 0x78, 0x74, 0x12, 0x18, 0x0a, 0x06, - 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, - 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, - 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, + 0x6d, 0x75, 0x74, 0x65, 0x64, 0x22, 0x26, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, + 0x05, 0x41, 0x55, 0x44, 0x49, 0x4f, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x44, 0x45, + 0x4f, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x41, 0x10, 0x02, 0x22, 0x46, 0x0a, + 0x0b, 0x44, 0x61, 0x74, 0x61, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x04, + 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x74, 0x65, + 0x78, 0x74, 0x12, 0x18, 0x0a, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0c, 0x48, 0x00, 0x52, 0x06, 0x62, 0x69, 0x6e, 0x61, 0x72, 0x79, 0x42, 0x07, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, + 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/livekit/rtc.pb.go b/proto/livekit/rtc.pb.go index 8ad6a69ba..6b0af4a13 100644 --- a/proto/livekit/rtc.pb.go +++ b/proto/livekit/rtc.pb.go @@ -34,7 +34,7 @@ type SignalRequest struct { // *SignalRequest_Offer // *SignalRequest_Negotiate // *SignalRequest_Trickle - // *SignalRequest_Control + // *SignalRequest_Mute Message isSignalRequest_Message `protobuf_oneof:"message"` } @@ -98,9 +98,9 @@ func (x *SignalRequest) GetTrickle() *Trickle { return nil } -func (x *SignalRequest) GetControl() *MediaControl { - if x, ok := x.GetMessage().(*SignalRequest_Control); ok { - return x.Control +func (x *SignalRequest) GetMute() *MuteTrack { + if x, ok := x.GetMessage().(*SignalRequest_Mute); ok { + return x.Mute } return nil } @@ -121,8 +121,8 @@ type SignalRequest_Trickle struct { Trickle *Trickle `protobuf:"bytes,3,opt,name=trickle,proto3,oneof"` } -type SignalRequest_Control struct { - Control *MediaControl `protobuf:"bytes,4,opt,name=control,proto3,oneof"` +type SignalRequest_Mute struct { + Mute *MuteTrack `protobuf:"bytes,4,opt,name=mute,proto3,oneof"` } func (*SignalRequest_Offer) isSignalRequest_Message() {} @@ -131,7 +131,7 @@ func (*SignalRequest_Negotiate) isSignalRequest_Message() {} func (*SignalRequest_Trickle) isSignalRequest_Message() {} -func (*SignalRequest_Control) isSignalRequest_Message() {} +func (*SignalRequest_Mute) isSignalRequest_Message() {} type SignalResponse struct { state protoimpl.MessageState @@ -440,14 +440,17 @@ func (x *JoinResponse) GetOtherParticipants() []*ParticipantInfo { return nil } -type MediaControl struct { +type MuteTrack struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + + TrackSid string `protobuf:"bytes,1,opt,name=track_sid,json=trackSid,proto3" json:"track_sid,omitempty"` + Muted bool `protobuf:"varint,2,opt,name=muted,proto3" json:"muted,omitempty"` } -func (x *MediaControl) Reset() { - *x = MediaControl{} +func (x *MuteTrack) Reset() { + *x = MuteTrack{} if protoimpl.UnsafeEnabled { mi := &file_rtc_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -455,13 +458,13 @@ func (x *MediaControl) Reset() { } } -func (x *MediaControl) String() string { +func (x *MuteTrack) String() string { return protoimpl.X.MessageStringOf(x) } -func (*MediaControl) ProtoMessage() {} +func (*MuteTrack) ProtoMessage() {} -func (x *MediaControl) ProtoReflect() protoreflect.Message { +func (x *MuteTrack) ProtoReflect() protoreflect.Message { mi := &file_rtc_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -473,11 +476,25 @@ func (x *MediaControl) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use MediaControl.ProtoReflect.Descriptor instead. -func (*MediaControl) Descriptor() ([]byte, []int) { +// Deprecated: Use MuteTrack.ProtoReflect.Descriptor instead. +func (*MuteTrack) Descriptor() ([]byte, []int) { return file_rtc_proto_rawDescGZIP(), []int{5} } +func (x *MuteTrack) GetTrackSid() string { + if x != nil { + return x.TrackSid + } + return "" +} + +func (x *MuteTrack) GetMuted() bool { + if x != nil { + return x.Muted + } + return false +} + type ParticipantUpdate struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -530,7 +547,7 @@ var File_rtc_proto protoreflect.FileDescriptor var file_rtc_proto_rawDesc = []byte{ 0x0a, 0x09, 0x72, 0x74, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x1a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xed, 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x6f, 0x22, 0xe4, 0x01, 0x0a, 0x0d, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x33, 0x0a, 0x05, 0x6f, 0x66, 0x66, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, @@ -541,61 +558,64 @@ var file_rtc_proto_rawDesc = []byte{ 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, 0x63, - 0x6b, 0x6c, 0x65, 0x12, 0x31, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d, - 0x65, 0x64, 0x69, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x48, 0x00, 0x52, 0x07, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x22, 0xde, 0x02, 0x0a, 0x0e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4a, 0x6f, 0x69, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69, - 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, - 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x09, 0x6e, 0x65, 0x67, 0x6f, - 0x74, 0x69, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x09, 0x6e, 0x65, 0x67, 0x6f, - 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, - 0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, 0x63, - 0x6b, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, - 0x00, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0e, 0x74, 0x72, 0x61, - 0x63, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, - 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x09, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0x2f, 0x0a, 0x07, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x24, 0x0a, - 0x0d, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, - 0x6e, 0x69, 0x74, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, - 0x03, 0x73, 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x73, 0x64, 0x70, 0x22, - 0xba, 0x01, 0x0a, 0x0c, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x3a, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, - 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, - 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, - 0x61, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, - 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, - 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x0e, 0x0a, 0x0c, - 0x4d, 0x65, 0x64, 0x69, 0x61, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x51, 0x0a, 0x11, - 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, - 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, - 0x6f, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, - 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, - 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, - 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6b, 0x6c, 0x65, 0x12, 0x28, 0x0a, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x4d, 0x75, 0x74, 0x65, + 0x54, 0x72, 0x61, 0x63, 0x6b, 0x48, 0x00, 0x52, 0x04, 0x6d, 0x75, 0x74, 0x65, 0x42, 0x09, 0x0a, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xde, 0x02, 0x0a, 0x0e, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2b, 0x0a, 0x04, 0x6a, + 0x6f, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6c, 0x69, 0x76, 0x65, + 0x6b, 0x69, 0x74, 0x2e, 0x4a, 0x6f, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x48, 0x00, 0x52, 0x04, 0x6a, 0x6f, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x61, 0x6e, 0x73, 0x77, + 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, + 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x00, 0x52, 0x06, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, + 0x3b, 0x0a, 0x09, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x48, + 0x00, 0x52, 0x09, 0x6e, 0x65, 0x67, 0x6f, 0x74, 0x69, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x07, + 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x10, 0x2e, + 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x54, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x48, + 0x00, 0x52, 0x07, 0x74, 0x72, 0x69, 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6c, 0x69, 0x76, + 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x48, 0x00, 0x52, 0x06, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x12, 0x3c, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, + 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, + 0x69, 0x74, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x48, 0x00, 0x52, 0x0e, + 0x74, 0x72, 0x61, 0x63, 0x6b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x09, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2f, 0x0a, 0x07, 0x54, 0x72, 0x69, + 0x63, 0x6b, 0x6c, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x63, 0x61, 0x6e, 0x64, 0x69, 0x64, 0x61, 0x74, + 0x65, 0x49, 0x6e, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x61, 0x6e, + 0x64, 0x69, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x22, 0x3a, 0x0a, 0x12, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x64, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x03, 0x73, 0x64, 0x70, 0x22, 0xba, 0x01, 0x0a, 0x0c, 0x4a, 0x6f, 0x69, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, + 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, 0x3a, + 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x12, 0x6f, 0x74, + 0x68, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, + 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x11, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x73, 0x22, 0x3e, 0x0a, 0x09, 0x4d, 0x75, 0x74, 0x65, 0x54, 0x72, 0x61, 0x63, 0x6b, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x5f, 0x73, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x72, 0x61, 0x63, 0x6b, 0x53, 0x69, 0x64, 0x12, 0x14, 0x0a, + 0x05, 0x6d, 0x75, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x6d, 0x75, + 0x74, 0x65, 0x64, 0x22, 0x51, 0x0a, 0x11, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, + 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, + 0x2e, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, + 0x70, 0x61, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, + 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x2f, 0x6c, 0x69, 0x76, + 0x65, 0x6b, 0x69, 0x74, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x6c, 0x69, 0x76, 0x65, 0x6b, 0x69, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -617,7 +637,7 @@ var file_rtc_proto_goTypes = []interface{}{ (*Trickle)(nil), // 2: livekit.Trickle (*SessionDescription)(nil), // 3: livekit.SessionDescription (*JoinResponse)(nil), // 4: livekit.JoinResponse - (*MediaControl)(nil), // 5: livekit.MediaControl + (*MuteTrack)(nil), // 5: livekit.MuteTrack (*ParticipantUpdate)(nil), // 6: livekit.ParticipantUpdate (*TrackInfo)(nil), // 7: livekit.TrackInfo (*RoomInfo)(nil), // 8: livekit.RoomInfo @@ -627,7 +647,7 @@ var file_rtc_proto_depIdxs = []int32{ 3, // 0: livekit.SignalRequest.offer:type_name -> livekit.SessionDescription 3, // 1: livekit.SignalRequest.negotiate:type_name -> livekit.SessionDescription 2, // 2: livekit.SignalRequest.trickle:type_name -> livekit.Trickle - 5, // 3: livekit.SignalRequest.control:type_name -> livekit.MediaControl + 5, // 3: livekit.SignalRequest.mute:type_name -> livekit.MuteTrack 4, // 4: livekit.SignalResponse.join:type_name -> livekit.JoinResponse 3, // 5: livekit.SignalResponse.answer:type_name -> livekit.SessionDescription 3, // 6: livekit.SignalResponse.negotiate:type_name -> livekit.SessionDescription @@ -713,7 +733,7 @@ func file_rtc_proto_init() { } } file_rtc_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaControl); i { + switch v := v.(*MuteTrack); i { case 0: return &v.state case 1: @@ -741,7 +761,7 @@ func file_rtc_proto_init() { (*SignalRequest_Offer)(nil), (*SignalRequest_Negotiate)(nil), (*SignalRequest_Trickle)(nil), - (*SignalRequest_Control)(nil), + (*SignalRequest_Mute)(nil), } file_rtc_proto_msgTypes[1].OneofWrappers = []interface{}{ (*SignalResponse_Join)(nil), diff --git a/proto/model.proto b/proto/model.proto index 452246933..5f7628a58 100644 --- a/proto/model.proto +++ b/proto/model.proto @@ -58,6 +58,7 @@ message TrackInfo { string sid = 1; Type type = 2; string name = 3; + bool muted = 4; } message DataMessage { diff --git a/proto/rtc.proto b/proto/rtc.proto index ab384fd2a..263f3be20 100644 --- a/proto/rtc.proto +++ b/proto/rtc.proto @@ -10,7 +10,7 @@ message SignalRequest { SessionDescription offer = 1; SessionDescription negotiate = 2; Trickle trickle = 3; - MediaControl control = 4; + MuteTrack mute = 4; } } @@ -37,8 +37,8 @@ message Trickle { } message SessionDescription { - string type = 1; // "answer" | "offer" | "pranswer" | "rollback" - string sdp = 2; + string type = 1; // "answer" | "offer" | "pranswer" | "rollback" + string sdp = 2; } message JoinResponse { @@ -47,8 +47,9 @@ message JoinResponse { repeated ParticipantInfo other_participants = 3; } -message MediaControl { - +message MuteTrack { + string track_sid = 1; + bool muted = 2; } message ParticipantUpdate {