Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions localtrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/pion/webrtc/v4/pkg/media"
"go.uber.org/atomic"

protoCodecs "github.com/livekit/protocol/codecs"
"github.com/livekit/protocol/livekit"
protoLogger "github.com/livekit/protocol/logger"
"github.com/livekit/protocol/utils/guid"
Expand Down Expand Up @@ -141,6 +142,14 @@ func NewLocalSampleTrack(c webrtc.RTPCodecCapability, opts ...LocalTrackOptions)
return NewLocalTrack(c, opts...)
}

func NewLocalTrackWithCodec(c *livekit.Codec, opts ...LocalTrackOptions) (*LocalTrack, error) {
return NewLocalTrack(protoCodecs.ToWebrtcCodecParameters(c).RTPCodecCapability, opts...)
}

func NewLocalSampleTrackWithCodec(c *livekit.Codec, opts ...LocalTrackOptions) (*LocalTrack, error) {
return NewLocalTrack(protoCodecs.ToWebrtcCodecParameters(c).RTPCodecCapability, opts...)
}

// SetLogger overrides default logger for this track.
func (s *LocalTrack) SetLogger(l protoLogger.Logger) {
s.log = l
Expand Down
Loading