From 4ebeb72f7b6186aac20e321f39727292d2aa9b4c Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 17 Apr 2015 12:43:18 -0400 Subject: [PATCH] Bug 1155178 - Part 2: Rename GMPUnique to GMPUniquePtr; r=cpearce --- dom/media/fmp4/eme/EMEVideoDecoder.cpp | 4 ++-- dom/media/fmp4/eme/EMEVideoDecoder.h | 2 +- dom/media/fmp4/gmp/GMPVideoDecoder.cpp | 8 ++++---- dom/media/fmp4/gmp/GMPVideoDecoder.h | 2 +- dom/media/gmp/GMPUtils.h | 2 +- dom/media/gmp/GMPVideoDecoderParent.cpp | 4 ++-- dom/media/gmp/GMPVideoDecoderParent.h | 2 +- dom/media/gmp/GMPVideoDecoderProxy.h | 2 +- dom/media/gmp/GMPVideoEncoderParent.cpp | 4 ++-- dom/media/gmp/GMPVideoEncoderParent.h | 2 +- dom/media/gmp/GMPVideoEncoderProxy.h | 2 +- dom/media/gtest/TestGMPRemoveAndDelete.cpp | 2 +- .../signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp | 4 ++-- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/dom/media/fmp4/eme/EMEVideoDecoder.cpp b/dom/media/fmp4/eme/EMEVideoDecoder.cpp index a399cee9eb3c..0c2d56cd53e8 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 +GMPUniquePtr EMEVideoDecoder::CreateFrame(MediaRawData* aSample) { - GMPUnique frame = GMPVideoDecoder::CreateFrame(aSample); + GMPUniquePtr 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 10c15c0fb307..bf7247185d87 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 CreateFrame(MediaRawData* aSample) override; + virtual GMPUniquePtr CreateFrame(MediaRawData* aSample) override; nsRefPtr mProxy; }; diff --git a/dom/media/fmp4/gmp/GMPVideoDecoder.cpp b/dom/media/fmp4/gmp/GMPVideoDecoder.cpp index 9e3364254ed2..fb1fdb456c37 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 decodedFrame(aDecodedFrame); + GMPUniquePtr decodedFrame(aDecodedFrame); MOZ_ASSERT(IsOnGMPThread()); @@ -115,7 +115,7 @@ GMPVideoDecoder::GetNodeId() return NS_LITERAL_CSTRING(""); } -GMPUnique +GMPUniquePtr GMPVideoDecoder::CreateFrame(MediaRawData* aSample) { GMPVideoFrame* ftmp = nullptr; @@ -125,7 +125,7 @@ GMPVideoDecoder::CreateFrame(MediaRawData* aSample) return nullptr; } - GMPUnique frame(static_cast(ftmp)); + GMPUniquePtr 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 frame = CreateFrame(sample); + GMPUniquePtr 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 33f836a3404b..946f0cbea685 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 CreateFrame(MediaRawData* aSample); + virtual GMPUniquePtr CreateFrame(MediaRawData* aSample); private: class GMPInitDoneRunnable : public nsRunnable diff --git a/dom/media/gmp/GMPUtils.h b/dom/media/gmp/GMPUtils.h index 7a42270a6548..d62f0011b0a9 100644 --- a/dom/media/gmp/GMPUtils.h +++ b/dom/media/gmp/GMPUtils.h @@ -19,7 +19,7 @@ struct DestroyPolicy }; template -using GMPUnique = mozilla::UniquePtr>; +using GMPUniquePtr = mozilla::UniquePtr>; } // namespace mozilla diff --git a/dom/media/gmp/GMPVideoDecoderParent.cpp b/dom/media/gmp/GMPVideoDecoderParent.cpp index cd529aad36e4..138c72dea115 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 aInputFrame, +GMPVideoDecoderParent::Decode(GMPUniquePtr aInputFrame, bool aMissingFrames, const nsTArray& aCodecSpecificInfo, int64_t aRenderTimeMs) @@ -121,7 +121,7 @@ GMPVideoDecoderParent::Decode(GMPUnique aInputFrame, MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); - GMPUnique inputFrameImpl( + GMPUniquePtr 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 6d47d8c57251..ffa3a8832bb6 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 aInputFrame, + virtual nsresult Decode(GMPUniquePtr 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 a1ecfcd925e3..1a5c771c988d 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 aInputFrame, + virtual nsresult Decode(mozilla::GMPUniquePtr 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 4109e162c15f..a5c0fa32e9bf 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 aInputFrame, +GMPVideoEncoderParent::Encode(GMPUniquePtr aInputFrame, const nsTArray& aCodecSpecificInfo, const nsTArray& aFrameTypes) { @@ -137,7 +137,7 @@ GMPVideoEncoderParent::Encode(GMPUnique aInputFrame, MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread()); - GMPUnique inputFrameImpl( + GMPUniquePtr 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 118bf78adc3a..169adf981b64 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 aInputFrame, + virtual GMPErr Encode(GMPUniquePtr 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 d652e5e8db8a..b1141e684adb 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 aInputFrame, + virtual GMPErr Encode(mozilla::GMPUniquePtr 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 7ebae1454fde..aef283cf136e 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 + GMPUniquePtr 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 92527ab34d32..0c45da3e4b32 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 frame(static_cast(ftmp)); + GMPUniquePtr 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 frame(static_cast(ftmp)); + GMPUniquePtr frame(static_cast(ftmp)); err = frame->CreateEmptyFrame(aInputImage._length); if (err != GMPNoErr) { return WEBRTC_VIDEO_CODEC_ERROR;