зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1131340 - Avoid template aliasing since GCC 4.6 lacks support. r=cpearce
This commit is contained in:
Родитель
ee3271ba85
Коммит
554ea67ff5
|
@ -35,10 +35,10 @@ EMEVideoDecoder::GetNodeId()
|
|||
return mProxy->GetNodeId();
|
||||
}
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrame>
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr
|
||||
EMEVideoDecoder::CreateFrame(mp4_demuxer::MP4Sample* aSample)
|
||||
{
|
||||
GMPUniquePtr<GMPVideoEncodedFrame> frame = GMPVideoDecoder::CreateFrame(aSample);
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr frame = GMPVideoDecoder::CreateFrame(aSample);
|
||||
if (frame && aSample->crypto.valid) {
|
||||
static_cast<gmp::GMPVideoEncodedFrameImpl*>(frame.get())->InitCrypto(aSample->crypto);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public:
|
|||
private:
|
||||
virtual void InitTags(nsTArray<nsCString>& aTags) MOZ_OVERRIDE;
|
||||
virtual nsCString GetNodeId() MOZ_OVERRIDE;
|
||||
virtual GMPUniquePtr<GMPVideoEncodedFrame> CreateFrame(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;
|
||||
virtual GMPUnique<GMPVideoEncodedFrame>::Ptr CreateFrame(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;
|
||||
|
||||
nsRefPtr<CDMProxy> mProxy;
|
||||
};
|
||||
|
|
|
@ -17,7 +17,7 @@ static bool IsOnGMPThread();
|
|||
void
|
||||
VideoCallbackAdapter::Decoded(GMPVideoi420Frame* aDecodedFrame)
|
||||
{
|
||||
GMPUniquePtr<GMPVideoi420Frame> decodedFrame(aDecodedFrame);
|
||||
GMPUnique<GMPVideoi420Frame>::Ptr decodedFrame(aDecodedFrame);
|
||||
|
||||
MOZ_ASSERT(IsOnGMPThread());
|
||||
|
||||
|
@ -113,7 +113,7 @@ GMPVideoDecoder::GetNodeId()
|
|||
return NS_LITERAL_CSTRING("");
|
||||
}
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrame>
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr
|
||||
GMPVideoDecoder::CreateFrame(mp4_demuxer::MP4Sample* aSample)
|
||||
{
|
||||
GMPVideoFrame* ftmp = nullptr;
|
||||
|
@ -123,7 +123,7 @@ GMPVideoDecoder::CreateFrame(mp4_demuxer::MP4Sample* aSample)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrame> frame(static_cast<GMPVideoEncodedFrame*>(ftmp));
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr frame(static_cast<GMPVideoEncodedFrame*>(ftmp));
|
||||
err = frame->CreateEmptyFrame(aSample->size);
|
||||
if (GMP_FAILED(err)) {
|
||||
mCallback->Error();
|
||||
|
@ -193,7 +193,7 @@ GMPVideoDecoder::Input(mp4_demuxer::MP4Sample* aSample)
|
|||
|
||||
mAdapter->SetLastStreamOffset(sample->byte_offset);
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrame> frame = CreateFrame(sample);
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr frame = CreateFrame(sample);
|
||||
nsTArray<uint8_t> info; // No codec specific per-frame info to pass.
|
||||
nsresult rv = mGMP->Decode(Move(frame), false, info, 0);
|
||||
if (NS_FAILED(rv)) {
|
||||
|
|
|
@ -88,7 +88,7 @@ public:
|
|||
protected:
|
||||
virtual void InitTags(nsTArray<nsCString>& aTags);
|
||||
virtual nsCString GetNodeId();
|
||||
virtual GMPUniquePtr<GMPVideoEncodedFrame> CreateFrame(mp4_demuxer::MP4Sample* aSample);
|
||||
virtual GMPUnique<GMPVideoEncodedFrame>::Ptr CreateFrame(mp4_demuxer::MP4Sample* aSample);
|
||||
|
||||
private:
|
||||
const mp4_demuxer::VideoDecoderConfig& mConfig;
|
||||
|
|
|
@ -18,8 +18,11 @@ struct DestroyPolicy
|
|||
}
|
||||
};
|
||||
|
||||
// Ideally, this would be a template alias, but GCC 4.6 doesn't support them. See bug 1124021.
|
||||
template<typename T>
|
||||
using GMPUniquePtr = mozilla::UniquePtr<T, DestroyPolicy<T>>;
|
||||
struct GMPUnique {
|
||||
typedef mozilla::UniquePtr<T, DestroyPolicy<T>> Ptr;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ GMPVideoDecoderParent::InitDecode(const GMPVideoCodec& aCodecSettings,
|
|||
}
|
||||
|
||||
nsresult
|
||||
GMPVideoDecoderParent::Decode(GMPUniquePtr<GMPVideoEncodedFrame> aInputFrame,
|
||||
GMPVideoDecoderParent::Decode(GMPUnique<GMPVideoEncodedFrame>::Ptr aInputFrame,
|
||||
bool aMissingFrames,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
int64_t aRenderTimeMs)
|
||||
|
@ -121,7 +121,7 @@ GMPVideoDecoderParent::Decode(GMPUniquePtr<GMPVideoEncodedFrame> aInputFrame,
|
|||
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrameImpl> inputFrameImpl(
|
||||
GMPUnique<GMPVideoEncodedFrameImpl>::Ptr inputFrameImpl(
|
||||
static_cast<GMPVideoEncodedFrameImpl*>(aInputFrame.release()));
|
||||
|
||||
// Very rough kill-switch if the plugin stops processing. If it's merely
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
const nsTArray<uint8_t>& aCodecSpecific,
|
||||
GMPVideoDecoderCallbackProxy* aCallback,
|
||||
int32_t aCoreCount) MOZ_OVERRIDE;
|
||||
virtual nsresult Decode(GMPUniquePtr<GMPVideoEncodedFrame> aInputFrame,
|
||||
virtual nsresult Decode(GMPUnique<GMPVideoEncodedFrame>::Ptr aInputFrame,
|
||||
bool aMissingFrames,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
int64_t aRenderTimeMs = -1) MOZ_OVERRIDE;
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
const nsTArray<uint8_t>& aCodecSpecific,
|
||||
GMPVideoDecoderCallbackProxy* aCallback,
|
||||
int32_t aCoreCount) = 0;
|
||||
virtual nsresult Decode(mozilla::GMPUniquePtr<GMPVideoEncodedFrame> aInputFrame,
|
||||
virtual nsresult Decode(mozilla::GMPUnique<GMPVideoEncodedFrame>::Ptr aInputFrame,
|
||||
bool aMissingFrames,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
int64_t aRenderTimeMs = -1) = 0;
|
||||
|
|
|
@ -126,7 +126,7 @@ GMPVideoEncoderParent::InitEncode(const GMPVideoCodec& aCodecSettings,
|
|||
}
|
||||
|
||||
GMPErr
|
||||
GMPVideoEncoderParent::Encode(GMPUniquePtr<GMPVideoi420Frame> aInputFrame,
|
||||
GMPVideoEncoderParent::Encode(GMPUnique<GMPVideoi420Frame>::Ptr aInputFrame,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
const nsTArray<GMPVideoFrameType>& aFrameTypes)
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ GMPVideoEncoderParent::Encode(GMPUniquePtr<GMPVideoi420Frame> aInputFrame,
|
|||
|
||||
MOZ_ASSERT(mPlugin->GMPThread() == NS_GetCurrentThread());
|
||||
|
||||
GMPUniquePtr<GMPVideoi420FrameImpl> inputFrameImpl(
|
||||
GMPUnique<GMPVideoi420FrameImpl>::Ptr inputFrameImpl(
|
||||
static_cast<GMPVideoi420FrameImpl*>(aInputFrame.release()));
|
||||
|
||||
// Very rough kill-switch if the plugin stops processing. If it's merely
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
GMPVideoEncoderCallbackProxy* aCallback,
|
||||
int32_t aNumberOfCores,
|
||||
uint32_t aMaxPayloadSize) MOZ_OVERRIDE;
|
||||
virtual GMPErr Encode(GMPUniquePtr<GMPVideoi420Frame> aInputFrame,
|
||||
virtual GMPErr Encode(GMPUnique<GMPVideoi420Frame>::Ptr aInputFrame,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
const nsTArray<GMPVideoFrameType>& aFrameTypes) MOZ_OVERRIDE;
|
||||
virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) MOZ_OVERRIDE;
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
GMPVideoEncoderCallbackProxy* aCallback,
|
||||
int32_t aNumberOfCores,
|
||||
uint32_t aMaxPayloadSize) = 0;
|
||||
virtual GMPErr Encode(mozilla::GMPUniquePtr<GMPVideoi420Frame> aInputFrame,
|
||||
virtual GMPErr Encode(mozilla::GMPUnique<GMPVideoi420Frame>::Ptr aInputFrame,
|
||||
const nsTArray<uint8_t>& aCodecSpecificInfo,
|
||||
const nsTArray<GMPVideoFrameType>& aFrameTypes) = 0;
|
||||
virtual GMPErr SetChannelParameters(uint32_t aPacketLoss, uint32_t aRTT) = 0;
|
||||
|
|
|
@ -279,7 +279,7 @@ WebrtcGmpVideoEncoder::Encode_g(const webrtc::I420VideoFrame* aInputImage,
|
|||
if (err != GMPNoErr) {
|
||||
return WEBRTC_VIDEO_CODEC_ERROR;
|
||||
}
|
||||
GMPUniquePtr<GMPVideoi420Frame> frame(static_cast<GMPVideoi420Frame*>(ftmp));
|
||||
GMPUnique<GMPVideoi420Frame>::Ptr frame(static_cast<GMPVideoi420Frame*>(ftmp));
|
||||
|
||||
err = frame->CreateFrame(aInputImage->allocated_size(webrtc::kYPlane),
|
||||
aInputImage->buffer(webrtc::kYPlane),
|
||||
|
@ -655,7 +655,7 @@ WebrtcGmpVideoDecoder::Decode_g(const webrtc::EncodedImage& aInputImage,
|
|||
return WEBRTC_VIDEO_CODEC_ERROR;
|
||||
}
|
||||
|
||||
GMPUniquePtr<GMPVideoEncodedFrame> frame(static_cast<GMPVideoEncodedFrame*>(ftmp));
|
||||
GMPUnique<GMPVideoEncodedFrame>::Ptr frame(static_cast<GMPVideoEncodedFrame*>(ftmp));
|
||||
err = frame->CreateEmptyFrame(aInputImage._length);
|
||||
if (err != GMPNoErr) {
|
||||
return WEBRTC_VIDEO_CODEC_ERROR;
|
||||
|
|
Загрузка…
Ссылка в новой задаче