Skip to content

Commit

Permalink
fix streamer session
Browse files Browse the repository at this point in the history
Former-commit-id: b2ae94b3105d16d6f253d99547e4cd56a1bdb1ea [formerly a84bab8ca45798c358665cc0e7c6cd916bbf483d] [formerly 1f1b42e680cd0c2dc4b8ef93901af25e377b07f6 [formerly 635d028]]
Former-commit-id: 14f5860026a3d9e8b1ee8b884a087808ecffa6b0 [formerly aa535fe0376bce9649be0a3961e238cf62f0964b]
Former-commit-id: 2cdd6f97567c6e9f7b93cada6dce076f964040e7
  • Loading branch information
notedit committed Jun 30, 2019
1 parent d595e12 commit 0a4cbda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 54 deletions.
48 changes: 0 additions & 48 deletions streamer.go

This file was deleted.

16 changes: 10 additions & 6 deletions streamersession.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,14 @@ type StreamerSession struct {
}

// NewStreamerSession new StreamerSession
func NewStreamerSession(local bool, ip string, port int, media *sdp.MediaInfo) *StreamerSession {
func NewStreamerSession(media *sdp.MediaInfo) *StreamerSession {

streamerSession := &StreamerSession{}
var mediaType native.MediaFrameType = 0
if strings.ToLower(media.GetType()) == "video" {
mediaType = 1
}
session := native.NewRTPSessionFacade(mediaType)
if local {
session.SetLocalPort(port)
} else {
session.SetRemotePort(ip, port)
}

streamerSession.id = uuid.Must(uuid.NewV4()).String()

Expand Down Expand Up @@ -75,6 +70,15 @@ func (s *StreamerSession) GetID() string {
return s.id
}

func (s *StreamerSession) SetLocalPort(port int) {

s.session.SetLocalPort(port)
}

func (s *StreamerSession) SetRemotePort(ip string, port int) {
s.session.SetRemotePort(ip, port)
}

// GetIncomingStreamTrack get asso incoming track,
func (s *StreamerSession) GetIncomingStreamTrack() *IncomingStreamTrack {
return s.incoming
Expand Down

0 comments on commit 0a4cbda

Please sign in to comment.