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/. */
7 #ifndef MediaStreamAudioDestinationNode_h_
8 #define MediaStreamAudioDestinationNode_h_
10 #include "AudioNode.h"
12 namespace mozilla::dom
{
15 struct AudioNodeOptions
;
17 class MediaStreamAudioDestinationNode final
: public AudioNode
{
19 static already_AddRefed
<MediaStreamAudioDestinationNode
> Create(
20 AudioContext
& aAudioContext
, const AudioNodeOptions
& aOptions
,
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MediaStreamAudioDestinationNode
,
27 static already_AddRefed
<MediaStreamAudioDestinationNode
> Constructor(
28 const GlobalObject
& aGlobal
, AudioContext
& aAudioContext
,
29 const AudioNodeOptions
& aOptions
, ErrorResult
& aRv
) {
30 return Create(aAudioContext
, aOptions
, aRv
);
33 JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 uint16_t NumberOfOutputs() const final
{ return 0; }
38 void DestroyMediaTrack() override
;
40 DOMMediaStream
* DOMStream() const { return mDOMStream
; }
42 const char* NodeType() const override
{
43 return "MediaStreamAudioDestinationNode";
46 size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf
) const override
;
47 size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf
) const override
;
50 explicit MediaStreamAudioDestinationNode(AudioContext
* aContext
);
51 ~MediaStreamAudioDestinationNode() = default;
53 RefPtr
<DOMMediaStream
> mDOMStream
;
56 } // namespace mozilla::dom