- Add a SetPriority method to ThreadWrapper
- Remove 'priority' from CreateThread and related member variables from implementations - Make supplying a name for threads, non-optional BUG= R=magjed@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44729004 Cr-Commit-Position: refs/heads/master@{#8810} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8810 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -1365,10 +1365,8 @@ int32_t AudioDeviceLinuxALSA::StartRecording()
|
||||
}
|
||||
// RECORDING
|
||||
const char* threadName = "webrtc_audio_module_capture_thread";
|
||||
_ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc,
|
||||
this,
|
||||
kRealtimePriority,
|
||||
threadName);
|
||||
_ptrThreadRec = ThreadWrapper::CreateThread(
|
||||
RecThreadFunc, this, threadName);
|
||||
|
||||
if (!_ptrThreadRec->Start())
|
||||
{
|
||||
@ -1380,6 +1378,7 @@ int32_t AudioDeviceLinuxALSA::StartRecording()
|
||||
_recordingBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
_ptrThreadRec->SetPriority(kRealtimePriority);
|
||||
|
||||
errVal = LATE(snd_pcm_prepare)(_handleRecord);
|
||||
if (errVal < 0)
|
||||
@ -1520,9 +1519,7 @@ int32_t AudioDeviceLinuxALSA::StartPlayout()
|
||||
|
||||
// PLAYOUT
|
||||
const char* threadName = "webrtc_audio_module_play_thread";
|
||||
_ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc,
|
||||
this,
|
||||
kRealtimePriority,
|
||||
_ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc, this,
|
||||
threadName);
|
||||
if (!_ptrThreadPlay->Start())
|
||||
{
|
||||
@ -1534,6 +1531,7 @@ int32_t AudioDeviceLinuxALSA::StartPlayout()
|
||||
_playoutBuffer = NULL;
|
||||
return -1;
|
||||
}
|
||||
_ptrThreadPlay->SetPriority(kRealtimePriority);
|
||||
|
||||
int errVal = LATE(snd_pcm_prepare)(_handlePlayout);
|
||||
if (errVal < 0)
|
||||
|
||||
@ -208,7 +208,7 @@ int32_t AudioDeviceLinuxPulse::Init()
|
||||
// RECORDING
|
||||
const char* threadName = "webrtc_audio_module_rec_thread";
|
||||
_ptrThreadRec = ThreadWrapper::CreateThread(RecThreadFunc, this,
|
||||
kRealtimePriority, threadName);
|
||||
threadName);
|
||||
if (!_ptrThreadRec->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
@ -218,10 +218,12 @@ int32_t AudioDeviceLinuxPulse::Init()
|
||||
return -1;
|
||||
}
|
||||
|
||||
_ptrThreadRec->SetPriority(kRealtimePriority);
|
||||
|
||||
// PLAYOUT
|
||||
threadName = "webrtc_audio_module_play_thread";
|
||||
_ptrThreadPlay = ThreadWrapper::CreateThread(PlayThreadFunc, this,
|
||||
kRealtimePriority, threadName);
|
||||
threadName);
|
||||
if (!_ptrThreadPlay->Start())
|
||||
{
|
||||
WEBRTC_TRACE(kTraceCritical, kTraceAudioDevice, _id,
|
||||
@ -230,6 +232,7 @@ int32_t AudioDeviceLinuxPulse::Init()
|
||||
_ptrThreadPlay.reset();
|
||||
return -1;
|
||||
}
|
||||
_ptrThreadPlay->SetPriority(kRealtimePriority);
|
||||
|
||||
_initialized = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user