Bug 1607205 - Reset RtcpEventObserver when deleting channels; r=ng

Holding a RefPtr to this in OnRtcpBye should keep the VideoConduit alive until
the callback completes. If this is not happening, it is likely that we're
racing with the destructor on the other thread. Clearing the callback early
will prevent this. This should not affect the VideoConduit because in that case
the callback is directly part of the receive stream, not attached to a channel.

Differential Revision: https://phabricator.services.mozilla.com/D60658

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dan Minor 2020-01-24 19:55:13 +00:00
Родитель 307e4dcb5b
Коммит e5395de882
3 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -36,6 +36,8 @@ class MockChannelProxy : public webrtc::voe::ChannelProxy {
void RegisterTransport(Transport* transport) override {} void RegisterTransport(Transport* transport) override {}
void SetRtcpEventObserver(webrtc::RtcpEventObserver* observer) override {}
bool mSetSendAudioLevelIndicationStatusEnabled; bool mSetSendAudioLevelIndicationStatusEnabled;
bool mSetReceiveAudioLevelIndicationStatusEnabled; bool mSetReceiveAudioLevelIndicationStatusEnabled;
bool mSetReceiveCsrcAudioLevelIndicationStatusEnabled; bool mSetReceiveCsrcAudioLevelIndicationStatusEnabled;

Просмотреть файл

@ -1134,6 +1134,7 @@ void WebrtcAudioConduit::DeleteChannels() {
} }
if (mRecvChannel != -1) { if (mRecvChannel != -1) {
mRecvChannelProxy->SetRtcpEventObserver(nullptr);
mRecvChannelProxy = nullptr; mRecvChannelProxy = nullptr;
mPtrVoEBase->DeleteChannel(mRecvChannel); mPtrVoEBase->DeleteChannel(mRecvChannel);
mRecvChannel = -1; mRecvChannel = -1;

Просмотреть файл

@ -137,7 +137,7 @@ class ChannelProxy : public RtpPacketSinkInterface {
virtual std::vector<webrtc::RtpSource> GetSources() const; virtual std::vector<webrtc::RtpSource> GetSources() const;
virtual void SetRtpPacketObserver(RtpPacketObserver* observer); virtual void SetRtpPacketObserver(RtpPacketObserver* observer);
void SetRtcpEventObserver(RtcpEventObserver* observer); virtual void SetRtcpEventObserver(RtcpEventObserver* observer);
private: private:
Channel* channel() const; Channel* channel() const;