Backed out 4 changesets (bug 849713) since builds fail because of warnings as errors

Backed out changeset e811d4258d45 (bug 849713)
Backed out changeset 26aa58e87d5d (bug 849713)
Backed out changeset 9a6552161eff (bug 849713)
Backed out changeset 3551877d9b92 (bug 849713)

Landing on a CLOSED TREE
This commit is contained in:
Ehsan Akhgari 2013-03-11 16:14:42 -04:00
Родитель 8034e98ffd
Коммит 8a4a795160
4 изменённых файлов: 12 добавлений и 93 удалений

Просмотреть файл

@ -25,16 +25,7 @@ class AudioBufferSourceNodeEngine : public AudioNodeEngine
{
public:
AudioBufferSourceNodeEngine() :
mStart(0), mStop(TRACK_TICKS_MAX),
mOffset(0), mDuration(0),
mLoop(NotLooping), mLoopStart(0), mLoopEnd(0)
{}
enum LoopState {
NotLooping, // Will never loop
WillLoop, // In loop mode, but has not started to loop yet
IsLooping // Is looping
};
mStart(0), mStop(TRACK_TICKS_MAX), mOffset(0), mDuration(0) {}
// START, OFFSET and DURATION are always set by start() (along with setting
// mBuffer to something non-null).
@ -43,10 +34,7 @@ public:
START,
STOP,
OFFSET,
DURATION,
LOOP,
LOOPSTART,
LOOPEND
DURATION
};
virtual void SetStreamTimeParameter(uint32_t aIndex, TrackTicks aParam)
{
@ -62,9 +50,6 @@ public:
switch (aIndex) {
case OFFSET: mOffset = aParam; break;
case DURATION: mDuration = aParam; break;
case LOOP: mLoop = aParam ? WillLoop: NotLooping; break;
case LOOPSTART: mLoopStart = aParam; break;
case LOOPEND: mLoopEnd = aParam; break;
default:
NS_ERROR("Bad AudioBufferSourceNodeEngine Int32Parameter");
}
@ -74,20 +59,6 @@ public:
mBuffer = aBuffer;
}
void BorrowFromInputBuffer(AudioChunk* aOutput,
uint32_t aChannels,
uintptr_t aBufferOffset)
{
aOutput->mDuration = WEBAUDIO_BLOCK_SIZE;
aOutput->mBuffer = mBuffer;
aOutput->mChannelData.SetLength(aChannels);
for (uint32_t i = 0; i < aChannels; ++i) {
aOutput->mChannelData[i] = mBuffer->GetData(i) + aBufferOffset;
}
aOutput->mVolume = 1.0f;
aOutput->mBufferFormat = AUDIO_FORMAT_FLOAT32;
}
virtual void ProduceAudioBlock(AudioNodeStream* aStream,
const AudioChunk& aInput,
AudioChunk* aOutput,
@ -120,8 +91,15 @@ public:
if (currentPosition >= mStart &&
currentPosition + WEBAUDIO_BLOCK_SIZE <= endTime) {
// Data is entirely within the buffer. Avoid copying it.
BorrowFromInputBuffer(aOutput, channels,
uintptr_t(currentPosition - mStart + mOffset));
aOutput->mDuration = WEBAUDIO_BLOCK_SIZE;
aOutput->mBuffer = mBuffer;
aOutput->mChannelData.SetLength(channels);
for (uint32_t i = 0; i < channels; ++i) {
aOutput->mChannelData[i] =
mBuffer->GetData(i) + uintptr_t(currentPosition - mStart + mOffset);
}
aOutput->mVolume = 1.0f;
aOutput->mBufferFormat = AUDIO_FORMAT_FLOAT32;
return;
}
@ -145,16 +123,10 @@ public:
nsRefPtr<ThreadSharedFloatArrayBufferList> mBuffer;
int32_t mOffset;
int32_t mDuration;
LoopState mLoop;
int32_t mLoopStart;
int32_t mLoopEnd;
};
AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* aContext)
: AudioSourceNode(aContext)
, mLoopStart(0.0)
, mLoopEnd(0.0)
, mLoop(false)
, mStartCalled(false)
{
SetProduceOwnOutput(true);
@ -201,25 +173,6 @@ AudioBufferSourceNode::Start(JSContext* aCx, double aWhen, double aOffset,
return;
}
// Don't compute and set the loop parameters unnecessarily
if (mLoop) {
double actualLoopStart, actualLoopEnd;
if (((mLoopStart != 0.0) || (mLoopEnd != 0.0)) &&
mLoopStart >= 0.0 && mLoopEnd > 0.0 &&
mLoopStart < mLoopEnd) {
actualLoopStart = (mLoopStart > length) ? 0.0 : mLoopStart;
actualLoopEnd = std::min(mLoopEnd, length);
} else {
actualLoopStart = 0.0;
actualLoopEnd = length;
}
int32_t loopStartTicks = NS_lround(actualLoopStart * rate);
int32_t loopEndTicks = NS_lround(actualLoopEnd * rate);
ns->SetInt32Parameter(AudioBufferSourceNodeEngine::LOOP, 1);
ns->SetInt32Parameter(AudioBufferSourceNodeEngine::LOOPSTART, loopStartTicks);
ns->SetInt32Parameter(AudioBufferSourceNodeEngine::LOOPEND, loopEndTicks);
}
ns->SetBuffer(data.forget());
// Don't set parameter unnecessarily
if (aWhen > 0.0) {

Просмотреть файл

@ -51,38 +51,10 @@ public:
mBuffer = aBuffer;
}
bool Loop() const
{
return mLoop;
}
void SetLoop(bool aLoop)
{
mLoop = aLoop;
}
double LoopStart() const
{
return mLoopStart;
}
void SetLoopStart(double aStart)
{
mLoopStart = aStart;
}
double LoopEnd() const
{
return mLoopEnd;
}
void SetLoopEnd(double aEnd)
{
mLoopEnd = aEnd;
}
virtual void NotifyMainThreadStateChanged() MOZ_OVERRIDE;
private:
nsRefPtr<AudioBuffer> mBuffer;
double mLoopStart;
double mLoopEnd;
bool mLoop;
bool mStartCalled;
};

Просмотреть файл

@ -29,9 +29,6 @@ addLoadEvent(function() {
is(source.context, context, "Source node has proper context");
is(source.numberOfInputs, 0, "Source node has 0 inputs");
is(source.numberOfOutputs, 1, "Source node has 1 outputs");
is(source.loop, false, "Source node is not looping");
is(source.loopStart, 0, "Correct default value for loopStart");
is(source.loopEnd, 0, "Correct default value for loopEnd");
ok(!source.buffer, "Source node should not have a buffer when it's created");
source.buffer = buffer;

Просмотреть файл

@ -25,10 +25,7 @@ interface AudioBufferSourceNode : AudioSourceNode {
attribute AudioBuffer? buffer;
//attribute AudioParam playbackRate;
attribute boolean loop;
attribute double loopStart;
attribute double loopEnd;
//attribute boolean loop;
[Throws]
void start(optional double when = 0, optional double grainOffset = 0,