зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1271585: Remove AudioGUM thread from MediaEngine getUserMedia input r=padenot
MozReview-Commit-ID: EhaMVSq54IK
This commit is contained in:
Родитель
f7316b6c57
Коммит
505d7dd5ea
|
@ -127,9 +127,6 @@ MediaEngineWebRTC::MediaEngineWebRTC(MediaEnginePrefs &aPrefs)
|
|||
#endif
|
||||
// XXX
|
||||
gFarendObserver = new AudioOutputObserver();
|
||||
|
||||
NS_NewNamedThread("AudioGUM", getter_AddRefs(mThread));
|
||||
MOZ_ASSERT(mThread);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -410,7 +407,7 @@ MediaEngineWebRTC::EnumerateAudioDevices(dom::MediaSourceEnum aMediaSource,
|
|||
// XXX Small window where the device list/index could change!
|
||||
audioinput = new mozilla::AudioInputCubeb(mVoiceEngine, i);
|
||||
}
|
||||
aSource = new MediaEngineWebRTCMicrophoneSource(mThread, mVoiceEngine, audioinput,
|
||||
aSource = new MediaEngineWebRTCMicrophoneSource(mVoiceEngine, audioinput,
|
||||
i, deviceName, uniqueId);
|
||||
mAudioSources.Put(uuid, aSource); // Hashtable takes ownership.
|
||||
aASources->AppendElement(aSource);
|
||||
|
@ -451,11 +448,6 @@ MediaEngineWebRTC::Shutdown()
|
|||
|
||||
mozilla::camera::Shutdown();
|
||||
AudioInputCubeb::CleanupGlobalData();
|
||||
|
||||
if (mThread) {
|
||||
mThread->Shutdown();
|
||||
mThread = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -416,8 +416,7 @@ class MediaEngineWebRTCMicrophoneSource : public MediaEngineAudioSource,
|
|||
private MediaConstraintsHelper
|
||||
{
|
||||
public:
|
||||
MediaEngineWebRTCMicrophoneSource(nsIThread* aThread,
|
||||
webrtc::VoiceEngine* aVoiceEnginePtr,
|
||||
MediaEngineWebRTCMicrophoneSource(webrtc::VoiceEngine* aVoiceEnginePtr,
|
||||
mozilla::AudioInput* aAudioInput,
|
||||
int aIndex,
|
||||
const char* name,
|
||||
|
@ -426,7 +425,6 @@ public:
|
|||
, mVoiceEngine(aVoiceEnginePtr)
|
||||
, mAudioInput(aAudioInput)
|
||||
, mMonitor("WebRTCMic.Monitor")
|
||||
, mThread(aThread)
|
||||
, mCapIndex(aIndex)
|
||||
, mChannel(-1)
|
||||
, mNrAllocations(0)
|
||||
|
@ -535,7 +533,6 @@ private:
|
|||
Monitor mMonitor;
|
||||
nsTArray<RefPtr<SourceMediaStream>> mSources;
|
||||
nsTArray<PrincipalHandle> mPrincipalHandles; // Maps to mSources.
|
||||
nsCOMPtr<nsIThread> mThread;
|
||||
int mCapIndex;
|
||||
int mChannel;
|
||||
int mNrAllocations; // When this becomes 0, we shut down HW
|
||||
|
|
|
@ -730,11 +730,7 @@ MediaEngineWebRTCMicrophoneSource::Process(int channel,
|
|||
|
||||
// This is safe from any thread, and is safe if the track is Finished
|
||||
// or Destroyed.
|
||||
// Note: due to evil magic, the nsAutoPtr<AudioSegment>'s ownership transfers to
|
||||
// the Runnable (AutoPtr<> = AutoPtr<>)
|
||||
RUN_ON_THREAD(mThread, WrapRunnable(mSources[i], &SourceMediaStream::AppendToTrack,
|
||||
mTrackID, segment, (AudioSegment *) nullptr),
|
||||
NS_DISPATCH_NORMAL);
|
||||
mSources[i]->AppendToTrack(mTrackID, segment);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче