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

Side by Side Diff: webrtc/voice_engine/voe_base_impl.cc

Issue 1459083007: Open backdoor in VoiceEngineImpl to get at the actual voe::Channel objects from an ID. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: presubmit complaints Created 5 years 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 unified diff | Download patch
« no previous file with comments | « webrtc/voice_engine/voe_base_impl.h ('k') | webrtc/voice_engine/voice_engine.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 29 matching lines...) Expand all
40 VoEBaseImpl::VoEBaseImpl(voe::SharedData* shared) 40 VoEBaseImpl::VoEBaseImpl(voe::SharedData* shared)
41 : voiceEngineObserverPtr_(nullptr), 41 : voiceEngineObserverPtr_(nullptr),
42 callbackCritSect_(*CriticalSectionWrapper::CreateCriticalSection()), 42 callbackCritSect_(*CriticalSectionWrapper::CreateCriticalSection()),
43 shared_(shared) {} 43 shared_(shared) {}
44 44
45 VoEBaseImpl::~VoEBaseImpl() { 45 VoEBaseImpl::~VoEBaseImpl() {
46 TerminateInternal(); 46 TerminateInternal();
47 delete &callbackCritSect_; 47 delete &callbackCritSect_;
48 } 48 }
49 49
50 void VoEBaseImpl::OnErrorIsReported(ErrorCode error) { 50 void VoEBaseImpl::OnErrorIsReported(const ErrorCode error) {
51 CriticalSectionScoped cs(&callbackCritSect_); 51 CriticalSectionScoped cs(&callbackCritSect_);
52 int errCode = 0; 52 int errCode = 0;
53 if (error == AudioDeviceObserver::kRecordingError) { 53 if (error == AudioDeviceObserver::kRecordingError) {
54 errCode = VE_RUNTIME_REC_ERROR; 54 errCode = VE_RUNTIME_REC_ERROR;
55 LOG_F(LS_ERROR) << "VE_RUNTIME_REC_ERROR"; 55 LOG_F(LS_ERROR) << "VE_RUNTIME_REC_ERROR";
56 } else if (error == AudioDeviceObserver::kPlayoutError) { 56 } else if (error == AudioDeviceObserver::kPlayoutError) {
57 errCode = VE_RUNTIME_PLAY_ERROR; 57 errCode = VE_RUNTIME_PLAY_ERROR;
58 LOG_F(LS_ERROR) << "VE_RUNTIME_PLAY_ERROR"; 58 LOG_F(LS_ERROR) << "VE_RUNTIME_PLAY_ERROR";
59 } 59 }
60 if (voiceEngineObserverPtr_) { 60 if (voiceEngineObserverPtr_) {
61 // Deliver callback (-1 <=> no channel dependency) 61 // Deliver callback (-1 <=> no channel dependency)
62 voiceEngineObserverPtr_->CallbackOnError(-1, errCode); 62 voiceEngineObserverPtr_->CallbackOnError(-1, errCode);
63 } 63 }
64 } 64 }
65 65
66 void VoEBaseImpl::OnWarningIsReported(WarningCode warning) { 66 void VoEBaseImpl::OnWarningIsReported(const WarningCode warning) {
67 CriticalSectionScoped cs(&callbackCritSect_); 67 CriticalSectionScoped cs(&callbackCritSect_);
68 int warningCode = 0; 68 int warningCode = 0;
69 if (warning == AudioDeviceObserver::kRecordingWarning) { 69 if (warning == AudioDeviceObserver::kRecordingWarning) {
70 warningCode = VE_RUNTIME_REC_WARNING; 70 warningCode = VE_RUNTIME_REC_WARNING;
71 LOG_F(LS_WARNING) << "VE_RUNTIME_REC_WARNING"; 71 LOG_F(LS_WARNING) << "VE_RUNTIME_REC_WARNING";
72 } else if (warning == AudioDeviceObserver::kPlayoutWarning) { 72 } else if (warning == AudioDeviceObserver::kPlayoutWarning) {
73 warningCode = VE_RUNTIME_PLAY_WARNING; 73 warningCode = VE_RUNTIME_PLAY_WARNING;
74 LOG_F(LS_WARNING) << "VE_RUNTIME_PLAY_WARNING"; 74 LOG_F(LS_WARNING) << "VE_RUNTIME_PLAY_WARNING";
75 } 75 }
76 if (voiceEngineObserverPtr_) { 76 if (voiceEngineObserverPtr_) {
77 // Deliver callback (-1 <=> no channel dependency) 77 // Deliver callback (-1 <=> no channel dependency)
78 voiceEngineObserverPtr_->CallbackOnError(-1, warningCode); 78 voiceEngineObserverPtr_->CallbackOnError(-1, warningCode);
79 } 79 }
80 } 80 }
81 81
82 int32_t VoEBaseImpl::RecordedDataIsAvailable( 82 int32_t VoEBaseImpl::RecordedDataIsAvailable(const void* audioSamples,
83 const void* audioSamples, size_t nSamples, size_t nBytesPerSample, 83 const size_t nSamples,
84 uint8_t nChannels, uint32_t samplesPerSec, uint32_t totalDelayMS, 84 const size_t nBytesPerSample,
85 int32_t clockDrift, uint32_t micLevel, bool keyPressed, 85 const uint8_t nChannels,
86 uint32_t& newMicLevel) { 86 const uint32_t samplesPerSec,
87 const uint32_t totalDelayMS,
88 const int32_t clockDrift,
89 const uint32_t currentMicLevel,
90 const bool keyPressed,
91 uint32_t& newMicLevel) {
87 newMicLevel = static_cast<uint32_t>(ProcessRecordedDataWithAPM( 92 newMicLevel = static_cast<uint32_t>(ProcessRecordedDataWithAPM(
88 nullptr, 0, audioSamples, samplesPerSec, nChannels, nSamples, 93 nullptr, 0, audioSamples, samplesPerSec, nChannels, nSamples,
89 totalDelayMS, clockDrift, micLevel, keyPressed)); 94 totalDelayMS, clockDrift, currentMicLevel, keyPressed));
90 return 0; 95 return 0;
91 } 96 }
92 97
93 int32_t VoEBaseImpl::NeedMorePlayData(size_t nSamples, 98 int32_t VoEBaseImpl::NeedMorePlayData(const size_t nSamples,
94 size_t nBytesPerSample, 99 const size_t nBytesPerSample,
95 uint8_t nChannels, uint32_t samplesPerSec, 100 const uint8_t nChannels,
96 void* audioSamples, size_t& nSamplesOut, 101 const uint32_t samplesPerSec,
102 void* audioSamples,
103 size_t& nSamplesOut,
97 int64_t* elapsed_time_ms, 104 int64_t* elapsed_time_ms,
98 int64_t* ntp_time_ms) { 105 int64_t* ntp_time_ms) {
99 GetPlayoutData(static_cast<int>(samplesPerSec), static_cast<int>(nChannels), 106 GetPlayoutData(static_cast<int>(samplesPerSec), static_cast<int>(nChannels),
100 nSamples, true, audioSamples, 107 nSamples, true, audioSamples,
101 elapsed_time_ms, ntp_time_ms); 108 elapsed_time_ms, ntp_time_ms);
102 nSamplesOut = audioFrame_.samples_per_channel_; 109 nSamplesOut = audioFrame_.samples_per_channel_;
103 return 0; 110 return 0;
104 } 111 }
105 112
106 int VoEBaseImpl::OnDataAvailable(const int voe_channels[], 113 int VoEBaseImpl::OnDataAvailable(const int voe_channels[],
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
860 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError, 867 shared_->SetLastError(VE_CHANNEL_NOT_VALID, kTraceError,
861 "AssociateSendChannel() failed to locate accociate_send_channel"); 868 "AssociateSendChannel() failed to locate accociate_send_channel");
862 return -1; 869 return -1;
863 } 870 }
864 871
865 channel_ptr->set_associate_send_channel(ch); 872 channel_ptr->set_associate_send_channel(ch);
866 return 0; 873 return 0;
867 } 874 }
868 875
869 } // namespace webrtc 876 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/voice_engine/voe_base_impl.h ('k') | webrtc/voice_engine/voice_engine.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698