| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #ifndef WEBRTC_CALL_H_ | 10 #ifndef WEBRTC_CALL_H_ |
| 11 #define WEBRTC_CALL_H_ | 11 #define WEBRTC_CALL_H_ |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "webrtc/api/call/audio_receive_stream.h" | 16 #include "webrtc/api/call/audio_receive_stream.h" |
| 17 #include "webrtc/api/call/audio_send_stream.h" | 17 #include "webrtc/api/call/audio_send_stream.h" |
| 18 #include "webrtc/api/call/audio_state.h" | 18 #include "webrtc/api/call/audio_state.h" |
| 19 #include "webrtc/base/networkroute.h" | 19 #include "webrtc/base/networkroute.h" |
| 20 #include "webrtc/base/platform_file.h" | 20 #include "webrtc/base/platform_file.h" |
| 21 #include "webrtc/base/socket.h" | 21 #include "webrtc/base/socket.h" |
| 22 #include "webrtc/common_types.h" | 22 #include "webrtc/common_types.h" |
| 23 #include "webrtc/video_receive_stream.h" | 23 #include "webrtc/video_receive_stream.h" |
| 24 #include "webrtc/video_send_stream.h" | 24 #include "webrtc/video_send_stream.h" |
| 25 | 25 |
| 26 namespace webrtc { | 26 namespace webrtc { |
| 27 | 27 |
| 28 class AudioProcessing; | 28 class AudioProcessing; |
| 29 class RtcEventLog; |
| 29 | 30 |
| 30 const char* Version(); | 31 const char* Version(); |
| 31 | 32 |
| 32 enum class MediaType { | 33 enum class MediaType { |
| 33 ANY, | 34 ANY, |
| 34 AUDIO, | 35 AUDIO, |
| 35 VIDEO, | 36 VIDEO, |
| 36 DATA | 37 DATA |
| 37 }; | 38 }; |
| 38 | 39 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 65 protected: | 66 protected: |
| 66 virtual ~LoadObserver() {} | 67 virtual ~LoadObserver() {} |
| 67 }; | 68 }; |
| 68 | 69 |
| 69 // A Call instance can contain several send and/or receive streams. All streams | 70 // A Call instance can contain several send and/or receive streams. All streams |
| 70 // are assumed to have the same remote endpoint and will share bitrate estimates | 71 // are assumed to have the same remote endpoint and will share bitrate estimates |
| 71 // etc. | 72 // etc. |
| 72 class Call { | 73 class Call { |
| 73 public: | 74 public: |
| 74 struct Config { | 75 struct Config { |
| 76 explicit Config(RtcEventLog* event_log) : event_log(event_log) { |
| 77 RTC_DCHECK(event_log); |
| 78 } |
| 79 |
| 75 static const int kDefaultStartBitrateBps; | 80 static const int kDefaultStartBitrateBps; |
| 76 | 81 |
| 77 // Bitrate config used until valid bitrate estimates are calculated. Also | 82 // Bitrate config used until valid bitrate estimates are calculated. Also |
| 78 // used to cap total bitrate used. | 83 // used to cap total bitrate used. |
| 79 struct BitrateConfig { | 84 struct BitrateConfig { |
| 80 int min_bitrate_bps = 0; | 85 int min_bitrate_bps = 0; |
| 81 int start_bitrate_bps = kDefaultStartBitrateBps; | 86 int start_bitrate_bps = kDefaultStartBitrateBps; |
| 82 int max_bitrate_bps = -1; | 87 int max_bitrate_bps = -1; |
| 83 } bitrate_config; | 88 } bitrate_config; |
| 84 | 89 |
| 85 // AudioState which is possibly shared between multiple calls. | 90 // AudioState which is possibly shared between multiple calls. |
| 86 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. | 91 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. |
| 87 rtc::scoped_refptr<AudioState> audio_state; | 92 rtc::scoped_refptr<AudioState> audio_state; |
| 88 | 93 |
| 89 // Audio Processing Module to be used in this call. | 94 // Audio Processing Module to be used in this call. |
| 90 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. | 95 // TODO(solenberg): Change this to a shared_ptr once we can use C++11. |
| 91 AudioProcessing* audio_processing = nullptr; | 96 AudioProcessing* audio_processing = nullptr; |
| 97 |
| 98 // RtcEventLog to use for this call. Required. |
| 99 // Use webrtc::RtcEventLog::CreateNull() for a null implementation. |
| 100 RtcEventLog* event_log = nullptr; |
| 92 }; | 101 }; |
| 93 | 102 |
| 94 struct Stats { | 103 struct Stats { |
| 95 std::string ToString(int64_t time_ms) const; | 104 std::string ToString(int64_t time_ms) const; |
| 96 | 105 |
| 97 int send_bandwidth_bps = 0; // Estimated available send bandwidth. | 106 int send_bandwidth_bps = 0; // Estimated available send bandwidth. |
| 98 int max_padding_bitrate_bps = 0; // Cumulative configured max padding. | 107 int max_padding_bitrate_bps = 0; // Cumulative configured max padding. |
| 99 int recv_bandwidth_bps = 0; // Estimated available receive bandwidth. | 108 int recv_bandwidth_bps = 0; // Estimated available receive bandwidth. |
| 100 int64_t pacer_delay_ms = 0; | 109 int64_t pacer_delay_ms = 0; |
| 101 int64_t rtt_ms = -1; | 110 int64_t rtt_ms = -1; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // for each stream separately. Right now it's global per media type. | 153 // for each stream separately. Right now it's global per media type. |
| 145 virtual void SignalChannelNetworkState(MediaType media, | 154 virtual void SignalChannelNetworkState(MediaType media, |
| 146 NetworkState state) = 0; | 155 NetworkState state) = 0; |
| 147 | 156 |
| 148 virtual void OnNetworkRouteChanged( | 157 virtual void OnNetworkRouteChanged( |
| 149 const std::string& transport_name, | 158 const std::string& transport_name, |
| 150 const rtc::NetworkRoute& network_route) = 0; | 159 const rtc::NetworkRoute& network_route) = 0; |
| 151 | 160 |
| 152 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; | 161 virtual void OnSentPacket(const rtc::SentPacket& sent_packet) = 0; |
| 153 | 162 |
| 154 virtual bool StartEventLog(rtc::PlatformFile log_file, | |
| 155 int64_t max_size_bytes) = 0; | |
| 156 virtual void StopEventLog() = 0; | |
| 157 | |
| 158 virtual ~Call() {} | 163 virtual ~Call() {} |
| 159 }; | 164 }; |
| 160 | 165 |
| 161 } // namespace webrtc | 166 } // namespace webrtc |
| 162 | 167 |
| 163 #endif // WEBRTC_CALL_H_ | 168 #endif // WEBRTC_CALL_H_ |
| OLD | NEW |