Fix LocalTrack interfacing

This commit is contained in:
Atsushi Watanabe
2020-02-14 22:28:27 +09:00
committed by Lukas Herman
parent ad62a6a461
commit 6b32f6eac2
2 changed files with 11 additions and 4 deletions
+7
View File
@@ -17,6 +17,7 @@ import (
// Reference: https://w3c.github.io/mediacapture-main/#mediastreamtrack
type Tracker interface {
Track() *webrtc.Track
LocalTrack() LocalTrack
Stop()
OnEnded(func(error))
}
@@ -24,6 +25,8 @@ type Tracker interface {
type LocalTrack interface {
WriteSample(s media.Sample) error
Codec() *webrtc.RTPCodec
ID() string
Kind() webrtc.RTPCodecType
}
type track struct {
@@ -77,6 +80,10 @@ func (t *track) Track() *webrtc.Track {
return t.t.(*webrtc.Track)
}
func (t *track) LocalTrack() LocalTrack {
return t.t
}
type videoTrack struct {
*track
d driver.Driver