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

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

Issue 1477013005: Replace RefCountImpl with rtc::RefCountedObject. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 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 "webrtc/base/scoped_ptr.h" 14 #include "webrtc/base/scoped_ptr.h"
15 #include "webrtc/base/scoped_ref_ptr.h"
15 #include "webrtc/modules/audio_device/include/audio_device.h" 16 #include "webrtc/modules/audio_device/include/audio_device.h"
16 #include "webrtc/modules/audio_processing/include/audio_processing.h" 17 #include "webrtc/modules/audio_processing/include/audio_processing.h"
17 #include "webrtc/modules/utility/include/process_thread.h" 18 #include "webrtc/modules/utility/include/process_thread.h"
18 #include "webrtc/voice_engine/channel_manager.h" 19 #include "webrtc/voice_engine/channel_manager.h"
19 #include "webrtc/voice_engine/statistics.h" 20 #include "webrtc/voice_engine/statistics.h"
20 #include "webrtc/voice_engine/voice_engine_defines.h" 21 #include "webrtc/voice_engine/voice_engine_defines.h"
21 22
22 class ProcessThread; 23 class ProcessThread;
23 24
24 namespace webrtc { 25 namespace webrtc {
25 class Config; 26 class Config;
26 class CriticalSectionWrapper; 27 class CriticalSectionWrapper;
27 28
28 namespace voe { 29 namespace voe {
29 30
30 class TransmitMixer; 31 class TransmitMixer;
31 class OutputMixer; 32 class OutputMixer;
32 33
33 class SharedData 34 class SharedData
34 { 35 {
35 public: 36 public:
36 // Public accessors. 37 // Public accessors.
37 uint32_t instance_id() const { return _instanceId; } 38 uint32_t instance_id() const { return _instanceId; }
38 Statistics& statistics() { return _engineStatistics; } 39 Statistics& statistics() { return _engineStatistics; }
39 ChannelManager& channel_manager() { return _channelManager; } 40 ChannelManager& channel_manager() { return _channelManager; }
40 AudioDeviceModule* audio_device() { return _audioDevicePtr; } 41 AudioDeviceModule* audio_device() { return _audioDevicePtr.get(); }
41 void set_audio_device(AudioDeviceModule* audio_device); 42 void set_audio_device(rtc::scoped_refptr<AudioDeviceModule> audio_device);
tommi 2016/01/07 16:41:40 const &
pbos-webrtc 2016/01/07 17:23:16 Done.
42 AudioProcessing* audio_processing() { return audioproc_.get(); } 43 AudioProcessing* audio_processing() { return audioproc_.get(); }
43 void set_audio_processing(AudioProcessing* audio_processing); 44 void set_audio_processing(AudioProcessing* audio_processing);
44 TransmitMixer* transmit_mixer() { return _transmitMixerPtr; } 45 TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
45 OutputMixer* output_mixer() { return _outputMixerPtr; } 46 OutputMixer* output_mixer() { return _outputMixerPtr; }
46 CriticalSectionWrapper* crit_sec() { return _apiCritPtr; } 47 CriticalSectionWrapper* crit_sec() { return _apiCritPtr; }
47 ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); } 48 ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); }
48 AudioDeviceModule::AudioLayer audio_device_layer() const { 49 AudioDeviceModule::AudioLayer audio_device_layer() const {
49 return _audioDeviceLayer; 50 return _audioDeviceLayer;
50 } 51 }
51 void set_audio_device_layer(AudioDeviceModule::AudioLayer layer) { 52 void set_audio_device_layer(AudioDeviceModule::AudioLayer layer) {
52 _audioDeviceLayer = layer; 53 _audioDeviceLayer = layer;
53 } 54 }
54 55
55 int NumOfSendingChannels(); 56 int NumOfSendingChannels();
56 int NumOfPlayingChannels(); 57 int NumOfPlayingChannels();
57 58
58 // Convenience methods for calling statistics().SetLastError(). 59 // Convenience methods for calling statistics().SetLastError().
59 void SetLastError(int32_t error) const; 60 void SetLastError(int32_t error) const;
60 void SetLastError(int32_t error, TraceLevel level) const; 61 void SetLastError(int32_t error, TraceLevel level) const;
61 void SetLastError(int32_t error, TraceLevel level, 62 void SetLastError(int32_t error, TraceLevel level,
62 const char* msg) const; 63 const char* msg) const;
63 64
64 protected: 65 protected:
65 const uint32_t _instanceId; 66 const uint32_t _instanceId;
66 CriticalSectionWrapper* _apiCritPtr; 67 CriticalSectionWrapper* _apiCritPtr;
67 ChannelManager _channelManager; 68 ChannelManager _channelManager;
68 Statistics _engineStatistics; 69 Statistics _engineStatistics;
69 AudioDeviceModule* _audioDevicePtr; 70 rtc::scoped_refptr<AudioDeviceModule> _audioDevicePtr;
70 OutputMixer* _outputMixerPtr; 71 OutputMixer* _outputMixerPtr;
71 TransmitMixer* _transmitMixerPtr; 72 TransmitMixer* _transmitMixerPtr;
72 rtc::scoped_ptr<AudioProcessing> audioproc_; 73 rtc::scoped_ptr<AudioProcessing> audioproc_;
73 rtc::scoped_ptr<ProcessThread> _moduleProcessThreadPtr; 74 rtc::scoped_ptr<ProcessThread> _moduleProcessThreadPtr;
74 75
75 AudioDeviceModule::AudioLayer _audioDeviceLayer; 76 AudioDeviceModule::AudioLayer _audioDeviceLayer;
76 77
77 SharedData(const Config& config); 78 SharedData(const Config& config);
78 virtual ~SharedData(); 79 virtual ~SharedData();
79 }; 80 };
80 81
81 } // namespace voe 82 } // namespace voe
82 83
83 } // namespace webrtc 84 } // namespace webrtc
84 #endif // WEBRTC_VOICE_ENGINE_SHARED_DATA_H 85 #endif // WEBRTC_VOICE_ENGINE_SHARED_DATA_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698