SetOutputScaling to left=0 right=0 for channel 0 and ssrc 826111343
SetRenderer 983245153 reuse default channel #0
Segmentation fault (core dumped)void Conductor::DeletePeerConnection()
{
peer_connection_ = NULL;
active_streams_.clear();
main_wnd_ -> StopLocalRenderer();
main_wnd_ -> StopRemoteRenderer();
peer_connection_factory_ = NULL;
peer_id_ = -1;
}
talk_base::scoped_refptr<webrtc::MediaStreamInterface> stream = peer_connection_factory_ -> CreateLocalMediaStream(kStreamLabel);
stream -> AddTrack(audio_track);
stream -> AddTrack(video_track);
if (!peer_connection_ -> AddStream(stream, NULL))
{
LOG(LS_ERROR) << "Adding stream to PeerConnection failed";
}
typedef std::pair<std::string, talk_base::scoped_refptr<webrtc::MediaStreamInterface> > MediaStreamPair;
active_streams_.insert(MediaStreamPair(stream -> label(), stream));//Delete all peer connections and stop all remote rendering
_peer_connection->Close();
_peer_connection->local_streams()->Release();
_mainWindow->StopLocalRenderer();
_peer_connection->remote_streams()->Release();
_mainWindow->StopRemoteRenderer();
_peer_connection_factory = NULL;Warning(webrtcvideoengine.cc:1392): webrtc: GetSendRtcpStatistics: Could not get remote stats
Session:5332449234890083664 Old state:STATE_INPROGRESS New state:STATE_RECEIVEDTERMINATE Type:urn:xmpp:jingle:apps:rtp:1 Transport:http://www.google.com/transport/p2p
Conductor| state Changed
Channel disabled
Stopping playout for channel #0
Clearing option overrides.
Changing voice state, recv=0 send=0
Destroyed channel
Channel disabled
Changing video state, recv=0 send=0
Warning(webrtcvideoengine.cc:1392): webrtc: Stop: Not running
Removing video stream 0 with VideoEngine channel #0
Destroyed channel
Destroy Video Renderer
Destroy Video Renderer
// Check Peer Connection if(peer_connection_.get()) { peer_connection_->Close(); } // Check Data if(data_channel_.get() && recording_data_) { if(data_observer_) { data_channel_->UnregisterObserver(); data_observer_->~DataObserver(); } data_channel_->Close(); }
// Check Video if(remote_renderer_.get() && recording_video_) { this->StopRecord(); remote_renderer_->~VideoRenderer(); } rendered_track_->RemoveRenderer(this); ::DeleteCriticalSection(&buffer_lock_);As you say you set the peer_connection_ to point to the newly created peer_connection (created with the old factory). As the peer_connection is a ref_ptr, the "=" operator will first delete the object and then set to the one given (eg: A = B; is in fact "A = NULL; A = B;"). So I don't think you need to be afraid of memory leak but it doesn't really solve my problem.I am also curious to know when are you effectively deleting the peer_connection? If you want to close your project properly, shouldn't you do it?
Destroyed channelError(webrtcsession.cc:813): SetAudioPlayout: No audio channel exists.Warning(webrtcsession.cc:878): SetVideoPlayout: No video channel exists.RemoteVideoCapturer::StopError(webrtcsession.cc:834): SetAudioSend: No audio channel exists.Warning(webrtcsession.cc:860): Video not used in this call.Warning(webrtcsession.cc:893): SetVideoSend: No video channel exists.void MediaStreamHandlerContainer::TearDown()
{
for (StreamHandlerList::iterator it = remote_streams_handlers_.begin(); it != remote_streams_handlers_.end(); ++it)
{
(*it)->Stop();
// delete *it;
}
remote_streams_handlers_.clear();
for (StreamHandlerList::iterator it = local_streams_handlers_.begin(); it != local_streams_handlers_.end(); ++it)
{
(*it)->Stop();
delete *it;
}
local_streams_handlers_.clear();
}CaptureManager::~CaptureManager()
{
// Since we don't own any of the capturers, all capturers should have been
// cleaned up before we get here. In fact, in the normal shutdown sequence,
// all capturers *will* be shut down by now, so trying to stop them here
// will crash. If we're still tracking any, it's a dangling pointer.
if (!capture_states_.empty())
{
// ASSERT(false && "CaptureManager destructing while still tracking capturers!");
// Delete remaining VideoCapturerStates, but don't touch the capturers.
do {
CaptureStates::iterator it = capture_states_.begin();
delete it->second;
capture_states_.erase(it);
} while (!capture_states_.empty());
}
}