tor-browser

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

MFMediaEngineAudioStream.h (1543B)


      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_MFMEDIAENGINEAUDIOSTREAM_H
      6 #define DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEAUDIOSTREAM_H
      7 
      8 #include "MFMediaEngineStream.h"
      9 
     10 namespace mozilla {
     11 
     12 class MFMediaSource;
     13 
     14 class MFMediaEngineAudioStream final : public MFMediaEngineStream {
     15 public:
     16  MFMediaEngineAudioStream() = default;
     17 
     18  static MFMediaEngineAudioStream* Create(uint64_t aStreamId,
     19                                          const TrackInfo& aInfo,
     20                                          bool aIsEncryptedCustomInit,
     21                                          MFMediaSource* aParentSource);
     22 
     23  nsCString GetDescriptionName() const override {
     24    return "media engine audio stream"_ns;
     25  }
     26 
     27  nsCString GetCodecName() const override;
     28 
     29  TrackInfo::TrackType TrackType() override {
     30    return TrackInfo::TrackType::kAudioTrack;
     31  }
     32 
     33  bool IsEncrypted() const override;
     34 
     35 private:
     36  HRESULT CreateMediaType(const TrackInfo& aInfo,
     37                          IMFMediaType** aMediaType) override;
     38 
     39  bool HasEnoughRawData() const override;
     40 
     41  already_AddRefed<MediaData> OutputDataInternal() override;
     42 
     43  // For MF_MT_USER_DATA. Currently only used for AAC.
     44  nsTArray<BYTE> mAACUserData;
     45 
     46  // Set when `CreateMediaType()` is called.
     47  AudioInfo mAudioInfo;
     48 };
     49 
     50 }  // namespace mozilla
     51 
     52 #endif  // DOM_MEDIA_PLATFORM_WMF_MFMEDIAENGINEAUDIOSTREAM_H