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

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

Issue 2665693002: Moves channel-dependent audio input processing to separate encoder task queue (Closed)
Patch Set: Increased prio of queue Created 3 years, 9 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 #ifndef WEBRTC_VOICE_ENGINE_SHARED_DATA_H 11 #ifndef WEBRTC_VOICE_ENGINE_SHARED_DATA_H
12 #define WEBRTC_VOICE_ENGINE_SHARED_DATA_H 12 #define WEBRTC_VOICE_ENGINE_SHARED_DATA_H
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/base/criticalsection.h" 16 #include "webrtc/base/criticalsection.h"
17 #include "webrtc/base/scoped_ref_ptr.h" 17 #include "webrtc/base/scoped_ref_ptr.h"
18 #include "webrtc/base/task_queue.h"
18 #include "webrtc/modules/audio_device/include/audio_device.h" 19 #include "webrtc/modules/audio_device/include/audio_device.h"
19 #include "webrtc/modules/audio_processing/include/audio_processing.h" 20 #include "webrtc/modules/audio_processing/include/audio_processing.h"
20 #include "webrtc/modules/utility/include/process_thread.h" 21 #include "webrtc/modules/utility/include/process_thread.h"
21 #include "webrtc/voice_engine/channel_manager.h" 22 #include "webrtc/voice_engine/channel_manager.h"
22 #include "webrtc/voice_engine/statistics.h" 23 #include "webrtc/voice_engine/statistics.h"
23 #include "webrtc/voice_engine/voice_engine_defines.h" 24 #include "webrtc/voice_engine/voice_engine_defines.h"
24 25
25 class ProcessThread; 26 class ProcessThread;
26 27
27 namespace webrtc { 28 namespace webrtc {
(...skipping 11 matching lines...) Expand all
39 ChannelManager& channel_manager() { return _channelManager; } 40 ChannelManager& channel_manager() { return _channelManager; }
40 AudioDeviceModule* audio_device() { return _audioDevicePtr.get(); } 41 AudioDeviceModule* audio_device() { return _audioDevicePtr.get(); }
41 void set_audio_device( 42 void set_audio_device(
42 const rtc::scoped_refptr<AudioDeviceModule>& audio_device); 43 const rtc::scoped_refptr<AudioDeviceModule>& audio_device);
43 AudioProcessing* audio_processing() { return audioproc_.get(); } 44 AudioProcessing* audio_processing() { return audioproc_.get(); }
44 void set_audio_processing(AudioProcessing* audio_processing); 45 void set_audio_processing(AudioProcessing* audio_processing);
45 TransmitMixer* transmit_mixer() { return _transmitMixerPtr; } 46 TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
46 OutputMixer* output_mixer() { return _outputMixerPtr; } 47 OutputMixer* output_mixer() { return _outputMixerPtr; }
47 rtc::CriticalSection* crit_sec() { return &_apiCritPtr; } 48 rtc::CriticalSection* crit_sec() { return &_apiCritPtr; }
48 ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); } 49 ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); }
50 rtc::TaskQueue* encoder_queue() { return &encoder_queue_; }
49 51
50 int NumOfSendingChannels(); 52 int NumOfSendingChannels();
51 int NumOfPlayingChannels(); 53 int NumOfPlayingChannels();
52 54
53 // Convenience methods for calling statistics().SetLastError(). 55 // Convenience methods for calling statistics().SetLastError().
54 void SetLastError(int32_t error) const; 56 void SetLastError(int32_t error) const;
55 void SetLastError(int32_t error, TraceLevel level) const; 57 void SetLastError(int32_t error, TraceLevel level) const;
56 void SetLastError(int32_t error, TraceLevel level, 58 void SetLastError(int32_t error, TraceLevel level,
57 const char* msg) const; 59 const char* msg) const;
58 60
59 protected: 61 protected:
60 const uint32_t _instanceId; 62 const uint32_t _instanceId;
61 rtc::CriticalSection _apiCritPtr; 63 rtc::CriticalSection _apiCritPtr;
62 ChannelManager _channelManager; 64 ChannelManager _channelManager;
63 Statistics _engineStatistics; 65 Statistics _engineStatistics;
64 rtc::scoped_refptr<AudioDeviceModule> _audioDevicePtr; 66 rtc::scoped_refptr<AudioDeviceModule> _audioDevicePtr;
65 OutputMixer* _outputMixerPtr; 67 OutputMixer* _outputMixerPtr;
66 TransmitMixer* _transmitMixerPtr; 68 TransmitMixer* _transmitMixerPtr;
67 std::unique_ptr<AudioProcessing> audioproc_; 69 std::unique_ptr<AudioProcessing> audioproc_;
68 std::unique_ptr<ProcessThread> _moduleProcessThreadPtr; 70 std::unique_ptr<ProcessThread> _moduleProcessThreadPtr;
71 // |encoder_queue| is defined last to ensure all pending tasks are cancelled
72 // and deleted before any other members.
73 rtc::TaskQueue encoder_queue_;
aleloi 2017/03/23 13:33:21 The queue needs to be alive when methods in Channe
henrika_webrtc 2017/03/23 14:02:17 All channels are deleted before shared data (and t
69 74
70 SharedData(); 75 SharedData();
71 virtual ~SharedData(); 76 virtual ~SharedData();
72 }; 77 };
73 78
74 } // namespace voe 79 } // namespace voe
75 } // namespace webrtc 80 } // namespace webrtc
76 #endif // WEBRTC_VOICE_ENGINE_SHARED_DATA_H 81 #endif // WEBRTC_VOICE_ENGINE_SHARED_DATA_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698