Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: voice_engine/voe_base_impl.cc

Issue 3019513002: Remove the VoiceEngineObserver callback interface. (Closed)
Patch Set: rebase + build error Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: voice_engine/voe_base_impl.cc
diff --git a/voice_engine/voe_base_impl.cc b/voice_engine/voe_base_impl.cc
index 76dd55a0c44e06ed63bc9ac6c2d0e1e1b276ccb4..30842c5e41d4aed438194bf6a6cde9caadd0279a 100644
--- a/voice_engine/voe_base_impl.cc
+++ b/voice_engine/voe_base_impl.cc
@@ -35,8 +35,7 @@ VoEBase* VoEBase::GetInterface(VoiceEngine* voiceEngine) {
}
VoEBaseImpl::VoEBaseImpl(voe::SharedData* shared)
- : voiceEngineObserverPtr_(nullptr),
- shared_(shared) {}
+ : shared_(shared) {}
VoEBaseImpl::~VoEBaseImpl() {
TerminateInternal();
@@ -44,34 +43,20 @@ VoEBaseImpl::~VoEBaseImpl() {
void VoEBaseImpl::OnErrorIsReported(const ErrorCode error) {
rtc::CritScope cs(&callbackCritSect_);
- int errCode = 0;
if (error == AudioDeviceObserver::kRecordingError) {
- errCode = VE_RUNTIME_REC_ERROR;
LOG_F(LS_ERROR) << "VE_RUNTIME_REC_ERROR";
} else if (error == AudioDeviceObserver::kPlayoutError) {
- errCode = VE_RUNTIME_PLAY_ERROR;
LOG_F(LS_ERROR) << "VE_RUNTIME_PLAY_ERROR";
}
- if (voiceEngineObserverPtr_) {
- // Deliver callback (-1 <=> no channel dependency)
- voiceEngineObserverPtr_->CallbackOnError(-1, errCode);
- }
}
void VoEBaseImpl::OnWarningIsReported(const WarningCode warning) {
rtc::CritScope cs(&callbackCritSect_);
- int warningCode = 0;
if (warning == AudioDeviceObserver::kRecordingWarning) {
- warningCode = VE_RUNTIME_REC_WARNING;
LOG_F(LS_WARNING) << "VE_RUNTIME_REC_WARNING";
} else if (warning == AudioDeviceObserver::kPlayoutWarning) {
- warningCode = VE_RUNTIME_PLAY_WARNING;
LOG_F(LS_WARNING) << "VE_RUNTIME_PLAY_WARNING";
}
- if (voiceEngineObserverPtr_) {
- // Deliver callback (-1 <=> no channel dependency)
- voiceEngineObserverPtr_->CallbackOnError(-1, warningCode);
- }
}
int32_t VoEBaseImpl::RecordedDataIsAvailable(
@@ -175,45 +160,6 @@ void VoEBaseImpl::PullRenderData(int bits_per_sample,
RTC_NOTREACHED();
}
-int VoEBaseImpl::RegisterVoiceEngineObserver(VoiceEngineObserver& observer) {
- rtc::CritScope cs(&callbackCritSect_);
- if (voiceEngineObserverPtr_) {
- shared_->SetLastError(
- VE_INVALID_OPERATION, kTraceError,
- "RegisterVoiceEngineObserver() observer already enabled");
- return -1;
- }
-
- // Register the observer in all active channels
- for (voe::ChannelManager::Iterator it(&shared_->channel_manager());
- it.IsValid(); it.Increment()) {
- it.GetChannel()->RegisterVoiceEngineObserver(observer);
- }
-
- shared_->transmit_mixer()->RegisterVoiceEngineObserver(observer);
- voiceEngineObserverPtr_ = &observer;
- return 0;
-}
-
-int VoEBaseImpl::DeRegisterVoiceEngineObserver() {
- rtc::CritScope cs(&callbackCritSect_);
- if (!voiceEngineObserverPtr_) {
- shared_->SetLastError(
- VE_INVALID_OPERATION, kTraceError,
- "DeRegisterVoiceEngineObserver() observer already disabled");
- return 0;
- }
- voiceEngineObserverPtr_ = nullptr;
-
- // Deregister the observer in all active channels
- for (voe::ChannelManager::Iterator it(&shared_->channel_manager());
- it.IsValid(); it.Increment()) {
- it.GetChannel()->DeRegisterVoiceEngineObserver();
- }
-
- return 0;
-}
-
int VoEBaseImpl::Init(
AudioDeviceModule* external_adm,
AudioProcessing* audio_processing,
@@ -411,8 +357,7 @@ int VoEBaseImpl::InitializeChannel(voe::ChannelOwner* channel_owner) {
if (channel_owner->channel()->SetEngineInformation(
shared_->statistics(),
*shared_->process_thread(), *shared_->audio_device(),
- voiceEngineObserverPtr_, &callbackCritSect_,
- shared_->encoder_queue()) != 0) {
+ &callbackCritSect_, shared_->encoder_queue()) != 0) {
shared_->SetLastError(
VE_CHANNEL_NOT_CREATED, kTraceError,
"CreateChannel() failed to associate engine and channel."
« no previous file with comments | « voice_engine/voe_base_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698