Bug 1685822 [wpt PR 27117] - [Import Maps] Add tests for rejecting multiple import...
[gecko.git] / dom / media / AudioCaptureTrack.h
blobc4de4b058136f7986ee23b1ec9d0324fcef9d7ae
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/. */
6 #ifndef MOZILLA_AUDIOCAPTURETRACK_H_
7 #define MOZILLA_AUDIOCAPTURETRACK_H_
9 #include "MediaTrackGraph.h"
10 #include "AudioMixer.h"
11 #include <algorithm>
13 namespace mozilla {
15 class AbstractThread;
16 class DOMMediaStream;
18 /**
19 * See MediaTrackGraph::CreateAudioCaptureTrack.
21 class AudioCaptureTrack : public ProcessedMediaTrack,
22 public MixerCallbackReceiver {
23 public:
24 explicit AudioCaptureTrack(TrackRate aRate);
25 virtual ~AudioCaptureTrack();
27 void Start();
29 void ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t aFlags) override;
31 uint32_t NumberOfChannels() const override;
33 protected:
34 void MixerCallback(AudioDataValue* aMixedBuffer, AudioSampleFormat aFormat,
35 uint32_t aChannels, uint32_t aFrames,
36 uint32_t aSampleRate) override;
37 AudioMixer mMixer;
38 bool mStarted;
39 bool mTrackCreated;
41 } // namespace mozilla
43 #endif /* MOZILLA_AUDIOCAPTURETRACK_H_ */