Remove unnecessary fields from VoE SharedData.
BUG=webrtc:4690 Review URL: https://codereview.webrtc.org/1304933008 Cr-Commit-Position: refs/heads/master@{#9882}
This commit is contained in:
@ -29,9 +29,7 @@ SharedData::SharedData(const Config& config) :
|
||||
_channelManager(_gInstanceCounter, config),
|
||||
_engineStatistics(_gInstanceCounter),
|
||||
_audioDevicePtr(NULL),
|
||||
_moduleProcessThreadPtr(ProcessThread::Create()),
|
||||
_externalRecording(false),
|
||||
_externalPlayout(false)
|
||||
_moduleProcessThreadPtr(ProcessThread::Create())
|
||||
{
|
||||
Trace::CreateTrace();
|
||||
if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0)
|
||||
|
@ -44,10 +44,6 @@ public:
|
||||
TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
|
||||
OutputMixer* output_mixer() { return _outputMixerPtr; }
|
||||
CriticalSectionWrapper* crit_sec() { return _apiCritPtr; }
|
||||
bool ext_recording() const { return _externalRecording; }
|
||||
void set_ext_recording(bool value) { _externalRecording = value; }
|
||||
bool ext_playout() const { return _externalPlayout; }
|
||||
void set_ext_playout(bool value) { _externalPlayout = value; }
|
||||
ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); }
|
||||
AudioDeviceModule::AudioLayer audio_device_layer() const {
|
||||
return _audioDeviceLayer;
|
||||
@ -76,9 +72,6 @@ protected:
|
||||
rtc::scoped_ptr<AudioProcessing> audioproc_;
|
||||
rtc::scoped_ptr<ProcessThread> _moduleProcessThreadPtr;
|
||||
|
||||
bool _externalRecording;
|
||||
bool _externalPlayout;
|
||||
|
||||
AudioDeviceModule::AudioLayer _audioDeviceLayer;
|
||||
|
||||
SharedData(const Config& config);
|
||||
|
@ -642,10 +642,7 @@ int32_t VoEBaseImpl::AddExternalTransportBuild(char* str) const {
|
||||
int VoEBaseImpl::LastError() { return (shared_->statistics().LastError()); }
|
||||
|
||||
int32_t VoEBaseImpl::StartPlayout() {
|
||||
if (shared_->audio_device()->Playing()) {
|
||||
return 0;
|
||||
}
|
||||
if (!shared_->ext_playout()) {
|
||||
if (!shared_->audio_device()->Playing()) {
|
||||
if (shared_->audio_device()->InitPlayout() != 0) {
|
||||
LOG_F(LS_ERROR) << "Failed to initialize playout";
|
||||
return -1;
|
||||
@ -671,10 +668,7 @@ int32_t VoEBaseImpl::StopPlayout() {
|
||||
}
|
||||
|
||||
int32_t VoEBaseImpl::StartSend() {
|
||||
if (shared_->audio_device()->Recording()) {
|
||||
return 0;
|
||||
}
|
||||
if (!shared_->ext_recording()) {
|
||||
if (!shared_->audio_device()->Recording()) {
|
||||
if (shared_->audio_device()->InitRecording() != 0) {
|
||||
LOG_F(LS_ERROR) << "Failed to initialize recording";
|
||||
return -1;
|
||||
@ -684,7 +678,6 @@ int32_t VoEBaseImpl::StartSend() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -396,10 +396,7 @@ int VoEFileImpl::StartRecordingMicrophone(const char* fileNameUTF8,
|
||||
"StartRecordingMicrophone() failed to start recording");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->Recording()) {
|
||||
return 0;
|
||||
}
|
||||
if (!_shared->ext_recording()) {
|
||||
if (!_shared->audio_device()->Recording()) {
|
||||
if (_shared->audio_device()->InitRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"StartRecordingMicrophone() failed to initialize recording");
|
||||
@ -429,10 +426,7 @@ int VoEFileImpl::StartRecordingMicrophone(OutStream* stream,
|
||||
"StartRecordingMicrophone() failed to start recording");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->Recording()) {
|
||||
return 0;
|
||||
}
|
||||
if (!_shared->ext_recording()) {
|
||||
if (!_shared->audio_device()->Recording()) {
|
||||
if (_shared->audio_device()->InitRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"StartRecordingMicrophone() failed to initialize recording");
|
||||
|
@ -357,21 +357,19 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
|
||||
|
||||
// Restore recording if it was enabled already when calling this function.
|
||||
if (isRecording) {
|
||||
if (!_shared->ext_recording()) {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() recording is now being restored...");
|
||||
if (_shared->audio_device()->InitRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() failed to initialize recording");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->StartRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() failed to start recording");
|
||||
return -1;
|
||||
}
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() recording is now being restored...");
|
||||
if (_shared->audio_device()->InitRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() failed to initialize recording");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->StartRecording() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetRecordingDevice() failed to start recording");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -445,21 +443,19 @@ int VoEHardwareImpl::SetPlayoutDevice(int index) {
|
||||
|
||||
// Restore playout if it was enabled already when calling this function.
|
||||
if (isPlaying) {
|
||||
if (!_shared->ext_playout()) {
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() playout is now being restored...");
|
||||
if (_shared->audio_device()->InitPlayout() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() failed to initialize playout");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->StartPlayout() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() failed to start playout");
|
||||
return -1;
|
||||
}
|
||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() playout is now being restored...");
|
||||
if (_shared->audio_device()->InitPlayout() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() failed to initialize playout");
|
||||
return -1;
|
||||
}
|
||||
if (_shared->audio_device()->StartPlayout() != 0) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVoice,
|
||||
VoEId(_shared->instance_id(), -1),
|
||||
"SetPlayoutDevice() failed to start playout");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user