2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-04-04 14:57:19 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef VOICE_ENGINE_SHARED_DATA_H_
|
|
|
|
|
#define VOICE_ENGINE_SHARED_DATA_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2016-02-17 10:04:18 -08:00
|
|
|
#include <memory>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_device/include/audio_device.h"
|
|
|
|
|
#include "modules/audio_processing/include/audio_processing.h"
|
|
|
|
|
#include "modules/utility/include/process_thread.h"
|
|
|
|
|
#include "rtc_base/criticalsection.h"
|
|
|
|
|
#include "rtc_base/scoped_ref_ptr.h"
|
|
|
|
|
#include "rtc_base/task_queue.h"
|
|
|
|
|
#include "rtc_base/thread_annotations.h"
|
|
|
|
|
#include "rtc_base/thread_checker.h"
|
|
|
|
|
#include "voice_engine/channel_manager.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
class ProcessThread;
|
|
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace voe {
|
|
|
|
|
|
|
|
|
|
class TransmitMixer;
|
|
|
|
|
|
2012-01-19 15:05:36 +00:00
|
|
|
class SharedData
|
2011-07-07 08:21:25 +00:00
|
|
|
{
|
2012-01-19 15:05:36 +00:00
|
|
|
public:
|
|
|
|
|
// Public accessors.
|
2013-04-09 10:09:10 +00:00
|
|
|
uint32_t instance_id() const { return _instanceId; }
|
2012-01-19 15:05:36 +00:00
|
|
|
ChannelManager& channel_manager() { return _channelManager; }
|
2016-03-21 16:44:31 +01:00
|
|
|
AudioDeviceModule* audio_device() { return _audioDevicePtr.get(); }
|
|
|
|
|
void set_audio_device(
|
|
|
|
|
const rtc::scoped_refptr<AudioDeviceModule>& audio_device);
|
2012-04-04 14:57:19 +00:00
|
|
|
void set_audio_processing(AudioProcessing* audio_processing);
|
|
|
|
|
TransmitMixer* transmit_mixer() { return _transmitMixerPtr; }
|
2016-01-21 10:37:37 -08:00
|
|
|
rtc::CriticalSection* crit_sec() { return &_apiCritPtr; }
|
2015-02-06 09:44:12 +00:00
|
|
|
ProcessThread* process_thread() { return _moduleProcessThreadPtr.get(); }
|
2017-03-31 05:43:36 -07:00
|
|
|
rtc::TaskQueue* encoder_queue();
|
2012-01-19 15:05:36 +00:00
|
|
|
|
2013-10-17 16:15:34 +00:00
|
|
|
int NumOfSendingChannels();
|
|
|
|
|
int NumOfPlayingChannels();
|
2012-01-19 15:05:36 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
protected:
|
2017-03-31 05:43:36 -07:00
|
|
|
rtc::ThreadChecker construction_thread_;
|
|
|
|
|
const uint32_t _instanceId;
|
|
|
|
|
rtc::CriticalSection _apiCritPtr;
|
|
|
|
|
ChannelManager _channelManager;
|
|
|
|
|
rtc::scoped_refptr<AudioDeviceModule> _audioDevicePtr;
|
|
|
|
|
TransmitMixer* _transmitMixerPtr;
|
|
|
|
|
std::unique_ptr<ProcessThread> _moduleProcessThreadPtr;
|
|
|
|
|
// |encoder_queue| is defined last to ensure all pending tasks are cancelled
|
|
|
|
|
// and deleted before any other members.
|
2017-09-09 04:17:22 -07:00
|
|
|
rtc::TaskQueue encoder_queue_ RTC_ACCESS_ON(construction_thread_);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-03-31 05:43:36 -07:00
|
|
|
SharedData();
|
|
|
|
|
virtual ~SharedData();
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace voe
|
|
|
|
|
} // namespace webrtc
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // VOICE_ENGINE_SHARED_DATA_H_
|