mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
muxed peer.WriteData
This commit is contained in:
parent
0d86073f7e
commit
3fc7737442
@ -1,6 +1,8 @@
|
|||||||
package webrtc
|
package webrtc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"sync"
|
||||||
|
|
||||||
"github.com/pion/webrtc/v2"
|
"github.com/pion/webrtc/v2"
|
||||||
"github.com/pion/webrtc/v2/pkg/media"
|
"github.com/pion/webrtc/v2/pkg/media"
|
||||||
"n.eko.moe/neko/internal/types"
|
"n.eko.moe/neko/internal/types"
|
||||||
@ -13,6 +15,7 @@ type Peer struct {
|
|||||||
video *webrtc.Track
|
video *webrtc.Track
|
||||||
audio *webrtc.Track
|
audio *webrtc.Track
|
||||||
connection *webrtc.PeerConnection
|
connection *webrtc.PeerConnection
|
||||||
|
mu sync.Mutex
|
||||||
}
|
}
|
||||||
|
|
||||||
func (peer *Peer) WriteAudioSample(sample types.Sample) error {
|
func (peer *Peer) WriteAudioSample(sample types.Sample) error {
|
||||||
@ -30,6 +33,8 @@ func (peer *Peer) WriteVideoSample(sample types.Sample) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (peer *Peer) WriteData(v interface{}) error {
|
func (peer *Peer) WriteData(v interface{}) error {
|
||||||
|
peer.mu.Lock()
|
||||||
|
defer peer.mu.Unlock()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user