tor-browser

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

MediaStreamAudioDestinationNode.h (1865B)


      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 MediaStreamAudioDestinationNode_h_
      8 #define MediaStreamAudioDestinationNode_h_
      9 
     10 #include "AudioNode.h"
     11 
     12 namespace mozilla::dom {
     13 
     14 class AudioContext;
     15 struct AudioNodeOptions;
     16 
     17 class MediaStreamAudioDestinationNode final : public AudioNode {
     18 public:
     19  static already_AddRefed<MediaStreamAudioDestinationNode> Create(
     20      AudioContext& aAudioContext, const AudioNodeOptions& aOptions,
     21      ErrorResult& aRv);
     22 
     23  NS_DECL_ISUPPORTS_INHERITED
     24  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamAudioDestinationNode,
     25                                           AudioNode)
     26 
     27  static already_AddRefed<MediaStreamAudioDestinationNode> Constructor(
     28      const GlobalObject& aGlobal, AudioContext& aAudioContext,
     29      const AudioNodeOptions& aOptions, ErrorResult& aRv) {
     30    return Create(aAudioContext, aOptions, aRv);
     31  }
     32 
     33  JSObject* WrapObject(JSContext* aCx,
     34                       JS::Handle<JSObject*> aGivenProto) override;
     35 
     36  uint16_t NumberOfOutputs() const final { return 0; }
     37 
     38  void DestroyMediaTrack() override;
     39 
     40  DOMMediaStream* DOMStream() const { return mDOMStream; }
     41 
     42  const char* NodeType() const override {
     43    return "MediaStreamAudioDestinationNode";
     44  }
     45 
     46  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
     47  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
     48 
     49 private:
     50  explicit MediaStreamAudioDestinationNode(AudioContext* aContext);
     51  ~MediaStreamAudioDestinationNode() = default;
     52 
     53  RefPtr<DOMMediaStream> mDOMStream;
     54 };
     55 
     56 }  // namespace mozilla::dom
     57 
     58 #endif