| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 if (error) { | 451 if (error) { |
| 452 error->set_type(type); | 452 error->set_type(type); |
| 453 } | 453 } |
| 454 return type == webrtc::RTCErrorType::NONE; | 454 return type == webrtc::RTCErrorType::NONE; |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace | 457 } // namespace |
| 458 | 458 |
| 459 namespace webrtc { | 459 namespace webrtc { |
| 460 | 460 |
| 461 static const char* const kRTCErrorTypeNames[] = { | |
| 462 "NONE", | |
| 463 "UNSUPPORTED_PARAMETER", | |
| 464 "INVALID_PARAMETER", | |
| 465 "INVALID_RANGE", | |
| 466 "SYNTAX_ERROR", | |
| 467 "INVALID_STATE", | |
| 468 "INVALID_MODIFICATION", | |
| 469 "NETWORK_ERROR", | |
| 470 "INTERNAL_ERROR", | |
| 471 }; | |
| 472 static_assert(static_cast<int>(RTCErrorType::INTERNAL_ERROR) == | |
| 473 (arraysize(kRTCErrorTypeNames) - 1), | |
| 474 "kRTCErrorTypeNames must have as many strings as RTCErrorType " | |
| 475 "has values."); | |
| 476 | |
| 477 std::ostream& operator<<(std::ostream& stream, RTCErrorType error) { | |
| 478 int index = static_cast<int>(error); | |
| 479 return stream << kRTCErrorTypeNames[index]; | |
| 480 } | |
| 481 | |
| 482 bool PeerConnectionInterface::RTCConfiguration::operator==( | 461 bool PeerConnectionInterface::RTCConfiguration::operator==( |
| 483 const PeerConnectionInterface::RTCConfiguration& o) const { | 462 const PeerConnectionInterface::RTCConfiguration& o) const { |
| 484 // This static_assert prevents us from accidentally breaking operator==. | 463 // This static_assert prevents us from accidentally breaking operator==. |
| 485 struct stuff_being_tested_for_equality { | 464 struct stuff_being_tested_for_equality { |
| 486 IceTransportsType type; | 465 IceTransportsType type; |
| 487 IceServers servers; | 466 IceServers servers; |
| 488 BundlePolicy bundle_policy; | 467 BundlePolicy bundle_policy; |
| 489 RtcpMuxPolicy rtcp_mux_policy; | 468 RtcpMuxPolicy rtcp_mux_policy; |
| 490 TcpCandidatePolicy tcp_candidate_policy; | 469 TcpCandidatePolicy tcp_candidate_policy; |
| 491 CandidateNetworkPolicy candidate_network_policy; | 470 CandidateNetworkPolicy candidate_network_policy; |
| (...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1629 RTC_NOTREACHED() << "Not implemented"; | 1608 RTC_NOTREACHED() << "Not implemented"; |
| 1630 break; | 1609 break; |
| 1631 } | 1610 } |
| 1632 } | 1611 } |
| 1633 | 1612 |
| 1634 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, | 1613 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, |
| 1635 const std::string& track_id, | 1614 const std::string& track_id, |
| 1636 uint32_t ssrc) { | 1615 uint32_t ssrc) { |
| 1637 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> | 1616 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
| 1638 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1617 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
| 1639 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, | 1618 signaling_thread(), |
| 1640 session_->voice_channel())); | 1619 new AudioRtpReceiver(track_id, ssrc, session_->voice_channel())); |
| 1641 | 1620 stream->AddTrack( |
| 1621 static_cast<AudioTrackInterface*>(receiver->internal()->track().get())); |
| 1642 receivers_.push_back(receiver); | 1622 receivers_.push_back(receiver); |
| 1643 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | 1623 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
| 1644 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | 1624 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
| 1645 observer_->OnAddTrack(receiver, streams); | 1625 observer_->OnAddTrack(receiver, streams); |
| 1646 } | 1626 } |
| 1647 | 1627 |
| 1648 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, | 1628 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, |
| 1649 const std::string& track_id, | 1629 const std::string& track_id, |
| 1650 uint32_t ssrc) { | 1630 uint32_t ssrc) { |
| 1651 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> | 1631 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
| 1652 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1632 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
| 1653 signaling_thread(), | 1633 signaling_thread(), |
| 1654 new VideoRtpReceiver(stream, track_id, factory_->worker_thread(), | 1634 new VideoRtpReceiver(track_id, factory_->worker_thread(), ssrc, |
| 1655 ssrc, session_->video_channel())); | 1635 session_->video_channel())); |
| 1636 stream->AddTrack( |
| 1637 static_cast<VideoTrackInterface*>(receiver->internal()->track().get())); |
| 1656 receivers_.push_back(receiver); | 1638 receivers_.push_back(receiver); |
| 1657 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | 1639 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
| 1658 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | 1640 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
| 1659 observer_->OnAddTrack(receiver, streams); | 1641 observer_->OnAddTrack(receiver, streams); |
| 1660 } | 1642 } |
| 1661 | 1643 |
| 1662 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote | 1644 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote |
| 1663 // description. | 1645 // description. |
| 1664 void PeerConnection::DestroyReceiver(const std::string& track_id) { | 1646 void PeerConnection::DestroyReceiver(const std::string& track_id) { |
| 1665 auto it = FindReceiverForTrack(track_id); | 1647 auto it = FindReceiverForTrack(track_id); |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 } | 2561 } |
| 2580 return event_log_->StartLogging(file, max_size_bytes); | 2562 return event_log_->StartLogging(file, max_size_bytes); |
| 2581 } | 2563 } |
| 2582 | 2564 |
| 2583 void PeerConnection::StopRtcEventLog_w() { | 2565 void PeerConnection::StopRtcEventLog_w() { |
| 2584 if (event_log_) { | 2566 if (event_log_) { |
| 2585 event_log_->StopLogging(); | 2567 event_log_->StopLogging(); |
| 2586 } | 2568 } |
| 2587 } | 2569 } |
| 2588 } // namespace webrtc | 2570 } // namespace webrtc |
| OLD | NEW |