tor-browser

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

AudioNodeExternalInputTrack.h (1456B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
      4 * You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #ifndef MOZILLA_AUDIONODEEXTERNALINPUTTRACK_H_
      7 #define MOZILLA_AUDIONODEEXTERNALINPUTTRACK_H_
      8 
      9 #include "AudioNodeTrack.h"
     10 #include "MediaTrackGraph.h"
     11 
     12 namespace mozilla {
     13 
     14 class AbstractThread;
     15 
     16 /**
     17 * This is a MediaTrack implementation that acts for a Web Audio node but
     18 * unlike other AudioNodeTracks, supports any kind of MediaTrack as an
     19 * input --- handling any number of audio tracks and handling blocking of
     20 * the input MediaTrack.
     21 */
     22 class AudioNodeExternalInputTrack final : public AudioNodeTrack {
     23 public:
     24  static already_AddRefed<AudioNodeExternalInputTrack> Create(
     25      MediaTrackGraph* aGraph, AudioNodeEngine* aEngine);
     26 
     27 protected:
     28  AudioNodeExternalInputTrack(AudioNodeEngine* aEngine, TrackRate aSampleRate);
     29  ~AudioNodeExternalInputTrack();
     30 
     31 public:
     32  void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
     33 
     34 private:
     35  /**
     36   * Determines if this is enabled or not.  Disabled nodes produce silence.
     37   * This node becomes disabled if the document principal does not subsume the
     38   * DOMMediaStream principal.
     39   */
     40  bool IsEnabled();
     41 };
     42 
     43 }  // namespace mozilla
     44 
     45 #endif /* MOZILLA_AUDIONODEEXTERNALINPUTTRACK_H_ */