tor-browser

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

MFMediaEngineDecoderModule.h (1850B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEDECODERMODULE_H
      6 #define DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEDECODERMODULE_H
      7 
      8 #include "PlatformDecoderModule.h"
      9 #include "WMFUtils.h"
     10 
     11 namespace mozilla {
     12 
     13 // MFMediaEngineDecoderModule is used for the media engine playback, which only
     14 // supports hardware decoding.
     15 class MFMediaEngineDecoderModule final : public PlatformDecoderModule {
     16 public:
     17  static void Init();
     18 
     19  static already_AddRefed<PlatformDecoderModule> Create();
     20 
     21  // Used in the content process to query if the config is supported or not.
     22  // If in the MFCDM process, should use SupportsMimeType or Supports instead.
     23  static bool SupportsConfig(const TrackInfo& aConfig);
     24 
     25  already_AddRefed<MediaDataDecoder> CreateVideoDecoder(
     26      const CreateDecoderParams& aParams) override;
     27 
     28  already_AddRefed<MediaDataDecoder> CreateAudioDecoder(
     29      const CreateDecoderParams& aParams) override;
     30 
     31  media::DecodeSupportSet SupportsMimeType(
     32      const nsACString& aMimeType,
     33      DecoderDoctorDiagnostics* aDiagnostics) const override;
     34  media::DecodeSupportSet Supports(
     35      const SupportDecoderParams& aParams,
     36      DecoderDoctorDiagnostics* aDiagnostics) const override;
     37 
     38  const char* Name() const override { return "MFMediaEngine"; }
     39 
     40 private:
     41  media::DecodeSupportSet SupportInternal(
     42      const SupportDecoderParams& aParams,
     43      DecoderDoctorDiagnostics* aDiagnostics) const;
     44  bool CanCreateMFTDecoder(const WMFStreamType& aType) const;
     45  MFMediaEngineDecoderModule() = default;
     46  ~MFMediaEngineDecoderModule() = default;
     47 };
     48 
     49 }  // namespace mozilla
     50 
     51 #endif  // DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEDECODERMODULE_H