Skip to content

Commit

Permalink
fix stop callback
Browse files Browse the repository at this point in the history
Former-commit-id: 1e159e7a215c34b405791d7c588483d25418a1f6 [formerly 986f82c81f5886e3abb8aa8f43c859cc35f66806] [formerly 8c56721f9d3f551f8401e32aa720053a1f9a5514 [formerly 5dedd0d]]
Former-commit-id: 0d9e6906e636faaa846fc74b1948c2ca378ce501 [formerly 68d75e76fef104095b21493ea33fc412f7a3ec32]
Former-commit-id: 188a2965810b407f79c9c56f8a63a71e0d8207ba
  • Loading branch information
notedit committed Jan 1, 2020
1 parent f3db512 commit 4deb669
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 19 deletions.
6 changes: 0 additions & 6 deletions emulatedtransport.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ func (e *EmulatedTransport) CreateIncomingStream(streamInfo *sdp.StreamInfo) *In
e.streams[incomingStream.GetID()] = incomingStream
e.Unlock()

incomingStream.OnStop(func() {
e.Lock()
delete(e.streams, incomingStream.GetID())
e.Unlock()
})

incomingStream.OnTrack(func(track *IncomingStreamTrack) {
for _, addTrackFunc := range e.onIncomingTrackListeners {
addTrackFunc(track, incomingStream)
Expand Down
12 changes: 6 additions & 6 deletions sdpmanagerplanb.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ func (s *SDPManagerPlanb) ProcessRemoteDescription(sdpStr string) (*sdp.SDPInfo,
s.transport.SetLocalProperties(s.localInfo.GetAudioMedia(), s.localInfo.GetVideoMedia())
s.transport.SetRemoteProperties(s.remoteInfo.GetAudioMedia(), s.remoteInfo.GetVideoMedia())

s.transport.OnOutgoingTrack(func(track *OutgoingStreamTrack, stream *OutgoingStream) {
track.OnStop(func() {
s.renegotiate()
})
s.renegotiate()
})
// s.transport.OnOutgoingTrack(func(track *OutgoingStreamTrack, stream *OutgoingStream) {
// track.OnStop(func() {
// s.renegotiate()
// })
// s.renegotiate()
// })

}

Expand Down
8 changes: 4 additions & 4 deletions sdpmanagerunified.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ func (s *SDPManagerUnified) ProcessRemoteDescription(sdpStr string) (*sdp.SDPInf
stream: stream,
})

track.OnStop(func() {
s.removed = append(s.removed, track)
s.renegotiate()
})
// track.OnStop(func() {
// s.removed = append(s.removed, track)
// s.renegotiate()
// })

s.renegotiate()
})
Expand Down
6 changes: 3 additions & 3 deletions wrapper/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package native

/*
#cgo CXXFLAGS: -std=c++1z
#cgo CPPFLAGS: -I/usr/local/include
#cgo CPPFLAGS: -I/var/opt/include
#cgo CPPFLAGS: -I${SRCDIR}/../include/crc32c/include/
#cgo CPPFLAGS: -I${SRCDIR}/../include/libdatachannels/
#cgo CPPFLAGS: -I${SRCDIR}/../include/libdatachannels/internal/
#cgo CPPFLAGS: -I${SRCDIR}/../include/media-server/include/
#cgo CPPFLAGS: -I${SRCDIR}/../include/media-server/src/
#cgo LDFLAGS: -L/usr/local/lib -lmediaserver -lssl -lcrypto -lsrtp2
#cgo LDFLAGS: /usr/local/lib/libmp4v2.a
#cgo LDFLAGS: -L/var/opt/lib -lmediaserver -lssl -lcrypto -lsrtp2
#cgo LDFLAGS: /var/opt/lib/libmp4v2.a
#cgo LDFLAGS: -ldl
*/
import "C"

0 comments on commit 4deb669

Please sign in to comment.