2013-01-14 02:46:57 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef MOZILLA_AUDIONODEENGINE_H_
|
|
|
|
#define MOZILLA_AUDIONODEENGINE_H_
|
|
|
|
|
|
|
|
#include "AudioSegment.h"
|
2013-05-24 21:09:29 +04:00
|
|
|
#include "mozilla/dom/AudioNode.h"
|
2014-01-04 22:15:41 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2013-04-24 20:13:45 +04:00
|
|
|
#include "mozilla/Mutex.h"
|
2013-01-14 02:46:57 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2013-03-12 19:16:42 +04:00
|
|
|
namespace dom {
|
|
|
|
struct ThreeDPoint;
|
2013-09-06 00:25:17 +04:00
|
|
|
class AudioParamTimeline;
|
2013-08-26 21:19:36 +04:00
|
|
|
class DelayNodeEngine;
|
2013-03-12 19:16:42 +04:00
|
|
|
}
|
|
|
|
|
2013-01-14 02:46:57 +04:00
|
|
|
class AudioNodeStream;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This class holds onto a set of immutable channel buffers. The storage
|
|
|
|
* for the buffers must be malloced, but the buffer pointers and the malloc
|
|
|
|
* pointers can be different (e.g. if the buffers are contained inside
|
|
|
|
* some malloced object).
|
|
|
|
*/
|
|
|
|
class ThreadSharedFloatArrayBufferList : public ThreadSharedObject {
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Construct with null data.
|
|
|
|
*/
|
2014-09-01 07:50:23 +04:00
|
|
|
explicit ThreadSharedFloatArrayBufferList(uint32_t aCount)
|
2013-01-14 02:46:57 +04:00
|
|
|
{
|
|
|
|
mContents.SetLength(aCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Storage {
|
2014-10-07 12:03:00 +04:00
|
|
|
Storage() :
|
|
|
|
mDataToFree(nullptr),
|
|
|
|
mFree(nullptr),
|
|
|
|
mSampleData(nullptr)
|
|
|
|
{}
|
|
|
|
~Storage() {
|
|
|
|
if (mFree) {
|
|
|
|
mFree(mDataToFree);
|
|
|
|
} else { MOZ_ASSERT(!mDataToFree); }
|
2013-01-14 02:46:57 +04:00
|
|
|
}
|
2014-04-13 22:08:10 +04:00
|
|
|
size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
|
|
|
{
|
|
|
|
// NB: mSampleData might not be owned, if it is it just points to
|
|
|
|
// mDataToFree.
|
|
|
|
return aMallocSizeOf(mDataToFree);
|
|
|
|
}
|
2013-01-14 02:46:57 +04:00
|
|
|
void* mDataToFree;
|
2014-10-07 12:03:00 +04:00
|
|
|
void (*mFree)(void*);
|
2013-01-14 02:46:57 +04:00
|
|
|
const float* mSampleData;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This can be called on any thread.
|
|
|
|
*/
|
|
|
|
uint32_t GetChannels() const { return mContents.Length(); }
|
|
|
|
/**
|
|
|
|
* This can be called on any thread.
|
|
|
|
*/
|
|
|
|
const float* GetData(uint32_t aIndex) const { return mContents[aIndex].mSampleData; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Call this only during initialization, before the object is handed to
|
|
|
|
* any other thread.
|
|
|
|
*/
|
2014-10-07 12:03:00 +04:00
|
|
|
void SetData(uint32_t aIndex, void* aDataToFree, void (*aFreeFunc)(void*), const float* aData)
|
2013-01-14 02:46:57 +04:00
|
|
|
{
|
|
|
|
Storage* s = &mContents[aIndex];
|
2014-10-07 12:03:00 +04:00
|
|
|
if (s->mFree) {
|
|
|
|
s->mFree(s->mDataToFree);
|
|
|
|
} else {
|
|
|
|
MOZ_ASSERT(!s->mDataToFree);
|
|
|
|
}
|
|
|
|
|
2013-01-14 02:46:57 +04:00
|
|
|
s->mDataToFree = aDataToFree;
|
2014-10-07 12:03:00 +04:00
|
|
|
s->mFree = aFreeFunc;
|
2013-01-14 02:46:57 +04:00
|
|
|
s->mSampleData = aData;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Put this object into an error state where there are no channels.
|
|
|
|
*/
|
|
|
|
void Clear() { mContents.Clear(); }
|
|
|
|
|
2014-04-13 22:08:10 +04:00
|
|
|
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
|
2014-01-04 22:15:41 +04:00
|
|
|
{
|
2014-04-13 22:08:10 +04:00
|
|
|
size_t amount = ThreadSharedObject::SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
amount += mContents.SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
for (size_t i = 0; i < mContents.Length(); i++) {
|
|
|
|
amount += mContents[i].SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return amount;
|
2014-01-04 22:15:41 +04:00
|
|
|
}
|
|
|
|
|
2014-05-01 21:37:54 +04:00
|
|
|
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
|
|
|
|
{
|
|
|
|
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
2013-01-14 02:46:57 +04:00
|
|
|
private:
|
|
|
|
AutoFallibleTArray<Storage,2> mContents;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocates an AudioChunk with fresh buffers of WEBAUDIO_BLOCK_SIZE float samples.
|
|
|
|
* AudioChunk::mChannelData's entries can be cast to float* for writing.
|
|
|
|
*/
|
|
|
|
void AllocateAudioBlock(uint32_t aChannelCount, AudioChunk* aChunk);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* aChunk must have been allocated by AllocateAudioBlock.
|
|
|
|
*/
|
|
|
|
void WriteZeroesToAudioBlock(AudioChunk* aChunk, uint32_t aStart, uint32_t aLength);
|
|
|
|
|
2013-07-26 05:35:22 +04:00
|
|
|
/**
|
|
|
|
* Copy with scale. aScale == 1.0f should be optimized.
|
|
|
|
*/
|
|
|
|
void AudioBufferCopyWithScale(const float* aInput,
|
|
|
|
float aScale,
|
|
|
|
float* aOutput,
|
|
|
|
uint32_t aSize);
|
|
|
|
|
2013-06-11 00:09:01 +04:00
|
|
|
/**
|
|
|
|
* Pointwise multiply-add operation. aScale == 1.0f should be optimized.
|
|
|
|
*/
|
|
|
|
void AudioBufferAddWithScale(const float* aInput,
|
|
|
|
float aScale,
|
|
|
|
float* aOutput,
|
|
|
|
uint32_t aSize);
|
|
|
|
|
2013-01-14 02:46:57 +04:00
|
|
|
/**
|
|
|
|
* Pointwise multiply-add operation. aScale == 1.0f should be optimized.
|
|
|
|
*/
|
|
|
|
void AudioBlockAddChannelWithScale(const float aInput[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aScale,
|
|
|
|
float aOutput[WEBAUDIO_BLOCK_SIZE]);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pointwise copy-scaled operation. aScale == 1.0f should be optimized.
|
2013-04-23 05:59:51 +04:00
|
|
|
*
|
|
|
|
* Buffer size is implicitly assumed to be WEBAUDIO_BLOCK_SIZE.
|
2013-01-14 02:46:57 +04:00
|
|
|
*/
|
2013-04-23 05:59:51 +04:00
|
|
|
void AudioBlockCopyChannelWithScale(const float* aInput,
|
2013-01-14 02:46:57 +04:00
|
|
|
float aScale,
|
2013-04-23 05:59:51 +04:00
|
|
|
float* aOutput);
|
2013-01-14 02:46:57 +04:00
|
|
|
|
2013-01-30 03:37:51 +04:00
|
|
|
/**
|
|
|
|
* Vector copy-scaled operation.
|
|
|
|
*/
|
|
|
|
void AudioBlockCopyChannelWithScale(const float aInput[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
const float aScale[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutput[WEBAUDIO_BLOCK_SIZE]);
|
|
|
|
|
2013-06-11 00:08:21 +04:00
|
|
|
/**
|
|
|
|
* Vector complex multiplication on arbitrary sized buffers.
|
|
|
|
*/
|
|
|
|
void BufferComplexMultiply(const float* aInput,
|
|
|
|
const float* aScale,
|
|
|
|
float* aOutput,
|
|
|
|
uint32_t aSize);
|
|
|
|
|
2013-09-10 21:54:17 +04:00
|
|
|
/**
|
|
|
|
* Vector maximum element magnitude ( max(abs(aInput)) ).
|
|
|
|
*/
|
|
|
|
float AudioBufferPeakValue(const float* aInput, uint32_t aSize);
|
|
|
|
|
2013-03-21 20:45:53 +04:00
|
|
|
/**
|
|
|
|
* In place gain. aScale == 1.0f should be optimized.
|
|
|
|
*/
|
2014-01-08 07:57:26 +04:00
|
|
|
void AudioBlockInPlaceScale(float aBlock[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aScale);
|
2013-06-11 00:09:01 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* In place gain. aScale == 1.0f should be optimized.
|
|
|
|
*/
|
|
|
|
void AudioBufferInPlaceScale(float* aBlock,
|
|
|
|
float aScale,
|
|
|
|
uint32_t aSize);
|
2013-03-21 20:45:53 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Upmix a mono input to a stereo output, scaling the two output channels by two
|
|
|
|
* different gain value.
|
|
|
|
* This algorithm is specified in the WebAudio spec.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
AudioBlockPanMonoToStereo(const float aInput[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainL, float aGainR,
|
|
|
|
float aOutputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputR[WEBAUDIO_BLOCK_SIZE]);
|
2014-11-19 20:15:13 +03:00
|
|
|
|
|
|
|
void
|
|
|
|
AudioBlockPanMonoToStereo(const float aInput[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainR[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputR[WEBAUDIO_BLOCK_SIZE]);
|
2013-03-21 20:45:53 +04:00
|
|
|
/**
|
|
|
|
* Pan a stereo source according to right and left gain, and the position
|
|
|
|
* (whether the listener is on the left of the source or not).
|
|
|
|
* This algorithm is specified in the WebAudio spec.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
const float aInputR[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainL, float aGainR, bool aIsOnTheLeft,
|
|
|
|
float aOutputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputR[WEBAUDIO_BLOCK_SIZE]);
|
2014-11-19 20:15:13 +03:00
|
|
|
void
|
|
|
|
AudioBlockPanStereoToStereo(const float aInputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
const float aInputR[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aGainR[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
bool aIsOnTheLeft[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputL[WEBAUDIO_BLOCK_SIZE],
|
|
|
|
float aOutputR[WEBAUDIO_BLOCK_SIZE]);
|
2013-03-21 20:45:53 +04:00
|
|
|
|
2013-06-11 00:09:01 +04:00
|
|
|
/**
|
|
|
|
* Return the sum of squares of all of the samples in the input.
|
|
|
|
*/
|
|
|
|
float
|
|
|
|
AudioBufferSumOfSquares(const float* aInput, uint32_t aLength);
|
|
|
|
|
2013-01-14 02:46:57 +04:00
|
|
|
/**
|
|
|
|
* All methods of this class and its subclasses are called on the
|
|
|
|
* MediaStreamGraph thread.
|
|
|
|
*/
|
|
|
|
class AudioNodeEngine {
|
|
|
|
public:
|
2013-05-05 19:48:45 +04:00
|
|
|
// This should be compatible with AudioNodeStream::OutputChunks.
|
|
|
|
typedef nsAutoTArray<AudioChunk, 1> OutputChunks;
|
|
|
|
|
2013-04-20 20:16:28 +04:00
|
|
|
explicit AudioNodeEngine(dom::AudioNode* aNode)
|
|
|
|
: mNode(aNode)
|
2013-04-24 20:13:45 +04:00
|
|
|
, mNodeMutex("AudioNodeEngine::mNodeMutex")
|
2013-05-05 19:48:45 +04:00
|
|
|
, mInputCount(aNode ? aNode->NumberOfInputs() : 1)
|
|
|
|
, mOutputCount(aNode ? aNode->NumberOfOutputs() : 0)
|
2013-04-02 00:06:55 +04:00
|
|
|
{
|
2013-05-24 21:09:29 +04:00
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
2013-04-02 00:06:55 +04:00
|
|
|
MOZ_COUNT_CTOR(AudioNodeEngine);
|
|
|
|
}
|
|
|
|
virtual ~AudioNodeEngine()
|
|
|
|
{
|
2013-04-20 20:16:28 +04:00
|
|
|
MOZ_ASSERT(!mNode, "The node reference must be already cleared");
|
2013-04-02 00:06:55 +04:00
|
|
|
MOZ_COUNT_DTOR(AudioNodeEngine);
|
|
|
|
}
|
2013-01-14 02:46:57 +04:00
|
|
|
|
2013-08-26 21:19:36 +04:00
|
|
|
virtual dom::DelayNodeEngine* AsDelayNodeEngine() { return nullptr; }
|
|
|
|
|
2014-09-18 09:20:43 +04:00
|
|
|
virtual void SetStreamTimeParameter(uint32_t aIndex, StreamTime aParam)
|
2013-01-14 02:46:57 +04:00
|
|
|
{
|
|
|
|
NS_ERROR("Invalid SetStreamTimeParameter index");
|
|
|
|
}
|
|
|
|
virtual void SetDoubleParameter(uint32_t aIndex, double aParam)
|
|
|
|
{
|
|
|
|
NS_ERROR("Invalid SetDoubleParameter index");
|
|
|
|
}
|
|
|
|
virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam)
|
|
|
|
{
|
|
|
|
NS_ERROR("Invalid SetInt32Parameter index");
|
|
|
|
}
|
2013-01-29 02:42:27 +04:00
|
|
|
virtual void SetTimelineParameter(uint32_t aIndex,
|
2013-05-24 21:10:08 +04:00
|
|
|
const dom::AudioParamTimeline& aValue,
|
|
|
|
TrackRate aSampleRate)
|
2013-01-29 02:42:27 +04:00
|
|
|
{
|
|
|
|
NS_ERROR("Invalid SetTimelineParameter index");
|
|
|
|
}
|
2013-03-12 19:16:42 +04:00
|
|
|
virtual void SetThreeDPointParameter(uint32_t aIndex,
|
|
|
|
const dom::ThreeDPoint& aValue)
|
|
|
|
{
|
|
|
|
NS_ERROR("Invalid SetThreeDPointParameter index");
|
|
|
|
}
|
2013-01-14 02:46:57 +04:00
|
|
|
virtual void SetBuffer(already_AddRefed<ThreadSharedFloatArrayBufferList> aBuffer)
|
|
|
|
{
|
|
|
|
NS_ERROR("SetBuffer called on engine that doesn't support it");
|
|
|
|
}
|
2013-05-14 08:12:30 +04:00
|
|
|
// This consumes the contents of aData. aData will be emptied after this returns.
|
|
|
|
virtual void SetRawArrayData(nsTArray<float>& aData)
|
|
|
|
{
|
|
|
|
NS_ERROR("SetRawArrayData called on an engine that doesn't support it");
|
|
|
|
}
|
2013-01-14 02:46:57 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Produce the next block of audio samples, given input samples aInput
|
|
|
|
* (the mixed data for input 0).
|
|
|
|
* aInput is guaranteed to have float sample format (if it has samples at all)
|
2013-05-24 21:09:29 +04:00
|
|
|
* and to have been resampled to the sampling rate for the stream, and to have
|
|
|
|
* exactly WEBAUDIO_BLOCK_SIZE samples.
|
2013-01-14 02:46:57 +04:00
|
|
|
* *aFinished is set to false by the caller. If the callee sets it to true,
|
|
|
|
* we'll finish the stream and not call this again.
|
|
|
|
*/
|
2014-03-05 01:09:49 +04:00
|
|
|
virtual void ProcessBlock(AudioNodeStream* aStream,
|
|
|
|
const AudioChunk& aInput,
|
|
|
|
AudioChunk* aOutput,
|
|
|
|
bool* aFinished)
|
2013-01-14 02:46:57 +04:00
|
|
|
{
|
2013-05-05 19:48:45 +04:00
|
|
|
MOZ_ASSERT(mInputCount <= 1 && mOutputCount <= 1);
|
2013-01-14 02:46:57 +04:00
|
|
|
*aOutput = aInput;
|
|
|
|
}
|
2014-03-05 01:06:57 +04:00
|
|
|
/**
|
|
|
|
* Produce the next block of audio samples, before input is provided.
|
2014-03-05 01:09:49 +04:00
|
|
|
* ProcessBlock() will be called later, and it then should not change
|
2014-03-05 01:06:57 +04:00
|
|
|
* aOutput. This is used only for DelayNodeEngine in a feedback loop.
|
|
|
|
*/
|
|
|
|
virtual void ProduceBlockBeforeInput(AudioChunk* aOutput)
|
|
|
|
{
|
|
|
|
NS_NOTREACHED("ProduceBlockBeforeInput called on wrong engine\n");
|
|
|
|
}
|
2013-04-20 20:16:28 +04:00
|
|
|
|
2013-05-05 19:48:45 +04:00
|
|
|
/**
|
|
|
|
* Produce the next block of audio samples, given input samples in the aInput
|
|
|
|
* array. There is one input sample per active port in aInput, in order.
|
2014-03-05 01:09:49 +04:00
|
|
|
* This is the multi-input/output version of ProcessBlock. Only one kind
|
|
|
|
* of ProcessBlock is called on each node, depending on whether the
|
2013-05-05 19:48:45 +04:00
|
|
|
* number of inputs and outputs are both 1 or not.
|
|
|
|
*
|
|
|
|
* aInput is always guaranteed to not contain more input AudioChunks than the
|
|
|
|
* maximum number of inputs for the node. It is the responsibility of the
|
|
|
|
* overrides of this function to make sure they will only add a maximum number
|
|
|
|
* of AudioChunks to aOutput as advertized by the AudioNode implementation.
|
|
|
|
* An engine may choose to produce fewer inputs than advertizes by the
|
|
|
|
* corresponding AudioNode, in which case it will be interpreted as a channel
|
|
|
|
* of silence.
|
|
|
|
*/
|
2014-03-05 01:09:49 +04:00
|
|
|
virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream,
|
|
|
|
const OutputChunks& aInput,
|
|
|
|
OutputChunks& aOutput,
|
|
|
|
bool* aFinished)
|
2013-05-05 19:48:45 +04:00
|
|
|
{
|
|
|
|
MOZ_ASSERT(mInputCount > 1 || mOutputCount > 1);
|
|
|
|
// Only produce one output port, and drop all other input ports.
|
|
|
|
aOutput[0] = aInput[0];
|
|
|
|
}
|
|
|
|
|
2013-04-24 20:13:45 +04:00
|
|
|
Mutex& NodeMutex() { return mNodeMutex;}
|
|
|
|
|
2013-05-02 05:02:31 +04:00
|
|
|
bool HasNode() const
|
|
|
|
{
|
|
|
|
return !!mNode;
|
|
|
|
}
|
|
|
|
|
2013-04-20 20:16:28 +04:00
|
|
|
dom::AudioNode* Node() const
|
|
|
|
{
|
2013-04-24 20:13:45 +04:00
|
|
|
mNodeMutex.AssertCurrentThreadOwns();
|
2013-04-20 20:16:28 +04:00
|
|
|
return mNode;
|
|
|
|
}
|
|
|
|
|
2013-04-28 03:25:23 +04:00
|
|
|
dom::AudioNode* NodeMainThread() const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
return mNode;
|
|
|
|
}
|
|
|
|
|
2013-04-24 20:13:45 +04:00
|
|
|
void ClearNode()
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(NS_IsMainThread());
|
|
|
|
MOZ_ASSERT(mNode != nullptr);
|
|
|
|
mNodeMutex.AssertCurrentThreadOwns();
|
|
|
|
mNode = nullptr;
|
|
|
|
}
|
|
|
|
|
2013-05-05 19:48:45 +04:00
|
|
|
uint16_t InputCount() const { return mInputCount; }
|
|
|
|
uint16_t OutputCount() const { return mOutputCount; }
|
|
|
|
|
2014-04-13 22:08:10 +04:00
|
|
|
virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
|
|
|
|
{
|
|
|
|
// NB: |mNode| is tracked separately so it is excluded here.
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
|
|
|
|
{
|
|
|
|
return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf,
|
|
|
|
AudioNodeSizes& aUsage) const
|
|
|
|
{
|
|
|
|
aUsage.mEngine = SizeOfIncludingThis(aMallocSizeOf);
|
2014-06-20 21:29:10 +04:00
|
|
|
if (HasNode()) {
|
|
|
|
aUsage.mDomNode = mNode->SizeOfIncludingThis(aMallocSizeOf);
|
|
|
|
aUsage.mNodeType = mNode->NodeType();
|
|
|
|
}
|
2014-04-13 22:08:10 +04:00
|
|
|
}
|
|
|
|
|
2013-04-24 20:13:45 +04:00
|
|
|
private:
|
2013-04-20 20:16:28 +04:00
|
|
|
dom::AudioNode* mNode;
|
2013-04-24 20:13:45 +04:00
|
|
|
Mutex mNodeMutex;
|
2013-05-05 19:48:45 +04:00
|
|
|
const uint16_t mInputCount;
|
|
|
|
const uint16_t mOutputCount;
|
2013-01-14 02:46:57 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* MOZILLA_AUDIONODEENGINE_H_ */
|