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),
|
_channelManager(_gInstanceCounter, config),
|
||||||
_engineStatistics(_gInstanceCounter),
|
_engineStatistics(_gInstanceCounter),
|
||||||
_audioDevicePtr(NULL),
|
_audioDevicePtr(NULL),
|
||||||
_moduleProcessThreadPtr(ProcessThread::Create()),
|
_moduleProcessThreadPtr(ProcessThread::Create())
|
||||||
_externalRecording(false),
|
|
||||||
_externalPlayout(false)
|
|
||||||
{
|
{
|
||||||
Trace::CreateTrace();
|
Trace::CreateTrace();
|
||||||
if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0)
|
if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0)
|
||||||
|
@ -44,10 +44,6 @@ public:
|
|||||||
TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
|
TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
|
||||||
OutputMixer* output_mixer() { return _outputMixerPtr; }
|
OutputMixer* output_mixer() { return _outputMixerPtr; }
|
||||||
CriticalSectionWrapper* crit_sec() { return _apiCritPtr; }
|
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(); }
|
ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); }
|
||||||
AudioDeviceModule::AudioLayer audio_device_layer() const {
|
AudioDeviceModule::AudioLayer audio_device_layer() const {
|
||||||
return _audioDeviceLayer;
|
return _audioDeviceLayer;
|
||||||
@ -76,9 +72,6 @@ protected:
|
|||||||
rtc::scoped_ptr<AudioProcessing> audioproc_;
|
rtc::scoped_ptr<AudioProcessing> audioproc_;
|
||||||
rtc::scoped_ptr<ProcessThread> _moduleProcessThreadPtr;
|
rtc::scoped_ptr<ProcessThread> _moduleProcessThreadPtr;
|
||||||
|
|
||||||
bool _externalRecording;
|
|
||||||
bool _externalPlayout;
|
|
||||||
|
|
||||||
AudioDeviceModule::AudioLayer _audioDeviceLayer;
|
AudioDeviceModule::AudioLayer _audioDeviceLayer;
|
||||||
|
|
||||||
SharedData(const Config& config);
|
SharedData(const Config& config);
|
||||||
|
@ -642,10 +642,7 @@ int32_t VoEBaseImpl::AddExternalTransportBuild(char* str) const {
|
|||||||
int VoEBaseImpl::LastError() { return (shared_->statistics().LastError()); }
|
int VoEBaseImpl::LastError() { return (shared_->statistics().LastError()); }
|
||||||
|
|
||||||
int32_t VoEBaseImpl::StartPlayout() {
|
int32_t VoEBaseImpl::StartPlayout() {
|
||||||
if (shared_->audio_device()->Playing()) {
|
if (!shared_->audio_device()->Playing()) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!shared_->ext_playout()) {
|
|
||||||
if (shared_->audio_device()->InitPlayout() != 0) {
|
if (shared_->audio_device()->InitPlayout() != 0) {
|
||||||
LOG_F(LS_ERROR) << "Failed to initialize playout";
|
LOG_F(LS_ERROR) << "Failed to initialize playout";
|
||||||
return -1;
|
return -1;
|
||||||
@ -671,10 +668,7 @@ int32_t VoEBaseImpl::StopPlayout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t VoEBaseImpl::StartSend() {
|
int32_t VoEBaseImpl::StartSend() {
|
||||||
if (shared_->audio_device()->Recording()) {
|
if (!shared_->audio_device()->Recording()) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!shared_->ext_recording()) {
|
|
||||||
if (shared_->audio_device()->InitRecording() != 0) {
|
if (shared_->audio_device()->InitRecording() != 0) {
|
||||||
LOG_F(LS_ERROR) << "Failed to initialize recording";
|
LOG_F(LS_ERROR) << "Failed to initialize recording";
|
||||||
return -1;
|
return -1;
|
||||||
@ -684,7 +678,6 @@ int32_t VoEBaseImpl::StartSend() {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -396,10 +396,7 @@ int VoEFileImpl::StartRecordingMicrophone(const char* fileNameUTF8,
|
|||||||
"StartRecordingMicrophone() failed to start recording");
|
"StartRecordingMicrophone() failed to start recording");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (_shared->audio_device()->Recording()) {
|
if (!_shared->audio_device()->Recording()) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!_shared->ext_recording()) {
|
|
||||||
if (_shared->audio_device()->InitRecording() != 0) {
|
if (_shared->audio_device()->InitRecording() != 0) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"StartRecordingMicrophone() failed to initialize recording");
|
"StartRecordingMicrophone() failed to initialize recording");
|
||||||
@ -429,10 +426,7 @@ int VoEFileImpl::StartRecordingMicrophone(OutStream* stream,
|
|||||||
"StartRecordingMicrophone() failed to start recording");
|
"StartRecordingMicrophone() failed to start recording");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (_shared->audio_device()->Recording()) {
|
if (!_shared->audio_device()->Recording()) {
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
if (!_shared->ext_recording()) {
|
|
||||||
if (_shared->audio_device()->InitRecording() != 0) {
|
if (_shared->audio_device()->InitRecording() != 0) {
|
||||||
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceError, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"StartRecordingMicrophone() failed to initialize recording");
|
"StartRecordingMicrophone() failed to initialize recording");
|
||||||
|
@ -357,7 +357,6 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
|
|||||||
|
|
||||||
// Restore recording if it was enabled already when calling this function.
|
// Restore recording if it was enabled already when calling this function.
|
||||||
if (isRecording) {
|
if (isRecording) {
|
||||||
if (!_shared->ext_recording()) {
|
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"SetRecordingDevice() recording is now being restored...");
|
"SetRecordingDevice() recording is now being restored...");
|
||||||
if (_shared->audio_device()->InitRecording() != 0) {
|
if (_shared->audio_device()->InitRecording() != 0) {
|
||||||
@ -373,7 +372,6 @@ int VoEHardwareImpl::SetRecordingDevice(int index,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -445,7 +443,6 @@ int VoEHardwareImpl::SetPlayoutDevice(int index) {
|
|||||||
|
|
||||||
// Restore playout if it was enabled already when calling this function.
|
// Restore playout if it was enabled already when calling this function.
|
||||||
if (isPlaying) {
|
if (isPlaying) {
|
||||||
if (!_shared->ext_playout()) {
|
|
||||||
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_shared->instance_id(), -1),
|
||||||
"SetPlayoutDevice() playout is now being restored...");
|
"SetPlayoutDevice() playout is now being restored...");
|
||||||
if (_shared->audio_device()->InitPlayout() != 0) {
|
if (_shared->audio_device()->InitPlayout() != 0) {
|
||||||
@ -461,7 +458,6 @@ int VoEHardwareImpl::SetPlayoutDevice(int index) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user