Moved call.h and most of api/call/* into call/

BUG=webrtc:6716

Review-Url: https://codereview.webrtc.org/2550273003
Cr-Commit-Position: refs/heads/master@{#15460}
diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn
index 64829e9..5572941 100644
--- a/webrtc/call/BUILD.gn
+++ b/webrtc/call/BUILD.gn
@@ -8,6 +8,16 @@
 
 import("../build/webrtc.gni")
 
+rtc_source_set("call_interfaces") {
+  sources = [
+    "audio_receive_stream.h",
+    "audio_send_stream.cc",
+    "audio_send_stream.h",
+    "audio_state.h",
+    "call.h",
+  ]
+}
+
 rtc_static_library("call") {
   sources = [
     "bitrate_allocator.cc",
@@ -22,10 +32,12 @@
   }
 
   public_deps = [
+    ":call_interfaces",
     "../api:call_api",
   ]
 
   deps = [
+    ":call_interfaces",
     "..:webrtc_common",
     "../api:transport_api",
     "../audio",
diff --git a/webrtc/call/audio_receive_stream.h b/webrtc/call/audio_receive_stream.h
new file mode 100644
index 0000000..1299ded
--- /dev/null
+++ b/webrtc/call/audio_receive_stream.h
@@ -0,0 +1,142 @@
+/*
+ *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ *  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.
+ */
+
+#ifndef WEBRTC_CALL_AUDIO_RECEIVE_STREAM_H_
+#define WEBRTC_CALL_AUDIO_RECEIVE_STREAM_H_
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "webrtc/api/call/transport.h"
+#include "webrtc/base/optional.h"
+#include "webrtc/base/scoped_ref_ptr.h"
+#include "webrtc/modules/audio_coding/codecs/audio_decoder_factory.h"
+#include "webrtc/common_types.h"
+#include "webrtc/config.h"
+#include "webrtc/typedefs.h"
+
+namespace webrtc {
+class AudioSinkInterface;
+
+// WORK IN PROGRESS
+// This class is under development and is not yet intended for for use outside
+// of WebRtc/Libjingle. Please use the VoiceEngine API instead.
+// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
+
+class AudioReceiveStream {
+ public:
+  struct Stats {
+    uint32_t remote_ssrc = 0;
+    int64_t bytes_rcvd = 0;
+    uint32_t packets_rcvd = 0;
+    uint32_t packets_lost = 0;
+    float fraction_lost = 0.0f;
+    std::string codec_name;
+    rtc::Optional<int> codec_payload_type;
+    uint32_t ext_seqnum = 0;
+    uint32_t jitter_ms = 0;
+    uint32_t jitter_buffer_ms = 0;
+    uint32_t jitter_buffer_preferred_ms = 0;
+    uint32_t delay_estimate_ms = 0;
+    int32_t audio_level = -1;
+    float expand_rate = 0.0f;
+    float speech_expand_rate = 0.0f;
+    float secondary_decoded_rate = 0.0f;
+    float accelerate_rate = 0.0f;
+    float preemptive_expand_rate = 0.0f;
+    int32_t decoding_calls_to_silence_generator = 0;
+    int32_t decoding_calls_to_neteq = 0;
+    int32_t decoding_normal = 0;
+    int32_t decoding_plc = 0;
+    int32_t decoding_cng = 0;
+    int32_t decoding_plc_cng = 0;
+    int32_t decoding_muted_output = 0;
+    int64_t capture_start_ntp_time_ms = 0;
+  };
+
+  struct Config {
+    std::string ToString() const;
+
+    // Receive-stream specific RTP settings.
+    struct Rtp {
+      std::string ToString() const;
+
+      // Synchronization source (stream identifier) to be received.
+      uint32_t remote_ssrc = 0;
+
+      // Sender SSRC used for sending RTCP (such as receiver reports).
+      uint32_t local_ssrc = 0;
+
+      // Enable feedback for send side bandwidth estimation.
+      // See
+      // https://tools.ietf.org/html/draft-holmer-rmcat-transport-wide-cc-extensions
+      // for details.
+      bool transport_cc = false;
+
+      // See NackConfig for description.
+      NackConfig nack;
+
+      // RTP header extensions used for the received stream.
+      std::vector<RtpExtension> extensions;
+    } rtp;
+
+    Transport* rtcp_send_transport = nullptr;
+
+    // Underlying VoiceEngine handle, used to map AudioReceiveStream to lower-
+    // level components.
+    // TODO(solenberg): Remove when VoiceEngine channels are created outside
+    // of Call.
+    int voe_channel_id = -1;
+
+    // Identifier for an A/V synchronization group. Empty string to disable.
+    // TODO(pbos): Synchronize streams in a sync group, not just one video
+    // stream to one audio stream. Tracked by issue webrtc:4762.
+    std::string sync_group;
+
+    // Decoders for every payload that we can receive. Call owns the
+    // AudioDecoder instances once the Config is submitted to
+    // Call::CreateReceiveStream().
+    // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11.
+    std::map<uint8_t, AudioDecoder*> decoder_map;
+
+    rtc::scoped_refptr<AudioDecoderFactory> decoder_factory;
+  };
+
+  // Starts stream activity.
+  // When a stream is active, it can receive, process and deliver packets.
+  virtual void Start() = 0;
+  // Stops stream activity.
+  // When a stream is stopped, it can't receive, process or deliver packets.
+  virtual void Stop() = 0;
+
+  virtual Stats GetStats() const = 0;
+
+  // Sets an audio sink that receives unmixed audio from the receive stream.
+  // Ownership of the sink is passed to the stream and can be used by the
+  // caller to do lifetime management (i.e. when the sink's dtor is called).
+  // Only one sink can be set and passing a null sink clears an existing one.
+  // NOTE: Audio must still somehow be pulled through AudioTransport for audio
+  // to stream through this sink. In practice, this happens if mixed audio
+  // is being pulled+rendered and/or if audio is being pulled for the purposes
+  // of feeding to the AEC.
+  virtual void SetSink(std::unique_ptr<AudioSinkInterface> sink) = 0;
+
+  // Sets playback gain of the stream, applied when mixing, and thus after it
+  // is potentially forwarded to any attached AudioSinkInterface implementation.
+  virtual void SetGain(float gain) = 0;
+
+ protected:
+  virtual ~AudioReceiveStream() {}
+};
+}  // namespace webrtc
+
+#endif  // WEBRTC_CALL_AUDIO_RECEIVE_STREAM_H_
diff --git a/webrtc/call/audio_send_stream.cc b/webrtc/call/audio_send_stream.cc
new file mode 100644
index 0000000..8b6dd9e
--- /dev/null
+++ b/webrtc/call/audio_send_stream.cc
@@ -0,0 +1,109 @@
+/*
+ *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ *  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.
+ */
+
+#include "webrtc/call/audio_send_stream.h"
+
+#include <string>
+
+namespace {
+
+std::string ToString(const webrtc::CodecInst& codec_inst) {
+  std::stringstream ss;
+  ss << "{pltype: " << codec_inst.pltype;
+  ss << ", plname: \"" << codec_inst.plname << "\"";
+  ss << ", plfreq: " << codec_inst.plfreq;
+  ss << ", pacsize: " << codec_inst.pacsize;
+  ss << ", channels: " << codec_inst.channels;
+  ss << ", rate: " << codec_inst.rate;
+  ss << '}';
+  return ss.str();
+}
+}  // namespace
+
+namespace webrtc {
+
+AudioSendStream::Stats::Stats() = default;
+AudioSendStream::Stats::~Stats() = default;
+
+AudioSendStream::Config::Config(Transport* send_transport)
+    : send_transport(send_transport) {}
+
+AudioSendStream::Config::~Config() = default;
+
+std::string AudioSendStream::Config::ToString() const {
+  std::stringstream ss;
+  ss << "{rtp: " << rtp.ToString();
+  ss << ", send_transport: " << (send_transport ? "(Transport)" : "nullptr");
+  ss << ", voe_channel_id: " << voe_channel_id;
+  ss << ", min_bitrate_bps: " << min_bitrate_bps;
+  ss << ", max_bitrate_bps: " << max_bitrate_bps;
+  ss << ", send_codec_spec: " << send_codec_spec.ToString();
+  ss << '}';
+  return ss.str();
+}
+
+AudioSendStream::Config::Rtp::Rtp() = default;
+
+AudioSendStream::Config::Rtp::~Rtp() = default;
+
+std::string AudioSendStream::Config::Rtp::ToString() const {
+  std::stringstream ss;
+  ss << "{ssrc: " << ssrc;
+  ss << ", extensions: [";
+  for (size_t i = 0; i < extensions.size(); ++i) {
+    ss << extensions[i].ToString();
+    if (i != extensions.size() - 1) {
+      ss << ", ";
+    }
+  }
+  ss << ']';
+  ss << ", nack: " << nack.ToString();
+  ss << ", c_name: " << c_name;
+  ss << '}';
+  return ss.str();
+}
+
+AudioSendStream::Config::SendCodecSpec::SendCodecSpec() {
+  webrtc::CodecInst empty_inst = {0};
+  codec_inst = empty_inst;
+  codec_inst.pltype = -1;
+}
+
+std::string AudioSendStream::Config::SendCodecSpec::ToString() const {
+  std::stringstream ss;
+  ss << "{nack_enabled: " << (nack_enabled ? "true" : "false");
+  ss << ", transport_cc_enabled: " << (transport_cc_enabled ? "true" : "false");
+  ss << ", enable_codec_fec: " << (enable_codec_fec ? "true" : "false");
+  ss << ", enable_opus_dtx: " << (enable_opus_dtx ? "true" : "false");
+  ss << ", opus_max_playback_rate: " << opus_max_playback_rate;
+  ss << ", cng_payload_type: " << cng_payload_type;
+  ss << ", cng_plfreq: " << cng_plfreq;
+  ss << ", min_ptime: " << min_ptime_ms;
+  ss << ", max_ptime: " << max_ptime_ms;
+  ss << ", codec_inst: " << ::ToString(codec_inst);
+  ss << '}';
+  return ss.str();
+}
+
+bool AudioSendStream::Config::SendCodecSpec::operator==(
+    const AudioSendStream::Config::SendCodecSpec& rhs) const {
+  if (nack_enabled == rhs.nack_enabled &&
+      transport_cc_enabled == rhs.transport_cc_enabled &&
+      enable_codec_fec == rhs.enable_codec_fec &&
+      enable_opus_dtx == rhs.enable_opus_dtx &&
+      opus_max_playback_rate == rhs.opus_max_playback_rate &&
+      cng_payload_type == rhs.cng_payload_type &&
+      cng_plfreq == rhs.cng_plfreq && max_ptime_ms == rhs.max_ptime_ms &&
+      min_ptime_ms == rhs.min_ptime_ms && codec_inst == rhs.codec_inst) {
+    return true;
+  }
+  return false;
+}
+}  // namespace webrtc
diff --git a/webrtc/call/audio_send_stream.h b/webrtc/call/audio_send_stream.h
new file mode 100644
index 0000000..2063589
--- /dev/null
+++ b/webrtc/call/audio_send_stream.h
@@ -0,0 +1,145 @@
+/*
+ *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ *  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.
+ */
+
+#ifndef WEBRTC_CALL_AUDIO_SEND_STREAM_H_
+#define WEBRTC_CALL_AUDIO_SEND_STREAM_H_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "webrtc/api/call/transport.h"
+#include "webrtc/base/optional.h"
+#include "webrtc/config.h"
+#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
+#include "webrtc/typedefs.h"
+
+namespace webrtc {
+
+// WORK IN PROGRESS
+// This class is under development and is not yet intended for for use outside
+// of WebRtc/Libjingle. Please use the VoiceEngine API instead.
+// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
+
+class AudioSendStream {
+ public:
+  struct Stats {
+    Stats();
+    ~Stats();
+
+    // TODO(solenberg): Harmonize naming and defaults with receive stream stats.
+    uint32_t local_ssrc = 0;
+    int64_t bytes_sent = 0;
+    int32_t packets_sent = 0;
+    int32_t packets_lost = -1;
+    float fraction_lost = -1.0f;
+    std::string codec_name;
+    rtc::Optional<int> codec_payload_type;
+    int32_t ext_seqnum = -1;
+    int32_t jitter_ms = -1;
+    int64_t rtt_ms = -1;
+    int32_t audio_level = -1;
+    float aec_quality_min = -1.0f;
+    int32_t echo_delay_median_ms = -1;
+    int32_t echo_delay_std_ms = -1;
+    int32_t echo_return_loss = -100;
+    int32_t echo_return_loss_enhancement = -100;
+    float residual_echo_likelihood = -1.0f;
+    bool typing_noise_detected = false;
+  };
+
+  struct Config {
+    Config() = delete;
+    explicit Config(Transport* send_transport);
+    ~Config();
+    std::string ToString() const;
+
+    // Send-stream specific RTP settings.
+    struct Rtp {
+      Rtp();
+      ~Rtp();
+      std::string ToString() const;
+
+      // Sender SSRC.
+      uint32_t ssrc = 0;
+
+      // RTP header extensions used for the sent stream.
+      std::vector<RtpExtension> extensions;
+
+      // See NackConfig for description.
+      NackConfig nack;
+
+      // RTCP CNAME, see RFC 3550.
+      std::string c_name;
+    } rtp;
+
+    // Transport for outgoing packets. The transport is expected to exist for
+    // the entire life of the AudioSendStream and is owned by the API client.
+    Transport* send_transport = nullptr;
+
+    // Underlying VoiceEngine handle, used to map AudioSendStream to lower-level
+    // components.
+    // TODO(solenberg): Remove when VoiceEngine channels are created outside
+    // of Call.
+    int voe_channel_id = -1;
+
+    // Bitrate limits used for variable audio bitrate streams. Set both to -1 to
+    // disable audio bitrate adaptation.
+    // Note: This is still an experimental feature and not ready for real usage.
+    int min_bitrate_bps = -1;
+    int max_bitrate_bps = -1;
+
+    // Defines whether to turn on audio network adaptor, and defines its config
+    // string.
+    rtc::Optional<std::string> audio_network_adaptor_config;
+
+    struct SendCodecSpec {
+      SendCodecSpec();
+      std::string ToString() const;
+
+      bool operator==(const SendCodecSpec& rhs) const;
+      bool operator!=(const SendCodecSpec& rhs) const {
+        return !(*this == rhs);
+      }
+
+      bool nack_enabled = false;
+      bool transport_cc_enabled = false;
+      bool enable_codec_fec = false;
+      bool enable_opus_dtx = false;
+      int opus_max_playback_rate = 0;
+      int cng_payload_type = -1;
+      int cng_plfreq = -1;
+      int max_ptime_ms = -1;
+      int min_ptime_ms = -1;
+      webrtc::CodecInst codec_inst;
+    } send_codec_spec;
+  };
+
+  // Starts stream activity.
+  // When a stream is active, it can receive, process and deliver packets.
+  virtual void Start() = 0;
+  // Stops stream activity.
+  // When a stream is stopped, it can't receive, process or deliver packets.
+  virtual void Stop() = 0;
+
+  // TODO(solenberg): Make payload_type a config property instead.
+  virtual bool SendTelephoneEvent(int payload_type, int payload_frequency,
+                                  int event, int duration_ms) = 0;
+
+  virtual void SetMuted(bool muted) = 0;
+
+  virtual Stats GetStats() const = 0;
+
+ protected:
+  virtual ~AudioSendStream() {}
+};
+}  // namespace webrtc
+
+#endif  // WEBRTC_CALL_AUDIO_SEND_STREAM_H_
diff --git a/webrtc/call/audio_state.h b/webrtc/call/audio_state.h
new file mode 100644
index 0000000..2c26a17
--- /dev/null
+++ b/webrtc/call/audio_state.h
@@ -0,0 +1,49 @@
+/*
+ *  Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
+ *
+ *  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.
+ */
+#ifndef WEBRTC_CALL_AUDIO_STATE_H_
+#define WEBRTC_CALL_AUDIO_STATE_H_
+
+#include "webrtc/api/audio/audio_mixer.h"
+#include "webrtc/base/refcount.h"
+#include "webrtc/base/scoped_ref_ptr.h"
+
+namespace webrtc {
+
+class VoiceEngine;
+
+// WORK IN PROGRESS
+// This class is under development and is not yet intended for for use outside
+// of WebRtc/Libjingle. Please use the VoiceEngine API instead.
+// See: https://bugs.chromium.org/p/webrtc/issues/detail?id=4690
+
+// AudioState holds the state which must be shared between multiple instances of
+// webrtc::Call for audio processing purposes.
+class AudioState : public rtc::RefCountInterface {
+ public:
+  struct Config {
+    // VoiceEngine used for audio streams and audio/video synchronization.
+    // AudioState will tickle the VoE refcount to keep it alive for as long as
+    // the AudioState itself.
+    VoiceEngine* voice_engine = nullptr;
+
+    // The audio mixer connected to active receive streams. One per
+    // AudioState.
+    rtc::scoped_refptr<AudioMixer> audio_mixer;
+  };
+
+  // TODO(solenberg): Replace scoped_refptr with shared_ptr once we can use it.
+  static rtc::scoped_refptr<AudioState> Create(
+      const AudioState::Config& config);
+
+  virtual ~AudioState() {}
+};
+}  // namespace webrtc
+
+#endif  // WEBRTC_CALL_AUDIO_STATE_H_
diff --git a/webrtc/call/bitrate_estimator_tests.cc b/webrtc/call/bitrate_estimator_tests.cc
index 95d42ef..bb4960f 100644
--- a/webrtc/call/bitrate_estimator_tests.cc
+++ b/webrtc/call/bitrate_estimator_tests.cc
@@ -16,7 +16,7 @@
 #include "webrtc/base/event.h"
 #include "webrtc/base/logging.h"
 #include "webrtc/base/thread_annotations.h"
