зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1414829
- Add DeleteStreams to media conduits; r=jesup
--HG-- extra : rebase_source : 844dee67cc4fc20ceff0798e83eeb3dd644c0dfa
This commit is contained in:
Родитель
3b3999ddad
Коммит
2d986887a5
|
@ -540,6 +540,8 @@ class TransportConduitTest : public ::testing::Test
|
|||
|
||||
err = videoSession->ConfigureSendMediaCodec(nullptr);
|
||||
EXPECT_TRUE(err != mozilla::kMediaConduitNoError);
|
||||
|
||||
videoSession->DeleteStreams();
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -169,6 +169,8 @@ public:
|
|||
virtual uint64_t CodecPluginID() override { return 0; }
|
||||
virtual void SetPCHandle(const std::string& aPCHandle) override {}
|
||||
|
||||
virtual void DeleteStreams() override {}
|
||||
|
||||
explicit WebrtcAudioConduit():
|
||||
mVoiceEngine(nullptr),
|
||||
mTransportMonitor("WebrtcAudioConduit"),
|
||||
|
|
|
@ -284,6 +284,8 @@ public:
|
|||
|
||||
virtual void SetPCHandle(const std::string& aPCHandle) = 0;
|
||||
|
||||
virtual void DeleteStreams() = 0;
|
||||
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaSessionConduit)
|
||||
|
||||
};
|
||||
|
|
|
@ -318,7 +318,7 @@ WebrtcVideoConduit::~WebrtcVideoConduit()
|
|||
|
||||
// Release AudioConduit first by dropping reference on MainThread, where it expects to be
|
||||
SyncTo(nullptr);
|
||||
Destroy();
|
||||
MOZ_ASSERT(!mSendStream && !mRecvStream, "Call DeleteStreams prior to ~WebrtcVideoConduit.");
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1193,7 +1193,7 @@ WebrtcVideoConduit::Init()
|
|||
}
|
||||
|
||||
void
|
||||
WebrtcVideoConduit::Destroy()
|
||||
WebrtcVideoConduit::DeleteStreams()
|
||||
{
|
||||
// We can't delete the VideoEngine until all these are released!
|
||||
// And we can't use a Scoped ptr, since the order is arbitrary
|
||||
|
|
|
@ -256,6 +256,8 @@ public:
|
|||
mPCHandle = aPCHandle;
|
||||
}
|
||||
|
||||
virtual void DeleteStreams() override;
|
||||
|
||||
unsigned int SendingMaxFs() override {
|
||||
if(mCurSendCodecConfig) {
|
||||
return mCurSendCodecConfig->mEncodingConstraints.maxFs;
|
||||
|
@ -292,7 +294,6 @@ public:
|
|||
|
||||
MediaConduitErrorCode InitMain();
|
||||
virtual MediaConduitErrorCode Init();
|
||||
virtual void Destroy();
|
||||
|
||||
std::vector<unsigned int> GetLocalSSRCs() const override;
|
||||
bool SetLocalSSRCs(const std::vector<unsigned int> & ssrcs) override;
|
||||
|
|
|
@ -120,6 +120,9 @@ TransceiverImpl::Shutdown_m()
|
|||
mReceivePipeline = nullptr;
|
||||
mTransmitPipeline = nullptr;
|
||||
mSendTrack = nullptr;
|
||||
if (mConduit) {
|
||||
mConduit->DeleteStreams();
|
||||
}
|
||||
mConduit = nullptr;
|
||||
RUN_ON_THREAD(mStsThread, WrapRelease(mRtpFlow.forget()), NS_DISPATCH_NORMAL);
|
||||
RUN_ON_THREAD(mStsThread, WrapRelease(mRtcpFlow.forget()), NS_DISPATCH_NORMAL);
|
||||
|
|
Загрузка…
Ссылка в новой задаче