Rename Call::Config to CallConfig, keep old name as alias.

We want api/peerconnectioninterface.h (and corresponding build target)
to not depend on call.h, and generally we treat Call as an internal,
non-api, class. But we need CallFactoryInterface in the api in order to
enable use of PeerConnection with or without support for media.

Making CallConfig a top-level class makes it possible to forward declare
it, together with Call, for use in callfactoryinterface.h and
peerconnectioninterface.h.

Delete the peerconnection_and_implicit_call_api target, replaced by
new target callfactory_api, to link between Call and Peerconnection.

Bug: webrtc:7504
Change-Id: I5e3978ef89bcd6705e94536f8676bcf89fc82fe1
Reviewed-on: https://webrtc-review.googlesource.com/46201
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22020}
This commit is contained in:
Niels Möller
2018-02-14 12:20:13 +01:00
committed by Commit Bot
parent fa4fe647ed
commit 8366e177e7
16 changed files with 88 additions and 76 deletions

View File

@ -72,49 +72,51 @@ class PacketReceiver {
virtual ~PacketReceiver() {}
};
struct CallConfig {
explicit CallConfig(RtcEventLog* event_log) : event_log(event_log) {
RTC_DCHECK(event_log);
}
static constexpr int kDefaultStartBitrateBps = 300000;
// Bitrate config used until valid bitrate estimates are calculated. Also
// used to cap total bitrate used. This comes from the remote connection.
struct BitrateConfig {
int min_bitrate_bps = 0;
int start_bitrate_bps = kDefaultStartBitrateBps;
int max_bitrate_bps = -1;
} bitrate_config;
// The local client's bitrate preferences. The actual configuration used
// is a combination of this and |bitrate_config|. The combination is
// currently more complicated than a simple mask operation (see
// SetBitrateConfig and SetBitrateConfigMask). Assumes that 0 <= min <=
// start <= max holds for set parameters.
struct BitrateConfigMask {
rtc::Optional<int> min_bitrate_bps;
rtc::Optional<int> start_bitrate_bps;
rtc::Optional<int> max_bitrate_bps;
};
// AudioState which is possibly shared between multiple calls.
// TODO(solenberg): Change this to a shared_ptr once we can use C++11.
rtc::scoped_refptr<AudioState> audio_state;
// Audio Processing Module to be used in this call.
// TODO(solenberg): Change this to a shared_ptr once we can use C++11.
AudioProcessing* audio_processing = nullptr;
// RtcEventLog to use for this call. Required.
// Use webrtc::RtcEventLog::CreateNull() for a null implementation.
RtcEventLog* event_log = nullptr;
};
// A Call instance can contain several send and/or receive streams. All streams
// are assumed to have the same remote endpoint and will share bitrate estimates
// etc.
class Call {
public:
struct Config {
explicit Config(RtcEventLog* event_log) : event_log(event_log) {
RTC_DCHECK(event_log);
}
static constexpr int kDefaultStartBitrateBps = 300000;
// Bitrate config used until valid bitrate estimates are calculated. Also
// used to cap total bitrate used. This comes from the remote connection.
struct BitrateConfig {
int min_bitrate_bps = 0;
int start_bitrate_bps = kDefaultStartBitrateBps;
int max_bitrate_bps = -1;
} bitrate_config;
// The local client's bitrate preferences. The actual configuration used
// is a combination of this and |bitrate_config|. The combination is
// currently more complicated than a simple mask operation (see
// SetBitrateConfig and SetBitrateConfigMask). Assumes that 0 <= min <=
// start <= max holds for set parameters.
struct BitrateConfigMask {
rtc::Optional<int> min_bitrate_bps;
rtc::Optional<int> start_bitrate_bps;
rtc::Optional<int> max_bitrate_bps;
};
// AudioState which is possibly shared between multiple calls.
// TODO(solenberg): Change this to a shared_ptr once we can use C++11.
rtc::scoped_refptr<AudioState> audio_state;
// Audio Processing Module to be used in this call.
// TODO(solenberg): Change this to a shared_ptr once we can use C++11.
AudioProcessing* audio_processing = nullptr;
// RtcEventLog to use for this call. Required.
// Use webrtc::RtcEventLog::CreateNull() for a null implementation.
RtcEventLog* event_log = nullptr;
};
using Config = CallConfig;
struct Stats {
std::string ToString(int64_t time_ms) const;