-#include "webrtc/call.h"
+#include "webrtc/call/call.h"
 #include "webrtc/system_wrappers/include/critical_section_wrapper.h"
 #include "webrtc/system_wrappers/include/trace.h"
 #include "webrtc/test/call_test.h"
diff --git a/webrtc/call/call.cc b/webrtc/call/call.cc
index 3d940b6..9a32df2 100644
--- a/webrtc/call/call.cc
+++ b/webrtc/call/call.cc
@@ -12,6 +12,7 @@
 #include <algorithm>
 #include <map>
 #include <memory>
+#include <set>
 #include <utility>
 #include <vector>
 
@@ -27,8 +28,8 @@
 #include "webrtc/base/thread_annotations.h"
 #include "webrtc/base/thread_checker.h"
 #include "webrtc/base/trace_event.h"
-#include "webrtc/call.h"
 #include "webrtc/call/bitrate_allocator.h"
+#include "webrtc/call/call.h"
 #include "webrtc/call/flexfec_receive_stream.h"
 #include "webrtc/config.h"
 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
diff --git a/webrtc/call/call.h b/webrtc/call/call.h
new file mode 100644
index 0000000..34f6833
--- /dev/null
+++ b/webrtc/call/call.h
@@ -0,0 +1,165 @@
+/*
+ *  Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
+ *
+ *  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.
+ */
+#ifndef WEBRTC_CALL_CALL_H_
+#define WEBRTC_CALL_CALL_H_
+
+#include <string>
+#include <vector>
+
+#include "webrtc/api/call/flexfec_receive_stream.h"
+#include "webrtc/base/networkroute.h"
+#include "webrtc/base/platform_file.h"
+#include "webrtc/base/socket.h"
+#include "webrtc/call/audio_receive_stream.h"
+#include "webrtc/call/audio_send_stream.h"
+#include "webrtc/call/audio_state.h"
+#include "webrtc/common_types.h"
+#include "webrtc/video_receive_stream.h"
+#include "webrtc/video_send_stream.h"
+
+namespace webrtc {
+
+class AudioProcessing;
+class RtcEventLog;
+
+const char* Version();
+
+enum class MediaType {
+  ANY,
+  AUDIO,
+  VIDEO,
+  DATA
+};
+
+class PacketReceiver {
+ public:
+  enum DeliveryStatus {
+    DELIVERY_OK,
+    DELIVERY_UNKNOWN_SSRC,
+    DELIVERY_PACKET_ERROR,
+  };
+
+  virtual DeliveryStatus DeliverPacket(MediaType media_type,
+                                       const uint8_t* packet,
+                                       size_t length,
+                                       const PacketTime& packet_time) = 0;
+
+ protected:
+  virtual ~PacketReceiver() {}
+};
+
+// 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 const int kDefaultStartBitrateBps;
+
+    // Bitrate config used until valid bitrate estimates are calculated. Also
+    // used to cap total bitrate used.
+    struct BitrateConfig {
+      int min_bitrate_bps = 0;
+      int start_bitrate_bps = kDefaultStartBitrateBps;
+      int max_bitrate_bps = -1;
+    } bitrate_config;
+
+    // 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;
+  };
+
+  struct Stats {
+    std::string ToString(int64_t time_ms) const;
+
+    int send_bandwidth_bps = 0;       // Estimated available send bandwidth.
+    int max_padding_bitrate_bps = 0;  // Cumulative configured max padding.
+    int recv_bandwidth_bps = 0;       // Estimated available receive bandwidth.
+    int64_t pacer_delay_ms = 0;
+    int64_t rtt_ms = -1;
+  };
+
+  static Call* Create(const Call::Config& config);
+
+  virtual AudioSendStream* CreateAudioSendStream(
+      const AudioSendStream::Config& config) = 0;
+  virtual void DestroyAudioSendStream(AudioSendStream* send_stream) = 0;
+
+  virtual AudioReceiveStream* CreateAudioReceiveStream(
+      const AudioReceiveStream::Config& config) = 0;
+  virtual void DestroyAudioReceiveStream(
+      AudioReceiveStream* receive_stream) = 0;
+
+  virtual VideoSendStream* CreateVideoSendStream(
+      VideoSendStream::Config config,
+      VideoEncoderConfig encoder_config) = 0;
+  virtual void DestroyVideoSendStream(VideoSendStream* send_stream) = 0;
+
+  virtual VideoReceiveStream* CreateVideoReceiveStream(
+      VideoReceiveStream::Config configuration) = 0;
+  virtual void DestroyVideoReceiveStream(
+      VideoReceiveStream* receive_stream) = 0;
+
+  virtual FlexfecReceiveStream* CreateFlexfecReceiveStream(
+      FlexfecReceiveStream::Config configuration) = 0;
+  virtual void DestroyFlexfecReceiveStream(
+      FlexfecReceiveStream* receive_stream) = 0;
+
+  // All received RTP and RTCP packets for the call should be inserted to this
+  // PacketReceiver. The PacketReceiver pointer is valid as long as the
+  // Call instance exists.
+  virtual PacketReceiver* Receiver() = 0;
+
+  // Returns the call statistics, such as estimated send and receive bandwidth,
+  // pacing delay, etc.
+  virtual Stats GetStats() const = 0;
+
+  // TODO(pbos): Like BitrateConfig above this is currently per-stream instead
+  // of maximum for entire Call. This should be fixed along with the above.
+  // Specifying a start bitrate (>0) will currently reset the current bitrate
+  // estimate. This is due to how the 'x-google-start-bitrate' flag is currently
+  // implemented.
+  virtual void SetBitrateConfig(
+      const Config::BitrateConfig& bitrate_config) = 0;
+
+  // TODO(skvlad): When the unbundled case with multiple streams for the same
+  // media type going over different networks is supported, track the state
+  // for each stream separately. Right now it's global per media type.
+  virtual void SignalChannelNetworkState(MediaType media,
+                                         NetworkState state) = 0;
+
+  virtual void OnTransportOverheadChanged(
+      MediaType media,
+      int transport_overhead_per_packet) = 0;
+
+  virtual void OnNetworkRouteChanged(
+      const std::string& transport_name,
+      const rtc::NetworkRoute& network_route) = 0;
+
+  virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0;
+
+  virtual ~Call() {}
+};
+
+}  // namespace webrtc
+
+#endif  // WEBRTC_CALL_CALL_H_
diff --git a/webrtc/call/call_perf_tests.cc b/webrtc/call/call_perf_tests.cc
index fb5ae0d..36fc64f 100644
--- a/webrtc/call/call_perf_tests.cc
+++ b/webrtc/call/call_perf_tests.cc
@@ -16,7 +16,7 @@
 #include "webrtc/base/checks.h"
 #include "webrtc/base/constructormagic.h"
 #include "webrtc/base/thread_annotations.h"
