Backed out changeset 9343cb73c218 (bug 1306314)

This commit is contained in:
Iris Hsiao 2016-11-14 11:07:28 +08:00
parent 8be72fb1e5
commit 891306a89a
12 changed files with 22 additions and 61 deletions

View File

@ -80,7 +80,7 @@ GMPContentChild::DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor)
}
PGMPVideoDecoderChild*
GMPContentChild::AllocPGMPVideoDecoderChild(const uint32_t& aDecryptorId)
GMPContentChild::AllocPGMPVideoDecoderChild()
{
GMPVideoDecoderChild* actor = new GMPVideoDecoderChild(this);
actor->AddRef();
@ -244,8 +244,7 @@ GMPContentChild::RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor)
}
bool
GMPContentChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor,
const uint32_t& aDecryptorId)
GMPContentChild::RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor)
{
auto vdc = static_cast<GMPVideoDecoderChild*>(aActor);

View File

@ -25,7 +25,7 @@ public:
bool RecvPGMPAudioDecoderConstructor(PGMPAudioDecoderChild* aActor) override;
bool RecvPGMPDecryptorConstructor(PGMPDecryptorChild* aActor) override;
bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor, const uint32_t& aDecryptorId) override;
bool RecvPGMPVideoDecoderConstructor(PGMPVideoDecoderChild* aActor) override;
bool RecvPGMPVideoEncoderConstructor(PGMPVideoEncoderChild* aActor) override;
PGMPAudioDecoderChild* AllocPGMPAudioDecoderChild() override;
@ -34,7 +34,7 @@ public:
PGMPDecryptorChild* AllocPGMPDecryptorChild() override;
bool DeallocPGMPDecryptorChild(PGMPDecryptorChild* aActor) override;
PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild(const uint32_t& aDecryptorId) override;
PGMPVideoDecoderChild* AllocPGMPVideoDecoderChild() override;
bool DeallocPGMPVideoDecoderChild(PGMPVideoDecoderChild* aActor) override;
PGMPVideoEncoderChild* AllocPGMPVideoEncoderChild() override;

View File

@ -194,11 +194,10 @@ GMPContentParent::GetGMPAudioDecoder(GMPAudioDecoderParent** aGMPAD)
}
nsresult
GMPContentParent::GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD,
uint32_t aDecryptorId)
GMPContentParent::GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD)
{
// returned with one anonymous AddRef that locks it until Destroy
PGMPVideoDecoderParent* pvdp = SendPGMPVideoDecoderConstructor(aDecryptorId);
PGMPVideoDecoderParent* pvdp = SendPGMPVideoDecoderConstructor();
if (!pvdp) {
return NS_ERROR_FAILURE;
}
@ -231,7 +230,7 @@ GMPContentParent::GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE)
}
PGMPVideoDecoderParent*
GMPContentParent::AllocPGMPVideoDecoderParent(const uint32_t& aDecryptorId)
GMPContentParent::AllocPGMPVideoDecoderParent()
{
GMPVideoDecoderParent* vdp = new GMPVideoDecoderParent(this);
NS_ADDREF(vdp);

View File

@ -27,8 +27,7 @@ public:
explicit GMPContentParent(GMPParent* aParent = nullptr);
nsresult GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD,
uint32_t aDecryptorId);
nsresult GetGMPVideoDecoder(GMPVideoDecoderParent** aGMPVD);
void VideoDecoderDestroyed(GMPVideoDecoderParent* aDecoder);
nsresult GetGMPVideoEncoder(GMPVideoEncoderParent** aGMPVE);
@ -67,7 +66,7 @@ private:
void ActorDestroy(ActorDestroyReason aWhy) override;
PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent(const uint32_t& aDecryptorId) override;
PGMPVideoDecoderParent* AllocPGMPVideoDecoderParent() override;
bool DeallocPGMPVideoDecoderParent(PGMPVideoDecoderParent* aActor) override;
PGMPVideoEncoderParent* AllocPGMPVideoEncoderParent() override;

View File

