Bug 1201393. Remove irrelevant ProcessedMediaStream for nsSpeechTask. r=eitan

--HG--
extra : commitid : CuwvyZLm6ch
extra : rebase_source : 79b50e27404eb4d069fceabca6f91d883b1ef277
This commit is contained in:
Robert O'Callahan 2015-09-01 16:49:50 +12:00
Родитель 49d3b935f2
Коммит c642f85a62
4 изменённых файлов: 16 добавлений и 26 удалений

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

@ -140,15 +140,19 @@ nsSpeechTask::~nsSpeechTask()
}
void
nsSpeechTask::Init(ProcessedMediaStream* aStream)
nsSpeechTask::InitDirectAudio()
{
if (aStream) {
mStream = aStream->Graph()->CreateSourceStream(nullptr);
mPort = aStream->AllocateInputPort(mStream, 0);
mIndirectAudio = false;
} else {
mIndirectAudio = true;
}
mStream = MediaStreamGraph::GetInstance(MediaStreamGraph::AUDIO_THREAD_DRIVER,
AudioChannel::Normal)->
CreateSourceStream(nullptr);
mIndirectAudio = false;
mInited = true;
}
void
nsSpeechTask::InitIndirectAudio()
{
mIndirectAudio = true;
mInited = true;
}

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

@ -48,7 +48,8 @@ public:
void SetSpeechSynthesis(SpeechSynthesis* aSpeechSynthesis);
void Init(ProcessedMediaStream* aStream);
void InitDirectAudio();
void InitIndirectAudio();
void SetChosenVoiceURI(const nsAString& aUri);

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

@ -177,14 +177,6 @@ nsSynthVoiceRegistry::~nsSynthVoiceRegistry()
// mSpeechSynthChild's lifecycle is managed by the Content protocol.
mSpeechSynthChild = nullptr;
if (mStream) {
if (!mStream->IsDestroyed()) {
mStream->Destroy();
}
mStream = nullptr;
}
mUriVoiceMap.Clear();
}
@ -775,14 +767,9 @@ nsSynthVoiceRegistry::SpeakImpl(VoiceData* aVoice,
NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "Failed to get speech service type");
if (serviceType == nsISpeechService::SERVICETYPE_INDIRECT_AUDIO) {
aTask->Init(nullptr);
aTask->InitIndirectAudio();
} else {
if (!mStream) {
mStream =
MediaStreamGraph::GetInstance(MediaStreamGraph::AUDIO_THREAD_DRIVER,
AudioChannel::Normal)->CreateTrackUnionStream(nullptr);
}
aTask->Init(mStream);
aTask->InitDirectAudio();
}
aVoice->mService->Speak(aText, aVoice->mUri, aVolume, aRate, aPitch, aTask);

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

@ -95,8 +95,6 @@ private:
SpeechSynthesisChild* mSpeechSynthChild;
nsRefPtr<ProcessedMediaStream> mStream;
bool mUseGlobalQueue;
nsTArray<nsRefPtr<GlobalQueueItem>> mGlobalQueue;