Bug 1100409 - Uninline AudioNodeStream constructor to avoid requiring AudioNodeEngine.h. r=padenot, a=lsblakk
--- a/content/media/webaudio/AudioNodeStream.cpp
+++ b/content/media/webaudio/AudioNodeStream.cpp
@@ -20,16 +20,36 @@ namespace mozilla {
* An AudioNodeStream produces a single audio track with ID
* AUDIO_TRACK. This track has rate AudioContext::sIdealAudioRate
* for regular audio contexts, and the rate requested by the web content
* for offline audio contexts.
* Each chunk in the track is a single block of WEBAUDIO_BLOCK_SIZE samples.
* Note: This must be a different value than MEDIA_STREAM_DEST_TRACK_ID
*/
+AudioNodeStream::AudioNodeStream(AudioNodeEngine* aEngine,
+ MediaStreamGraph::AudioNodeStreamKind aKind,
+ TrackRate aSampleRate)
+ : ProcessedMediaStream(nullptr),
+ mEngine(aEngine),
+ mSampleRate(aSampleRate),
+ mKind(aKind),
+ mNumberOfInputChannels(2),
+ mMarkAsFinishedAfterThisBlock(false),
+ mAudioParamStream(false),
+ mPassThrough(false)
+{
+ MOZ_ASSERT(NS_IsMainThread());
+ mChannelCountMode = ChannelCountMode::Max;
+ mChannelInterpretation = ChannelInterpretation::Speakers;
+ // AudioNodes are always producing data
+ mHasCurrentData = true;
+ MOZ_COUNT_CTOR(AudioNodeStream);
+}
+
AudioNodeStream::~AudioNodeStream()
{
MOZ_COUNT_DTOR(AudioNodeStream);
}
size_t
AudioNodeStream::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
--- a/content/media/webaudio/AudioNodeStream.h
+++ b/content/media/webaudio/AudioNodeStream.h
@@ -42,33 +42,17 @@ public:
typedef nsAutoTArray<AudioChunk, 1> OutputChunks;
/**
* Transfers ownership of aEngine to the new AudioNodeStream.
*/
AudioNodeStream(AudioNodeEngine* aEngine,
MediaStreamGraph::AudioNodeStreamKind aKind,
- TrackRate aSampleRate)
- : ProcessedMediaStream(nullptr),
- mEngine(aEngine),
- mSampleRate(aSampleRate),
- mKind(aKind),
- mNumberOfInputChannels(2),
- mMarkAsFinishedAfterThisBlock(false),
- mAudioParamStream(false),
- mPassThrough(false)
- {
- MOZ_ASSERT(NS_IsMainThread());
- mChannelCountMode = ChannelCountMode::Max;
- mChannelInterpretation = ChannelInterpretation::Speakers;
- // AudioNodes are always producing data
- mHasCurrentData = true;
- MOZ_COUNT_CTOR(AudioNodeStream);
- }
+ TrackRate aSampleRate);
protected:
~AudioNodeStream();
public:
// Control API
/**
* Sets a parameter that's a time relative to some stream's played time.