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_VOICE_ENGINE_IMPL_H_
|
|
|
|
|
#define VOICE_ENGINE_VOICE_ENGINE_IMPL_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 "system_wrappers/include/atomic32.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "typedefs.h" // NOLINT(build/include)
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "voice_engine/voe_base_impl.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
namespace webrtc {
|
2015-11-25 08:16:52 -08:00
|
|
|
namespace voe {
|
|
|
|
|
class ChannelProxy;
|
|
|
|
|
} // namespace voe
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-04-04 14:57:19 +00:00
|
|
|
class VoiceEngineImpl : public voe::SharedData, // Must be the first base class
|
2013-02-15 15:07:32 +00:00
|
|
|
public VoiceEngine,
|
2015-05-04 14:15:32 +02:00
|
|
|
public VoEBaseImpl {
|
|
|
|
|
public:
|
2016-09-07 07:34:41 -07:00
|
|
|
VoiceEngineImpl()
|
|
|
|
|
: SharedData(),
|
2012-04-26 15:28:22 +00:00
|
|
|
VoEBaseImpl(this),
|
2016-09-07 07:34:41 -07:00
|
|
|
_ref_count(0) {}
|
2015-05-04 14:15:32 +02:00
|
|
|
~VoiceEngineImpl() override { assert(_ref_count.Value() == 0); }
|
2012-04-26 15:28:22 +00:00
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
int AddRef();
|
2012-04-26 15:28:22 +00:00
|
|
|
|
2015-05-04 14:15:32 +02:00
|
|
|
// This implements the Release() method for all the inherited interfaces.
|
|
|
|
|
int Release() override;
|
2012-04-26 15:28:22 +00:00
|
|
|
|
2015-11-25 08:16:52 -08:00
|
|
|
// Backdoor to access a voe::Channel object without a channel ID. This is only
|
|
|
|
|
// to be used while refactoring the VoE API!
|
2016-02-17 10:04:18 -08:00
|
|
|
virtual std::unique_ptr<voe::ChannelProxy> GetChannelProxy(int channel_id);
|
2015-11-25 08:16:52 -08:00
|
|
|
|
2015-10-22 10:49:27 +02:00
|
|
|
// This is *protected* so that FakeVoiceEngine can inherit from the class and
|
|
|
|
|
// manipulate the reference count. See: fake_voice_engine.h.
|
|
|
|
|
protected:
|
2015-05-04 14:15:32 +02:00
|
|
|
Atomic32 _ref_count;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2013-07-03 15:12:26 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // VOICE_ENGINE_VOICE_ENGINE_IMPL_H_
|