| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 | 10 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 const std::string rtcp_cname() { | 203 const std::string rtcp_cname() { |
| 204 if (send_streams_.empty()) | 204 if (send_streams_.empty()) |
| 205 return ""; | 205 return ""; |
| 206 return send_streams_[0].cname; | 206 return send_streams_[0].cname; |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool ready_to_send() const { | 209 bool ready_to_send() const { |
| 210 return ready_to_send_; | 210 return ready_to_send_; |
| 211 } | 211 } |
| 212 | 212 |
| 213 int transport_overhead_per_packet() const { |
| 214 return transport_overhead_per_packet_; |
| 215 } |
| 216 |
| 213 rtc::NetworkRoute last_network_route() const { return last_network_route_; } | 217 rtc::NetworkRoute last_network_route() const { return last_network_route_; } |
| 214 int num_network_route_changes() const { return num_network_route_changes_; } | 218 int num_network_route_changes() const { return num_network_route_changes_; } |
| 215 void set_num_network_route_changes(int changes) { | 219 void set_num_network_route_changes(int changes) { |
| 216 num_network_route_changes_ = changes; | 220 num_network_route_changes_ = changes; |
| 217 } | 221 } |
| 218 | 222 |
| 219 protected: | 223 protected: |
| 220 bool MuteStream(uint32_t ssrc, bool mute) { | 224 bool MuteStream(uint32_t ssrc, bool mute) { |
| 221 if (!HasSendStream(ssrc) && ssrc != 0) { | 225 if (!HasSendStream(ssrc) && ssrc != 0) { |
| 222 return false; | 226 return false; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 245 const rtc::PacketTime& packet_time) { | 249 const rtc::PacketTime& packet_time) { |
| 246 rtp_packets_.push_back(std::string(packet->data<char>(), packet->size())); | 250 rtp_packets_.push_back(std::string(packet->data<char>(), packet->size())); |
| 247 } | 251 } |
| 248 virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet, | 252 virtual void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet, |
| 249 const rtc::PacketTime& packet_time) { | 253 const rtc::PacketTime& packet_time) { |
| 250 rtcp_packets_.push_back(std::string(packet->data<char>(), packet->size())); | 254 rtcp_packets_.push_back(std::string(packet->data<char>(), packet->size())); |
| 251 } | 255 } |
| 252 virtual void OnReadyToSend(bool ready) { | 256 virtual void OnReadyToSend(bool ready) { |
| 253 ready_to_send_ = ready; | 257 ready_to_send_ = ready; |
| 254 } | 258 } |
| 259 virtual void OnTransportOverheadChanged(int transport_overhead_per_packet) { |
| 260 transport_overhead_per_packet_ = transport_overhead_per_packet; |
| 261 } |
| 262 |
| 255 virtual void OnNetworkRouteChanged(const std::string& transport_name, | 263 virtual void OnNetworkRouteChanged(const std::string& transport_name, |
| 256 const rtc::NetworkRoute& network_route) { | 264 const rtc::NetworkRoute& network_route) { |
| 257 last_network_route_ = network_route; | 265 last_network_route_ = network_route; |
| 258 ++num_network_route_changes_; | 266 ++num_network_route_changes_; |
| 259 } | 267 } |
| 260 bool fail_set_send_codecs() const { return fail_set_send_codecs_; } | 268 bool fail_set_send_codecs() const { return fail_set_send_codecs_; } |
| 261 bool fail_set_recv_codecs() const { return fail_set_recv_codecs_; } | 269 bool fail_set_recv_codecs() const { return fail_set_recv_codecs_; } |
| 262 | 270 |
| 263 private: | 271 private: |
| 264 bool sending_; | 272 bool sending_; |
| 265 bool playout_; | 273 bool playout_; |
| 266 std::vector<RtpExtension> recv_extensions_; | 274 std::vector<RtpExtension> recv_extensions_; |
| 267 std::vector<RtpExtension> send_extensions_; | 275 std::vector<RtpExtension> send_extensions_; |
| 268 std::list<std::string> rtp_packets_; | 276 std::list<std::string> rtp_packets_; |
| 269 std::list<std::string> rtcp_packets_; | 277 std::list<std::string> rtcp_packets_; |
| 270 std::vector<StreamParams> send_streams_; | 278 std::vector<StreamParams> send_streams_; |
| 271 std::vector<StreamParams> receive_streams_; | 279 std::vector<StreamParams> receive_streams_; |
| 272 std::set<uint32_t> muted_streams_; | 280 std::set<uint32_t> muted_streams_; |
| 273 std::map<uint32_t, webrtc::RtpParameters> rtp_send_parameters_; | 281 std::map<uint32_t, webrtc::RtpParameters> rtp_send_parameters_; |
| 274 std::map<uint32_t, webrtc::RtpParameters> rtp_receive_parameters_; | 282 std::map<uint32_t, webrtc::RtpParameters> rtp_receive_parameters_; |
| 275 bool fail_set_send_codecs_; | 283 bool fail_set_send_codecs_; |
| 276 bool fail_set_recv_codecs_; | 284 bool fail_set_recv_codecs_; |
| 277 uint32_t send_ssrc_; | 285 uint32_t send_ssrc_; |
| 278 std::string rtcp_cname_; | 286 std::string rtcp_cname_; |
| 279 bool ready_to_send_; | 287 bool ready_to_send_; |
| 288 int transport_overhead_per_packet_; |
| 280 rtc::NetworkRoute last_network_route_; | 289 rtc::NetworkRoute last_network_route_; |
| 281 int num_network_route_changes_ = 0; | 290 int num_network_route_changes_ = 0; |
| 282 }; | 291 }; |
| 283 | 292 |
| 284 class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> { | 293 class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> { |
| 285 public: | 294 public: |
| 286 struct DtmfInfo { | 295 struct DtmfInfo { |
| 287 DtmfInfo(uint32_t ssrc, int event_code, int duration) | 296 DtmfInfo(uint32_t ssrc, int event_code, int duration) |
| 288 : ssrc(ssrc), | 297 : ssrc(ssrc), |
| 289 event_code(event_code), | 298 event_code(event_code), |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 | 968 |
| 960 private: | 969 private: |
| 961 std::vector<FakeDataMediaChannel*> channels_; | 970 std::vector<FakeDataMediaChannel*> channels_; |
| 962 std::vector<DataCodec> data_codecs_; | 971 std::vector<DataCodec> data_codecs_; |
| 963 DataChannelType last_channel_type_; | 972 DataChannelType last_channel_type_; |
| 964 }; | 973 }; |
| 965 | 974 |
| 966 } // namespace cricket | 975 } // namespace cricket |
| 967 | 976 |
| 968 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ | 977 #endif // WEBRTC_MEDIA_BASE_FAKEMEDIAENGINE_H_ |
| OLD | NEW |