LCOV - code coverage report
Current view: top level - dom/media/webaudio - AudioDestinationNode.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 9 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 8 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 AudioDestinationNode_h_
       8             : #define AudioDestinationNode_h_
       9             : 
      10             : #include "AudioChannelService.h"
      11             : #include "AudioNode.h"
      12             : #include "nsIAudioChannelAgent.h"
      13             : 
      14             : namespace mozilla {
      15             : namespace dom {
      16             : 
      17             : class AudioContext;
      18             : 
      19             : class AudioDestinationNode final : public AudioNode
      20             :                                  , public nsIAudioChannelAgentCallback
      21             :                                  , public MainThreadMediaStreamListener
      22             : {
      23             : public:
      24             :   // This node type knows what MediaStreamGraph to use based on
      25             :   // whether it's in offline mode.
      26             :   AudioDestinationNode(AudioContext* aContext,
      27             :                        bool aIsOffline,
      28             :                        AudioChannel aChannel = AudioChannel::Normal,
      29             :                        uint32_t aNumberOfChannels = 0,
      30             :                        uint32_t aLength = 0,
      31             :                        float aSampleRate = 0.0f);
      32             : 
      33             :   void DestroyMediaStream() override;
      34             : 
      35             :   NS_DECL_ISUPPORTS_INHERITED
      36           0 :   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(AudioDestinationNode, AudioNode)
      37             :   NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK
      38             : 
      39             :   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
      40             : 
      41           0 :   uint16_t NumberOfOutputs() const final override
      42             :   {
      43           0 :     return 0;
      44             :   }
      45             : 
      46             :   uint32_t MaxChannelCount() const;
      47             :   void SetChannelCount(uint32_t aChannelCount,
      48             :                        ErrorResult& aRv) override;
      49             : 
      50             :   // Returns the stream or null after unlink.
      51           0 :   AudioNodeStream* Stream() { return mStream; }
      52             : 
      53             :   void Mute();
      54             :   void Unmute();
      55             : 
      56             :   void Suspend();
      57             :   void Resume();
      58             : 
      59             :   void StartRendering(Promise* aPromise);
      60             : 
      61             :   void OfflineShutdown();
      62             : 
      63             :   AudioChannel MozAudioChannelType() const;
      64             : 
      65             :   void NotifyMainThreadStreamFinished() override;
      66             :   void FireOfflineCompletionEvent();
      67             : 
      68             :   nsresult CreateAudioChannelAgent();
      69             :   void DestroyAudioChannelAgent();
      70             : 
      71           0 :   const char* NodeType() const override
      72             :   {
      73           0 :     return "AudioDestinationNode";
      74             :   }
      75             : 
      76             :   size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const override;
      77             :   size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override;
      78             : 
      79             :   void InputMuted(bool aInputMuted);
      80             :   void ResolvePromise(AudioBuffer* aRenderedBuffer);
      81             : 
      82           0 :   unsigned long Length()
      83             :   {
      84           0 :     MOZ_ASSERT(mIsOffline);
      85           0 :     return mFramesToProduce;
      86             :   }
      87             : 
      88             : protected:
      89             :   virtual ~AudioDestinationNode();
      90             : 
      91             : private:
      92             :   void SetMozAudioChannelType(AudioChannel aValue, ErrorResult& aRv);
      93             :   bool CheckAudioChannelPermissions(AudioChannel aValue);
      94             : 
      95             :   SelfReference<AudioDestinationNode> mOfflineRenderingRef;
      96             :   uint32_t mFramesToProduce;
      97             : 
      98             :   nsCOMPtr<nsIAudioChannelAgent> mAudioChannelAgent;
      99             :   RefPtr<MediaInputPort> mCaptureStreamPort;
     100             : 
     101             :   RefPtr<Promise> mOfflineRenderingPromise;
     102             : 
     103             :   // Audio Channel Type.
     104             :   AudioChannel mAudioChannel;
     105             :   bool mIsOffline;
     106             :   bool mAudioChannelSuspended;
     107             : 
     108             :   bool mCaptured;
     109             :   AudioChannelService::AudibleState mAudible;
     110             : };
     111             : 
     112             : } // namespace dom
     113             : } // namespace mozilla
     114             : 
     115             : #endif
     116             : 

Generated by: LCOV version 1.13