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

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

Issue 2665693002: Moves channel-dependent audio input processing to separate encoder task queue (Closed)
Patch Set: Fixed dependency Created 3 years, 8 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 unified diff | Download patch
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
11 #include "webrtc/voice_engine/shared_data.h" 11 #include "webrtc/voice_engine/shared_data.h"
12 12
13 #include "webrtc/modules/audio_processing/include/audio_processing.h" 13 #include "webrtc/modules/audio_processing/include/audio_processing.h"
14 #include "webrtc/system_wrappers/include/trace.h" 14 #include "webrtc/system_wrappers/include/trace.h"
15 #include "webrtc/voice_engine/channel.h" 15 #include "webrtc/voice_engine/channel.h"
16 #include "webrtc/voice_engine/output_mixer.h" 16 #include "webrtc/voice_engine/output_mixer.h"
17 #include "webrtc/voice_engine/transmit_mixer.h" 17 #include "webrtc/voice_engine/transmit_mixer.h"
18 18
19 #include "webrtc/base/logging.h"
20
19 namespace webrtc { 21 namespace webrtc {
20 22
21 namespace voe { 23 namespace voe {
22 24
23 static int32_t _gInstanceCounter = 0; 25 static int32_t _gInstanceCounter = 0;
24 26
25 SharedData::SharedData() 27 SharedData::SharedData()
26 : _instanceId(++_gInstanceCounter), 28 : _instanceId(++_gInstanceCounter),
27 _channelManager(_gInstanceCounter), 29 _channelManager(_gInstanceCounter),
28 _engineStatistics(_gInstanceCounter), 30 _engineStatistics(_gInstanceCounter),
29 _audioDevicePtr(NULL), 31 _audioDevicePtr(NULL),
30 _moduleProcessThreadPtr( 32 _moduleProcessThreadPtr(ProcessThread::Create("VoiceProcessThread")),
31 ProcessThread::Create("VoiceProcessThread")) { 33 encoder_queue_("AudioEncoderQueue", rtc::TaskQueue::Priority::HIGH) {
tommi 2017/03/28 13:47:20 why high priority? This doesn't work btw on Andro
henrika_webrtc 2017/03/29 10:35:12 Encoding is important and it sounded like a suitab
32 Trace::CreateTrace(); 34 Trace::CreateTrace();
33 if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0) 35 if (OutputMixer::Create(_outputMixerPtr, _gInstanceCounter) == 0) {
34 { 36 _outputMixerPtr->SetEngineInformation(_engineStatistics);
35 _outputMixerPtr->SetEngineInformation(_engineStatistics); 37 }
36 } 38 if (TransmitMixer::Create(_transmitMixerPtr, _gInstanceCounter) == 0) {
37 if (TransmitMixer::Create(_transmitMixerPtr, _gInstanceCounter) == 0) 39 _transmitMixerPtr->SetEngineInformation(*_moduleProcessThreadPtr,
38 { 40 _engineStatistics, _channelManager);
39 _transmitMixerPtr->SetEngineInformation(*_moduleProcessThreadPtr, 41 }
40 _engineStatistics,
41 _channelManager);
42 }
43 } 42 }
44 43
45 SharedData::~SharedData() 44 SharedData::~SharedData()
46 { 45 {
47 OutputMixer::Destroy(_outputMixerPtr); 46 OutputMixer::Destroy(_outputMixerPtr);
48 TransmitMixer::Destroy(_transmitMixerPtr); 47 TransmitMixer::Destroy(_transmitMixerPtr);
49 if (_audioDevicePtr) { 48 if (_audioDevicePtr) {
50 _audioDevicePtr->Release(); 49 _audioDevicePtr->Release();
51 } 50 }
52 _moduleProcessThreadPtr->Stop(); 51 _moduleProcessThreadPtr->Stop();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 99 }
101 100
102 void SharedData::SetLastError(int32_t error, TraceLevel level, 101 void SharedData::SetLastError(int32_t error, TraceLevel level,
103 const char* msg) const { 102 const char* msg) const {
104 _engineStatistics.SetLastError(error, level, msg); 103 _engineStatistics.SetLastError(error, level, msg);
105 } 104 }
106 105
107 } // namespace voe 106 } // namespace voe
108 107
109 } // namespace webrtc 108 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698