tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

ChromiumCDMVideoDecoder.h (1804B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef ChromiumCDMVideoDecoder_h_
      8 #define ChromiumCDMVideoDecoder_h_
      9 
     10 #include "ChromiumCDMParent.h"
     11 #include "PlatformDecoderModule.h"
     12 #include "mozilla/layers/KnowsCompositor.h"
     13 
     14 namespace mozilla {
     15 
     16 class CDMProxy;
     17 struct GMPVideoDecoderParams;
     18 
     19 DDLoggedTypeDeclNameAndBase(ChromiumCDMVideoDecoder, MediaDataDecoder);
     20 
     21 class ChromiumCDMVideoDecoder final
     22    : public MediaDataDecoder,
     23      public DecoderDoctorLifeLogger<ChromiumCDMVideoDecoder> {
     24 public:
     25  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ChromiumCDMVideoDecoder, final);
     26 
     27  ChromiumCDMVideoDecoder(const GMPVideoDecoderParams& aParams,
     28                          CDMProxy* aCDMProxy);
     29 
     30  RefPtr<InitPromise> Init() override;
     31  RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
     32  RefPtr<FlushPromise> Flush() override;
     33  RefPtr<DecodePromise> Drain() override;
     34  RefPtr<ShutdownPromise> Shutdown() override;
     35  nsCString GetDescriptionName() const override;
     36  nsCString GetCodecName() const override;
     37  ConversionRequired NeedsConversion() const override;
     38 
     39 private:
     40  ~ChromiumCDMVideoDecoder();
     41 
     42  RefPtr<gmp::ChromiumCDMParent> mCDMParent;
     43  const VideoInfo mConfig;
     44  RefPtr<GMPCrashHelper> mCrashHelper;
     45  nsCOMPtr<nsISerialEventTarget> mGMPThread;
     46  RefPtr<layers::ImageContainer> mImageContainer;
     47  RefPtr<layers::KnowsCompositor> mKnowsCompositor;
     48  MozPromiseHolder<InitPromise> mInitPromise;
     49  bool mConvertToAnnexB = false;
     50 };
     51 
     52 }  // namespace mozilla
     53 
     54 #endif  // ChromiumCDMVideoDecoder_h_