зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1128380: Add IsHardwareAccelerated implementation for AVCC and mac decoder. r=cpearce
This commit is contained in:
Родитель
f5c457991f
Коммит
e5a7c9c6c1
|
@ -35,6 +35,7 @@ public:
|
|||
virtual void AllocateMediaResources() MOZ_OVERRIDE;
|
||||
virtual void ReleaseMediaResources() MOZ_OVERRIDE;
|
||||
virtual void ReleaseDecoder() MOZ_OVERRIDE;
|
||||
virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
// Will create the required MediaDataDecoder if we have a AVC SPS.
|
||||
|
@ -211,6 +212,15 @@ AVCCMediaDataDecoder::CreateDecoderAndInit(mp4_demuxer::MP4Sample* aSample)
|
|||
return Init();
|
||||
}
|
||||
|
||||
bool
|
||||
AVCCMediaDataDecoder::IsHardwareAccelerated() const
|
||||
{
|
||||
if (mDecoder) {
|
||||
return mDecoder->IsHardwareAccelerated();
|
||||
}
|
||||
return MediaDataDecoder::IsHardwareAccelerated();
|
||||
}
|
||||
|
||||
// AVCCDecoderModule
|
||||
|
||||
AVCCDecoderModule::AVCCDecoderModule(PlatformDecoderModule* aPDM)
|
||||
|
|
|
@ -75,6 +75,10 @@ public:
|
|||
virtual nsresult Flush() MOZ_OVERRIDE;
|
||||
virtual nsresult Drain() MOZ_OVERRIDE;
|
||||
virtual nsresult Shutdown() MOZ_OVERRIDE;
|
||||
virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
nsresult OutputFrame(CVPixelBufferRef aImage,
|
||||
nsAutoPtr<AppleFrameRef> aFrameRef);
|
||||
|
|
|
@ -41,6 +41,7 @@ AppleVTDecoder::AppleVTDecoder(const mp4_demuxer::VideoDecoderConfig& aConfig,
|
|||
: AppleVDADecoder(aConfig, aVideoTaskQueue, aCallback, aImageContainer)
|
||||
, mFormat(nullptr)
|
||||
, mSession(nullptr)
|
||||
, mIsHardwareAccelerated(false)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AppleVTDecoder);
|
||||
// TODO: Verify aConfig.mime_type.
|
||||
|
@ -314,8 +315,9 @@ AppleVTDecoder::InitializeSession()
|
|||
if (rv != noErr) {
|
||||
LOG("AppleVTDecoder: system doesn't support hardware acceleration");
|
||||
}
|
||||
mIsHardwareAccelerated = rv == noErr && isUsingHW == kCFBooleanTrue;
|
||||
LOG("AppleVTDecoder: %s hardware accelerated decoding",
|
||||
(rv == noErr && isUsingHW == kCFBooleanTrue) ? "using" : "not using");
|
||||
mIsHardwareAccelerated ? "using" : "not using");
|
||||
} else {
|
||||
LOG("AppleVTDecoder: couldn't determine hardware acceleration status.");
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@ public:
|
|||
virtual nsresult Flush() MOZ_OVERRIDE;
|
||||
virtual nsresult Drain() MOZ_OVERRIDE;
|
||||
virtual nsresult Shutdown() MOZ_OVERRIDE;
|
||||
virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE
|
||||
{
|
||||
return mIsHardwareAccelerated;
|
||||
}
|
||||
|
||||
private:
|
||||
CMVideoFormatDescriptionRef mFormat;
|
||||
|
@ -37,6 +41,7 @@ private:
|
|||
nsresult WaitForAsynchronousFrames();
|
||||
CFDictionaryRef CreateDecoderSpecification();
|
||||
CFDictionaryRef CreateDecoderExtensions();
|
||||
bool mIsHardwareAccelerated;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
Загрузка…
Ссылка в новой задаче