-#include "webrtc/call.h"
+#include "webrtc/call/call.h"
 #include "webrtc/config.h"
 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
 #include "webrtc/modules/audio_coding/include/audio_coding_module.h"
diff --git a/webrtc/call/call_unittest.cc b/webrtc/call/call_unittest.cc
index 2d75be5..15c642f 100644
--- a/webrtc/call/call_unittest.cc
+++ b/webrtc/call/call_unittest.cc
@@ -11,11 +11,11 @@
 #include <list>
 #include <memory>
 
-#include "webrtc/api/call/audio_state.h"
-#include "webrtc/call.h"
+#include "webrtc/call/audio_state.h"
+#include "webrtc/call/call.h"
 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
-#include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h"
+#include "webrtc/modules/audio_mixer/audio_mixer_impl.h"
 #include "webrtc/test/gtest.h"
 #include "webrtc/test/mock_voice_engine.h"
 
diff --git a/webrtc/call/rampup_tests.h b/webrtc/call/rampup_tests.h
index f03b926..2c70a95 100644
--- a/webrtc/call/rampup_tests.h
+++ b/webrtc/call/rampup_tests.h
@@ -16,7 +16,7 @@
 #include <vector>
 
 #include "webrtc/base/event.h"
-#include "webrtc/call.h"
+#include "webrtc/call/call.h"
 #include "webrtc/logging/rtc_event_log/rtc_event_log.h"
 #include "webrtc/test/call_test.h"