tor-browser

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

MediaEngineFake.h (1171B)


      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 file,
      3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef MEDIAENGINEFAKE_H_
      6 #define MEDIAENGINEFAKE_H_
      7 
      8 #include "MediaEngine.h"
      9 #include "MediaEventSource.h"
     10 #include "nsTArrayForwardDeclare.h"
     11 
     12 namespace mozilla {
     13 
     14 /**
     15 * The fake implementation of the MediaEngine interface.
     16 */
     17 class MediaEngineFake : public MediaEngine {
     18 public:
     19  MediaEngineFake();
     20 
     21  void EnumerateDevices(dom::MediaSourceEnum, MediaSinkEnum,
     22                        nsTArray<RefPtr<MediaDevice>>*) override;
     23  void Shutdown() override {}
     24  RefPtr<MediaEngineSource> CreateSource(const MediaDevice* aDevice) override;
     25  RefPtr<MediaEngineSource> CreateSourceFrom(
     26      const MediaEngineSource* aSource, const MediaDevice* aDevice) override;
     27 
     28  MediaEventSource<void>& DeviceListChangeEvent() override {
     29    return mDeviceListChangeEvent;
     30  }
     31  bool IsFake() const override { return true; }
     32 
     33 private:
     34  ~MediaEngineFake();
     35  MediaEventProducer<void> mDeviceListChangeEvent;
     36 };
     37 
     38 }  // namespace mozilla
     39 
     40 #endif /* NSMEDIAENGINEFAKE_H_ */