зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1043531 - Cache PluginID in WebRTCVideoDecoder/Encoder if plugin Terminates unexpectedly r=jesup
This commit is contained in:
Родитель
1f87e19110
Коммит
76ea372f0b
|
@ -56,6 +56,7 @@ WebrtcGmpVideoEncoder::WebrtcGmpVideoEncoder()
|
|||
: mGMP(nullptr)
|
||||
, mHost(nullptr)
|
||||
, mCallback(nullptr)
|
||||
, mCachedPluginId(0)
|
||||
{}
|
||||
|
||||
static void
|
||||
|
@ -362,6 +363,8 @@ void
|
|||
WebrtcGmpVideoEncoder::Terminated()
|
||||
{
|
||||
LOGD(("GMP Encoder Terminated: %p", (void *)this));
|
||||
mCachedPluginId = PluginID();
|
||||
|
||||
// We need to drop our reference to this
|
||||
mGMP->Close();
|
||||
mGMP = nullptr;
|
||||
|
@ -437,7 +440,8 @@ WebrtcGmpVideoEncoder::Encoded(GMPVideoEncodedFrame* aEncodedFrame,
|
|||
WebrtcGmpVideoDecoder::WebrtcGmpVideoDecoder() :
|
||||
mGMP(nullptr),
|
||||
mHost(nullptr),
|
||||
mCallback(nullptr) {}
|
||||
mCallback(nullptr),
|
||||
mCachedPluginId(0) {}
|
||||
|
||||
static void
|
||||
Decoder_Close_g(GMPVideoDecoderProxy* aGMP)
|
||||
|
@ -645,6 +649,8 @@ void
|
|||
WebrtcGmpVideoDecoder::Terminated()
|
||||
{
|
||||
LOGD(("GMP Decoder Terminated: %p", (void *)this));
|
||||
mCachedPluginId = PluginID();
|
||||
|
||||
mGMP->Close();
|
||||
mGMP = nullptr;
|
||||
// Could now notify that it's dead
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
// Implement VideoEncoder interface.
|
||||
virtual const uint64_t PluginID() MOZ_OVERRIDE
|
||||
{
|
||||
return mGMP ? mGMP->ParentID() : 0;
|
||||
return mGMP ? mGMP->ParentID() : mCachedPluginId;
|
||||
}
|
||||
|
||||
virtual void Terminated() MOZ_OVERRIDE;
|
||||
|
@ -93,6 +93,7 @@ private:
|
|||
GMPVideoEncoderProxy* mGMP;
|
||||
GMPVideoHost* mHost;
|
||||
webrtc::EncodedImageCallback* mCallback;
|
||||
uint64_t mCachedPluginId;
|
||||
};
|
||||
|
||||
|
||||
|
@ -106,7 +107,7 @@ public:
|
|||
// Implement VideoDecoder interface.
|
||||
virtual const uint64_t PluginID() MOZ_OVERRIDE
|
||||
{
|
||||
return mGMP ? mGMP->ParentID() : 0;
|
||||
return mGMP ? mGMP->ParentID() : mCachedPluginId;
|
||||
}
|
||||
|
||||
virtual void Terminated();
|
||||
|
@ -164,6 +165,7 @@ private:
|
|||
GMPVideoDecoderProxy* mGMP; // Addref is held for us
|
||||
GMPVideoHost* mHost;
|
||||
webrtc::DecodedImageCallback* mCallback;
|
||||
uint64_t mCachedPluginId;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче