mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 23:23:33 +00:00
Bug 1628690 [Wayland][VA-API] Respect disabled HW decoding to allow fallback to SW decoding, r=jya
Differential Revision: https://phabricator.services.mozilla.com/D71158
This commit is contained in:
parent
0c13707a40
commit
3a6824ecbf
@ -49,7 +49,9 @@ class FFmpegDecoderModule : public PlatformDecoderModule {
|
||||
RefPtr<MediaDataDecoder> decoder = new FFmpegVideoDecoder<V>(
|
||||
mLib, aParams.mTaskQueue, aParams.VideoConfig(),
|
||||
aParams.mKnowsCompositor, aParams.mImageContainer,
|
||||
aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency));
|
||||
aParams.mOptions.contains(CreateDecoderParams::Option::LowLatency),
|
||||
aParams.mOptions.contains(
|
||||
CreateDecoderParams::Option::HardwareDecoderNotAllowed));
|
||||
return decoder.forget();
|
||||
}
|
||||
|
||||
|
@ -270,10 +270,11 @@ void FFmpegVideoDecoder<LIBAV_VER>::PtsCorrectionContext::Reset() {
|
||||
FFmpegVideoDecoder<LIBAV_VER>::FFmpegVideoDecoder(
|
||||
FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue, const VideoInfo& aConfig,
|
||||
KnowsCompositor* aAllocator, ImageContainer* aImageContainer,
|
||||
bool aLowLatency)
|
||||
bool aLowLatency, bool aDisableHardwareDecoding)
|
||||
: FFmpegDataDecoder(aLib, aTaskQueue, GetCodecId(aConfig.mMimeType)),
|
||||
#ifdef MOZ_WAYLAND_USE_VAAPI
|
||||
mVAAPIDeviceContext(nullptr),
|
||||
mDisableHardwareDecoding(aDisableHardwareDecoding),
|
||||
#endif
|
||||
mImageAllocator(aAllocator),
|
||||
mImageContainer(aImageContainer),
|
||||
@ -289,9 +290,11 @@ RefPtr<MediaDataDecoder::InitPromise> FFmpegVideoDecoder<LIBAV_VER>::Init() {
|
||||
MediaResult rv;
|
||||
|
||||
#ifdef MOZ_WAYLAND_USE_VAAPI
|
||||
rv = InitVAAPIDecoder();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
|
||||
if (!mDisableHardwareDecoding) {
|
||||
rv = InitVAAPIDecoder();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -48,7 +48,8 @@ class FFmpegVideoDecoder<LIBAV_VER>
|
||||
public:
|
||||
FFmpegVideoDecoder(FFmpegLibWrapper* aLib, TaskQueue* aTaskQueue,
|
||||
const VideoInfo& aConfig, KnowsCompositor* aAllocator,
|
||||
ImageContainer* aImageContainer, bool aLowLatency);
|
||||
ImageContainer* aImageContainer, bool aLowLatency,
|
||||
bool aDisableHardwareDecoding);
|
||||
|
||||
RefPtr<InitPromise> Init() override;
|
||||
void InitCodecContext() override;
|
||||
@ -109,6 +110,7 @@ class FFmpegVideoDecoder<LIBAV_VER>
|
||||
|
||||
#ifdef MOZ_WAYLAND_USE_VAAPI
|
||||
AVBufferRef* mVAAPIDeviceContext;
|
||||
const bool mDisableHardwareDecoding;
|
||||
#endif
|
||||
RefPtr<KnowsCompositor> mImageAllocator;
|
||||
RefPtr<ImageContainer> mImageContainer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user