Bug 1169129 - Change GMP*Parent::ParentId() to a more consistent GMP*Parent::GetPluginId(). r=edwin

This commit is contained in:
Chris Pearce 2015-06-05 21:55:51 +12:00
parent e91d94ba0d
commit c02d6f7096
10 changed files with 14 additions and 22 deletions

View File

@ -16,25 +16,19 @@ GMPDecryptorParent::GMPDecryptorParent(GMPContentParent* aPlugin)
, mShuttingDown(false)
, mActorDestroyed(false)
, mPlugin(aPlugin)
, mPluginId(aPlugin->GetPluginId())
, mCallback(nullptr)
#ifdef DEBUG
, mGMPThread(aPlugin->GMPThread())
#endif
{
MOZ_ASSERT(mPlugin && mGMPThread);
mPluginId = aPlugin->GetPluginId();
}
GMPDecryptorParent::~GMPDecryptorParent()
{
}
const uint32_t
GMPDecryptorParent::GetPluginId() const
{
return mPluginId;
}
nsresult
GMPDecryptorParent::Init(GMPDecryptorProxyCallback* aCallback)
{

View File

@ -29,7 +29,7 @@ public:
// GMPDecryptorProxy
virtual const uint32_t GetPluginId() const override;
virtual const uint32_t GetPluginId() const override { return mPluginId; }
virtual nsresult Init(GMPDecryptorProxyCallback* aCallback) override;

View File

@ -46,6 +46,7 @@ GMPVideoDecoderParent::GMPVideoDecoderParent(GMPContentParent* aPlugin)
, mPlugin(aPlugin)
, mCallback(nullptr)
, mVideoHost(this)
, mPluginId(aPlugin->GetPluginId())
{
MOZ_ASSERT(mPlugin);
}

View File

@ -44,7 +44,7 @@ public:
int64_t aRenderTimeMs = -1) override;
virtual nsresult Reset() override;
virtual nsresult Drain() override;
virtual const uint64_t ParentID() override { return reinterpret_cast<uint64_t>(mPlugin.get()); }
virtual const uint32_t GetPluginId() const override { return mPluginId; }
virtual const nsCString& GetDisplayName() const override;
// GMPSharedMemManager
@ -85,6 +85,7 @@ private:
nsRefPtr<GMPContentParent> mPlugin;
GMPVideoDecoderCallbackProxy* mCallback;
GMPVideoHostImpl mVideoHost;
const uint32_t mPluginId;
};
} // namespace gmp

View File

@ -44,7 +44,7 @@ public:
int64_t aRenderTimeMs = -1) = 0;
virtual nsresult Reset() = 0;
virtual nsresult Drain() = 0;
virtual const uint64_t ParentID() = 0;
virtual const uint32_t GetPluginId() const = 0;
// Call to tell GMP/plugin the consumer will no longer use this
// interface/codec.

View File

@ -52,7 +52,8 @@ GMPVideoEncoderParent::GMPVideoEncoderParent(GMPContentParent *aPlugin)
mActorDestroyed(false),
mPlugin(aPlugin),
mCallback(nullptr),
mVideoHost(this)
mVideoHost(this),
mPluginId(aPlugin->GetPluginId())
{
MOZ_ASSERT(mPlugin);
@ -211,12 +212,6 @@ GMPVideoEncoderParent::SetPeriodicKeyFrames(bool aEnable)
return GMPNoErr;
}
const uint32_t
GMPVideoEncoderParent::ParentID()
{
return mPlugin ? mPlugin->GetPluginId() : 0;
}
// Note: Consider keeping ActorDestroy sync'd up when making changes here.
void
GMPVideoEncoderParent::Shutdown()

View File

@ -45,7 +45,7 @@ public:
virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) override;
virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) override;
virtual GMPErr SetPeriodicKeyFrames(bool aEnable) override;
virtual const uint32_t ParentID() override;
virtual const uint32_t GetPluginId() const override { return mPluginId; }
// GMPSharedMemManager
virtual bool Alloc(size_t aSize, Shmem::SharedMemory::SharedMemoryType aType, Shmem* aMem) override
@ -82,6 +82,7 @@ private:
GMPVideoEncoderCallbackProxy* mCallback;
GMPVideoHostImpl mVideoHost;
nsCOMPtr<nsIThread> mEncodedThread;
const uint32_t mPluginId;
};
} // namespace gmp

View File

@ -46,7 +46,7 @@ public:
virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) = 0;
virtual GMPErr SetRates(uint32_t aNewBitRate, uint32_t aFrameRate) = 0;
virtual GMPErr SetPeriodicKeyFrames(bool aEnable) = 0;
virtual const uint32_t ParentID() = 0;
virtual const uint32_t GetPluginId() const = 0;
// Call to tell GMP/plugin the consumer will no longer use this
// interface/codec.

View File

@ -174,7 +174,7 @@ private:
EXPECT_TRUE(aGMP);
if (aGMP) {
EXPECT_TRUE(mGMP &&
(mGMP->ParentID() == aGMP->ParentID()) == mShouldBeEqual);
(mGMP->GetPluginId() == aGMP->GetPluginId()) == mShouldBeEqual);
}
if (mGMP) {
mGMP->Close();

View File

@ -62,7 +62,7 @@ public:
// Implement VideoEncoder interface.
virtual const uint64_t PluginID() override
{
return mGMP ? mGMP->ParentID() : mCachedPluginId;
return mGMP ? mGMP->GetPluginId() : mCachedPluginId;
}
virtual void Terminated() override;
@ -244,7 +244,7 @@ public:
// Implement VideoDecoder interface.
virtual const uint64_t PluginID() override
{
return mGMP ? mGMP->ParentID() : mCachedPluginId;
return mGMP ? mGMP->GetPluginId() : mCachedPluginId;
}
virtual void Terminated() override;