diff --git a/dom/media/fmp4/eme/EMEVideoDecoder.cpp b/dom/media/fmp4/eme/EMEVideoDecoder.cpp index 20aebcfcc925..a399cee9eb3c 100644 --- a/dom/media/fmp4/eme/EMEVideoDecoder.cpp +++ b/dom/media/fmp4/eme/EMEVideoDecoder.cpp @@ -36,10 +36,10 @@ EMEVideoDecoder::GetNodeId() return mProxy->GetNodeId(); } -GMPUnique::Ptr +GMPUnique EMEVideoDecoder::CreateFrame(MediaRawData* aSample) { - GMPUnique::Ptr frame = GMPVideoDecoder::CreateFrame(aSample); + GMPUnique frame = GMPVideoDecoder::CreateFrame(aSample); if (frame && aSample->mCrypto.mValid) { static_cast(frame.get())->InitCrypto(aSample->mCrypto); } diff --git a/dom/media/fmp4/eme/EMEVideoDecoder.h b/dom/media/fmp4/eme/EMEVideoDecoder.h index 6f389da8ecdc..10c15c0fb307 100644 --- a/dom/media/fmp4/eme/EMEVideoDecoder.h +++ b/dom/media/fmp4/eme/EMEVideoDecoder.h @@ -50,7 +50,7 @@ public: private: virtual void InitTags(nsTArray& aTags) override; virtual nsCString GetNodeId() override; - virtual GMPUnique::Ptr CreateFrame(MediaRawData* aSample) override; + virtual GMPUnique CreateFrame(MediaRawData* aSample) override; nsRefPtr mProxy; }; diff --git a/dom/media/fmp4/gmp/GMPVideoDecoder.cpp b/dom/media/fmp4/gmp/GMPVideoDecoder.cpp index 5a74e5ddb08d..9e3364254ed2 100644 --- a/dom/media/fmp4/gmp/GMPVideoDecoder.cpp +++ b/dom/media/fmp4/gmp/GMPVideoDecoder.cpp @@ -19,7 +19,7 @@ extern bool IsOnGMPThread(); void VideoCallbackAdapter::Decoded(GMPVideoi420Frame* aDecodedFrame) { - GMPUnique::Ptr decodedFrame(aDecodedFrame); + GMPUnique decodedFrame(aDecodedFrame); MOZ_ASSERT(IsOnGMPThread()); @@ -115,7 +115,7 @@ GMPVideoDecoder::GetNodeId() return NS_LITERAL_CSTRING(""); } -GMPUnique::Ptr +GMPUnique GMPVideoDecoder::CreateFrame(MediaRawData* aSample) { GMPVideoFrame* ftmp = nullptr; @@ -125,7 +125,7 @@ GMPVideoDecoder::CreateFrame(MediaRawData* aSample) return nullptr; } - GMPUnique::Ptr frame(static_cast(ftmp)); + GMPUnique frame(static_cast(ftmp)); err = frame->CreateEmptyFrame(aSample->mSize); if (GMP_FAILED(err)) { mCallback->Error(); @@ -248,7 +248,7 @@ GMPVideoDecoder::Input(MediaRawData* aSample) mAdapter->SetLastStreamOffset(sample->mOffset); - GMPUnique::Ptr frame = CreateFrame(sample); + GMPUnique frame = CreateFrame(sample); nsTArray info; // No codec specific per-frame info to pass. nsresult rv = mGMP->Decode(Move(frame), false, info, 0); if (NS_FAILED(rv)) { diff --git a/dom/media/fmp4/gmp/GMPVideoDecoder.h b/dom/media/fmp4/gmp/GMPVideoDecoder.h index f14cad5aaf15..33f836a3404b 100644 --- a/dom/media/fmp4/gmp/GMPVideoDecoder.h +++ b/dom/media/fmp4/gmp/GMPVideoDecoder.h @@ -93,7 +93,7 @@ public: protected: virtual void InitTags(nsTArray& aTags); virtual nsCString GetNodeId(); - virtual GMPUnique::Ptr CreateFrame(MediaRawData* aSample); + virtual GMPUnique CreateFrame(MediaRawData* aSample); private: class GMPInitDoneRunnable : public nsRunnable diff --git a/dom/media/gmp/GMPUtils.h b/dom/media/gmp/GMPUtils.h index 52bdb27f9ffb..7a42270a6548 100644 --- a/dom/media/gmp/GMPUtils.h +++ b/dom/media/gmp/GMPUtils.h @@ -18,11 +18,8 @@ struct DestroyPolicy } }; -// Ideally, this would be a template alias, but GCC 4.6 doesn't support them. See bug 1124021. template -struct GMPUnique { - typedef mozilla::UniquePtr> Ptr; -}; +using GMPUnique = mozilla::UniquePtr>; } // namespace mozilla diff --git a/dom/media/gmp/GMPVideoDecoderParent.cpp b/dom/media/gmp/GMPVideoDecoderParent.cpp index 422545bd8c06..cd529aad36e4 100644 --- a/dom/media/gmp/GMPVideoDecoderParent.cpp +++ b/dom/media/gmp/GMPVideoDecoderParent.cpp @@ -109,7 +109,7 @@ GMPVideoDecoderParent::InitDecode(const GMPVideoCodec& aCodecSettings, } nsresult -GMPVideoDecoderParent::Decode(GMPUnique::Ptr aInputFrame, +GMPVideoDecoderParent::Decode(GMPUnique aInputFrame, bool aMissingFrames, const nsTArray& aCodecSpecificInfo, int64_t aRenderTimeMs) @@ -121,7 +121,7 @@ GMPVideoDecoderParent::Decode(GMPUnique::Ptr aInputFrame, MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); - GMPUnique::Ptr inputFrameImpl( + GMPUnique inputFrameImpl( static_cast(aInputFrame.release())); // Very rough kill-switch if the plugin stops processing. If it's merely diff --git a/dom/media/gmp/GMPVideoDecoderParent.h b/dom/media/gmp/GMPVideoDecoderParent.h index a231cd01a5b3..6d47d8c57251 100644 --- a/dom/media/gmp/GMPVideoDecoderParent.h +++ b/dom/media/gmp/GMPVideoDecoderParent.h @@ -38,7 +38,7 @@ public: const nsTArray& aCodecSpecific, GMPVideoDecoderCallbackProxy* aCallback, int32_t aCoreCount) override; - virtual nsresult Decode(GMPUnique::Ptr aInputFrame, + virtual nsresult Decode(GMPUnique aInputFrame, bool aMissingFrames, const nsTArray& aCodecSpecificInfo, int64_t aRenderTimeMs = -1) override; diff --git a/dom/media/gmp/GMPVideoDecoderProxy.h b/dom/media/gmp/GMPVideoDecoderProxy.h index f4d344ac8d8f..a1ecfcd925e3 100644 --- a/dom/media/gmp/GMPVideoDecoderProxy.h +++ b/dom/media/gmp/GMPVideoDecoderProxy.h @@ -38,7 +38,7 @@ public: const nsTArray& aCodecSpecific, GMPVideoDecoderCallbackProxy* aCallback, int32_t aCoreCount) = 0; - virtual nsresult Decode(mozilla::GMPUnique::Ptr aInputFrame, + virtual nsresult Decode(mozilla::GMPUnique aInputFrame, bool aMissingFrames, const nsTArray& aCodecSpecificInfo, int64_t aRenderTimeMs = -1) = 0; diff --git a/dom/media/gmp/GMPVideoEncoderParent.cpp b/dom/media/gmp/GMPVideoEncoderParent.cpp index 322277817078..4109e162c15f 100644 --- a/dom/media/gmp/GMPVideoEncoderParent.cpp +++ b/dom/media/gmp/GMPVideoEncoderParent.cpp @@ -126,7 +126,7 @@ GMPVideoEncoderParent::InitEncode(const GMPVideoCodec& aCodecSettings, } GMPErr -GMPVideoEncoderParent::Encode(GMPUnique::Ptr aInputFrame, +GMPVideoEncoderParent::Encode(GMPUnique aInputFrame, const nsTArray& aCodecSpecificInfo, const nsTArray& aFrameTypes) { @@ -137,7 +137,7 @@ GMPVideoEncoderParent::Encode(GMPUnique::Ptr aInputFrame, MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); - GMPUnique::Ptr inputFrameImpl( + GMPUnique inputFrameImpl( static_cast(aInputFrame.release())); // Very rough kill-switch if the plugin stops processing. If it's merely diff --git a/dom/media/gmp/GMPVideoEncoderParent.h b/dom/media/gmp/GMPVideoEncoderParent.h index 0485cb43ad38..118bf78adc3a 100644 --- a/dom/media/gmp/GMPVideoEncoderParent.h +++ b/dom/media/gmp/GMPVideoEncoderParent.h @@ -39,7 +39,7 @@ public: GMPVideoEncoderCallbackProxy* aCallback, int32_t aNumberOfCores, uint32_t aMaxPayloadSize) override; - virtual GMPErr Encode(GMPUnique::Ptr aInputFrame, + virtual GMPErr Encode(GMPUnique aInputFrame, const nsTArray& aCodecSpecificInfo, const nsTArray& aFrameTypes) override; virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) override; diff --git a/dom/media/gmp/GMPVideoEncoderProxy.h b/dom/media/gmp/GMPVideoEncoderProxy.h index 3e76e5358fcf..d652e5e8db8a 100644 --- a/dom/media/gmp/GMPVideoEncoderProxy.h +++ b/dom/media/gmp/GMPVideoEncoderProxy.h @@ -40,7 +40,7 @@ public: GMPVideoEncoderCallbackProxy* aCallback, int32_t aNumberOfCores, uint32_t aMaxPayloadSize) = 0; - virtual GMPErr Encode(mozilla::GMPUnique::Ptr aInputFrame, + virtual GMPErr Encode(mozilla::GMPUnique aInputFrame, const nsTArray& aCodecSpecificInfo, const nsTArray& aFrameTypes) = 0; virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) = 0; diff --git a/dom/media/gtest/TestGMPRemoveAndDelete.cpp b/dom/media/gtest/TestGMPRemoveAndDelete.cpp index e45f299c1ecf..7ebae1454fde 100644 --- a/dom/media/gtest/TestGMPRemoveAndDelete.cpp +++ b/dom/media/gtest/TestGMPRemoveAndDelete.cpp @@ -351,7 +351,7 @@ GMPRemoveTest::gmp_Decode() GMPErr err = mHost->CreateFrame(kGMPEncodedVideoFrame, &absFrame); EXPECT_EQ(err, GMPNoErr); - GMPUnique::Ptr + GMPUnique frame(static_cast(absFrame)); err = frame->CreateEmptyFrame(sizeof(EncodedFrame) /* size */); EXPECT_EQ(err, GMPNoErr); diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp index 9d7be03c8ca8..92527ab34d32 100644 --- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp +++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp @@ -330,7 +330,7 @@ WebrtcGmpVideoEncoder::Encode_g(const webrtc::I420VideoFrame* aInputImage, if (err != GMPNoErr) { return WEBRTC_VIDEO_CODEC_ERROR; } - GMPUnique::Ptr frame(static_cast(ftmp)); + GMPUnique frame(static_cast(ftmp)); err = frame->CreateFrame(aInputImage->allocated_size(webrtc::kYPlane), aInputImage->buffer(webrtc::kYPlane), @@ -721,7 +721,7 @@ WebrtcGmpVideoDecoder::Decode_g(const webrtc::EncodedImage& aInputImage, return WEBRTC_VIDEO_CODEC_ERROR; } - GMPUnique::Ptr frame(static_cast(ftmp)); + GMPUnique frame(static_cast(ftmp)); err = frame->CreateEmptyFrame(aInputImage._length); if (err != GMPNoErr) { return WEBRTC_VIDEO_CODEC_ERROR;