@ -349,11 +349,9 @@ class GetGMPContentParentForVideoDecoderDone : public GetGMPContentParentCallbac
{
public:
explicit GetGMPContentParentForVideoDecoderDone(UniquePtr<GetGMPVideoDecoderCallback>&& aCallback,
GMPCrashHelper* aHelper,
uint32_t aDecryptorId)
GMPCrashHelper* aHelper)
: mCallback(Move(aCallback))
, mHelper(aHelper)
, mDecryptorId(aDecryptorId)
{
}
@ -361,7 +359,7 @@ public:
{
GMPVideoDecoderParent* gmpVDP = nullptr;
GMPVideoHostImpl* videoHost = nullptr;
if (aGMPParent && NS_SUCCEEDED(aGMPParent->GetGMPVideoDecoder(&gmpVDP, mDecryptorId))) {
if (aGMPParent && NS_SUCCEEDED(aGMPParent->GetGMPVideoDecoder(&gmpVDP))) {
videoHost = &gmpVDP->Host();
gmpVDP->SetCrashHelper(mHelper);
}
@ -371,15 +369,13 @@ public:
private:
UniquePtr<GetGMPVideoDecoderCallback> mCallback;
RefPtr<GMPCrashHelper> mHelper;
const uint32_t mDecryptorId;
};
NS_IMETHODIMP
GeckoMediaPluginService::GetDecryptingGMPVideoDecoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
const nsACString& aNodeId,
UniquePtr<GetGMPVideoDecoderCallback>&& aCallback,
uint32_t aDecryptorId)
GeckoMediaPluginService::GetGMPVideoDecoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
const nsACString& aNodeId,
UniquePtr<GetGMPVideoDecoderCallback>&& aCallback)
{
MOZ_ASSERT(NS_GetCurrentThread() == mGMPThread);
NS_ENSURE_ARG(aTags && aTags->Length() > 0);
@ -390,7 +386,7 @@ GeckoMediaPluginService::GetDecryptingGMPVideoDecoder(GMPCrashHelper* aHelper,
}
UniquePtr<GetGMPContentParentCallback> callback(
new GetGMPContentParentForVideoDecoderDone(Move(aCallback), aHelper, aDecryptorId));
new GetGMPContentParentForVideoDecoderDone(Move(aCallback), aHelper));
if (!GetContentParentFrom(aHelper,
aNodeId,
NS_LITERAL_CSTRING(GMP_API_VIDEO_DECODER),

View File

@ -69,11 +69,10 @@ public:
// mozIGeckoMediaPluginService
NS_IMETHOD GetThread(nsIThread** aThread) override;
NS_IMETHOD GetDecryptingGMPVideoDecoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
const nsACString& aNodeId,
UniquePtr<GetGMPVideoDecoderCallback>&& aCallback,
uint32_t aDecryptorId)
NS_IMETHOD GetGMPVideoDecoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
const nsACString& aNodeId,
UniquePtr<GetGMPVideoDecoderCallback>&& aCallback)
override;
NS_IMETHOD GetGMPVideoEncoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
@ -91,16 +90,6 @@ public:
UniquePtr<GetGMPDecryptorCallback>&& aCallback)
override;
// Helper for backwards compatibility with WebRTC/tests.
NS_IMETHOD
GetGMPVideoDecoder(GMPCrashHelper* aHelper,
nsTArray<nsCString>* aTags,
const nsACString& aNodeId,
UniquePtr<GetGMPVideoDecoderCallback>&& aCallback) override
{
return GetDecryptingGMPVideoDecoder(aHelper, aTags, aNodeId, Move(aCallback), 0);
}
int32_t AsyncShutdownTimeoutMs();
NS_IMETHOD RunPluginCrashCallbacks(uint32_t aPluginId,

View File

@ -25,7 +25,7 @@ intr protocol PGMPContent
child:
async PGMPAudioDecoder();
async PGMPDecryptor();
async PGMPVideoDecoder(uint32_t aDecryptorId);
async PGMPVideoDecoder();
async PGMPVideoEncoder();
};

View File

@ -93,19 +93,6 @@ interface mozIGeckoMediaPluginService : nsISupports
[optional] in ACString nodeId,
in GetGMPVideoDecoderCallback callback);
/**
* Gets a video decoder as per getGMPVideoDecoder, except it is linked to
* with a corresponding GMPDecryptor via the decryptor's ID.
* This is a temporary measure, until we can implement a Chromium CDM
* GMP protocol which does both decryption and decoding.
*/
[noscript]
void getDecryptingGMPVideoDecoder(in GMPCrashHelperPtr helper,
in TagArray tags,
in ACString nodeId,
in GetGMPVideoDecoderCallback callback,
in uint32_t decryptorId);
/**
* Get a video encoder that supports the specified tags.
* The array of tags should at least contain a codec tag, and optionally

View File

@ -32,7 +32,6 @@ EMEVideoDecoder::EMEVideoDecoder(CDMProxy* aProxy,
VideoInfo(aParams.mConfig.mDisplay),
aParams.mImageContainer)))
, mProxy(aProxy)
, mDecryptorId(aProxy->GetDecryptorId())
{}
void

View File

@ -33,11 +33,9 @@ public:
private:
void InitTags(nsTArray<nsCString>& aTags) override;
nsCString GetNodeId() override;
uint32_t DecryptorId() const override { return mDecryptorId; }
GMPUniquePtr<GMPVideoEncodedFrame> CreateFrame(MediaRawData* aSample) override;
RefPtr<CDMProxy> mProxy;
uint32_t mDecryptorId;
};
} // namespace mozilla

View File

@ -311,11 +311,7 @@ GMPVideoDecoder::Init()
nsTArray<nsCString> tags;
InitTags(tags);
UniquePtr<GetGMPVideoDecoderCallback> callback(new GMPInitDoneCallback(this));
if (NS_FAILED(mMPS->GetDecryptingGMPVideoDecoder(mCrashHelper,
&tags,
GetNodeId(),
Move(callback),
DecryptorId()))) {
if (NS_FAILED(mMPS->GetGMPVideoDecoder(mCrashHelper, &tags, GetNodeId(), Move(callback)))) {
mInitPromise.Reject(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__);
}

View File

@ -82,7 +82,6 @@ public:
protected:
virtual void InitTags(nsTArray<nsCString>& aTags);
virtual nsCString GetNodeId();
virtual uint32_t DecryptorId() const { return 0; }
virtual GMPUniquePtr<GMPVideoEncodedFrame> CreateFrame(MediaRawData* aSample);
virtual const VideoInfo& GetConfig() const;