Bug 1100409 - Uninline AudioNodeStream constructor to avoid requiring AudioNodeEngine.h. r=padenot, a=lsblakk
authorKarl Tomlinson <karlt+@karlt.net>
Fri, 21 Nov 2014 08:41:18 +1300
changeset 234112 f6726a81435109887c163c6afa89136af3ea8fe2
parent 234111 f11fea48f8441d5737f6c4ab085429b60a1bfeb0
child 234113 d21e91a547d8b5e2254046ea25a095216af2b354
push id1
push usersledru@mozilla.com
push dateThu, 04 Dec 2014 17:57:20 +0000
reviewerspadenot, lsblakk
bugs1100409
milestone35.0
Bug 1100409 - Uninline AudioNodeStream constructor to avoid requiring AudioNodeEngine.h. r=padenot, a=lsblakk
content/media/webaudio/AudioNodeStream.cpp
content/media/webaudio/AudioNodeStream.h
--- 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.