From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../platforms/agnostic/eme/EMEDecoderModule.h | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dom/media/platforms/agnostic/eme/EMEDecoderModule.h (limited to 'dom/media/platforms/agnostic/eme/EMEDecoderModule.h') diff --git a/dom/media/platforms/agnostic/eme/EMEDecoderModule.h b/dom/media/platforms/agnostic/eme/EMEDecoderModule.h new file mode 100644 index 0000000000..06fea6e650 --- /dev/null +++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.h @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim:set ts=2 sw=2 sts=2 et cindent: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#if !defined(EMEDecoderModule_h_) +# define EMEDecoderModule_h_ + +# include "MediaDataDecoderProxy.h" +# include "PlatformDecoderModule.h" +# include "SamplesWaitingForKey.h" + +namespace mozilla { + +class CDMProxy; +class PDMFactory; + +class EMEDecoderModule : public PlatformDecoderModule { + public: + EMEDecoderModule(CDMProxy* aProxy, PDMFactory* aPDM); + + protected: + RefPtr AsyncCreateDecoder( + const CreateDecoderParams& aParams) override; + + // Decode thread. + already_AddRefed CreateVideoDecoder( + const CreateDecoderParams& aParams) override { + MOZ_CRASH("Not used"); + } + + // Decode thread. + already_AddRefed CreateAudioDecoder( + const CreateDecoderParams& aParams) override { + MOZ_CRASH("Not used"); + } + + media::DecodeSupportSet SupportsMimeType( + const nsACString& aMimeType, + DecoderDoctorDiagnostics* aDiagnostics) const override; + + private: + virtual ~EMEDecoderModule(); + RefPtr mProxy; + // Will be null if CDM has decoding capability. + RefPtr mPDM; +}; + +DDLoggedTypeDeclNameAndBase(EMEMediaDataDecoderProxy, MediaDataDecoderProxy); + +class EMEMediaDataDecoderProxy + : public MediaDataDecoderProxy, + public DecoderDoctorLifeLogger { + public: + EMEMediaDataDecoderProxy(const CreateDecoderParams& aParams, + already_AddRefed aProxyDecoder, + already_AddRefed aProxyThread, + CDMProxy* aProxy); + EMEMediaDataDecoderProxy(const CreateDecoderParams& aParams, + already_AddRefed aProxyDecoder, + CDMProxy* aProxy); + + RefPtr Decode(MediaRawData* aSample) override; + RefPtr Flush() override; + RefPtr Shutdown() override; + + private: + nsCOMPtr mThread; + RefPtr mSamplesWaitingForKey; + MozPromiseRequestHolder mKeyRequest; + MozPromiseHolder mDecodePromise; + MozPromiseRequestHolder mDecodeRequest; + RefPtr mProxy; +}; + +} // namespace mozilla + +#endif // EMEDecoderModule_h_ -- cgit v1.2.3