tor-browser

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

BlankDecoderModule.h (2003B)


      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 #if !defined(BlankDecoderModule_h_)
      7 #  define BlankDecoderModule_h_
      8 
      9 #  include "DummyMediaDataDecoder.h"
     10 #  include "PlatformDecoderModule.h"
     11 
     12 namespace mozilla {
     13 
     14 namespace layers {
     15 class ImageContainer;
     16 }
     17 
     18 class MediaData;
     19 class MediaRawData;
     20 
     21 class BlankVideoDataCreator : public DummyDataCreator {
     22 public:
     23  BlankVideoDataCreator(uint32_t aFrameWidth, uint32_t aFrameHeight,
     24                        layers::ImageContainer* aImageContainer);
     25 
     26  already_AddRefed<MediaData> Create(MediaRawData* aSample) override;
     27 
     28 private:
     29  VideoInfo mInfo;
     30  gfx::IntRect mPicture;
     31  uint32_t mFrameWidth;
     32  uint32_t mFrameHeight;
     33  RefPtr<layers::ImageContainer> mImageContainer;
     34 };
     35 
     36 class BlankAudioDataCreator : public DummyDataCreator {
     37 public:
     38  BlankAudioDataCreator(uint32_t aChannelCount, uint32_t aSampleRate);
     39 
     40  already_AddRefed<MediaData> Create(MediaRawData* aSample) override;
     41 
     42 private:
     43  int64_t mFrameSum;
     44  uint32_t mChannelCount;
     45  uint32_t mSampleRate;
     46 };
     47 
     48 class BlankDecoderModule : public PlatformDecoderModule {
     49  template <typename T, typename... Args>
     50  friend already_AddRefed<T> MakeAndAddRef(Args&&...);
     51 
     52  const char* Name() const override { return "Blank"; }
     53 
     54 public:
     55  static already_AddRefed<PlatformDecoderModule> Create();
     56 
     57  already_AddRefed<MediaDataDecoder> CreateVideoDecoder(
     58      const CreateDecoderParams& aParams) override;
     59 
     60  already_AddRefed<MediaDataDecoder> CreateAudioDecoder(
     61      const CreateDecoderParams& aParams) override;
     62 
     63  media::DecodeSupportSet SupportsMimeType(
     64      const nsACString& aMimeType,
     65      DecoderDoctorDiagnostics* aDiagnostics) const override;
     66 };
     67 
     68 }  // namespace mozilla
     69 
     70 #endif /* BlankDecoderModule_h_ */