| 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 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 if (error) { | 448 if (error) { |
| 449 error->set_type(type); | 449 error->set_type(type); |
| 450 } | 450 } |
| 451 return type == webrtc::RTCErrorType::NONE; | 451 return type == webrtc::RTCErrorType::NONE; |
| 452 } | 452 } |
| 453 | 453 |
| 454 } // namespace | 454 } // namespace |
| 455 | 455 |
| 456 namespace webrtc { | 456 namespace webrtc { |
| 457 | 457 |
| 458 static const char* const kRTCErrorTypeNames[] = { | |
| 459 "NONE", | |
| 460 "UNSUPPORTED_PARAMETER", | |
| 461 "INVALID_PARAMETER", | |
| 462 "INVALID_RANGE", | |
| 463 "SYNTAX_ERROR", | |
| 464 "INVALID_STATE", | |
| 465 "INVALID_MODIFICATION", | |
| 466 "NETWORK_ERROR", | |
| 467 "INTERNAL_ERROR", | |
| 468 }; | |
| 469 static_assert(static_cast<int>(RTCErrorType::INTERNAL_ERROR) == | |
| 470 (arraysize(kRTCErrorTypeNames) - 1), | |
| 471 "kRTCErrorTypeNames must have as many strings as RTCErrorType " | |
| 472 "has values."); | |
| 473 | |
| 474 std::ostream& operator<<(std::ostream& stream, RTCErrorType error) { | |
| 475 int index = static_cast<int>(error); | |
| 476 return stream << kRTCErrorTypeNames[index]; | |
| 477 } | |
| 478 | |
| 479 bool PeerConnectionInterface::RTCConfiguration::operator==( | 458 bool PeerConnectionInterface::RTCConfiguration::operator==( |
| 480 const PeerConnectionInterface::RTCConfiguration& o) const { | 459 const PeerConnectionInterface::RTCConfiguration& o) const { |
| 481 // This static_assert prevents us from accidentally breaking operator==. | 460 // This static_assert prevents us from accidentally breaking operator==. |
| 482 struct stuff_being_tested_for_equality { | 461 struct stuff_being_tested_for_equality { |
| 483 IceTransportsType type; | 462 IceTransportsType type; |
| 484 IceServers servers; | 463 IceServers servers; |
| 485 BundlePolicy bundle_policy; | 464 BundlePolicy bundle_policy; |
| 486 RtcpMuxPolicy rtcp_mux_policy; | 465 RtcpMuxPolicy rtcp_mux_policy; |
| 487 TcpCandidatePolicy tcp_candidate_policy; | 466 TcpCandidatePolicy tcp_candidate_policy; |
| 488 CandidateNetworkPolicy candidate_network_policy; | 467 CandidateNetworkPolicy candidate_network_policy; |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1621 RTC_NOTREACHED() << "Not implemented"; | 1600 RTC_NOTREACHED() << "Not implemented"; |
| 1622 break; | 1601 break; |
| 1623 } | 1602 } |
| 1624 } | 1603 } |
| 1625 | 1604 |
| 1626 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, | 1605 void PeerConnection::CreateAudioReceiver(MediaStreamInterface* stream, |
| 1627 const std::string& track_id, | 1606 const std::string& track_id, |
| 1628 uint32_t ssrc) { | 1607 uint32_t ssrc) { |
| 1629 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> | 1608 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
| 1630 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1609 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
| 1631 signaling_thread(), new AudioRtpReceiver(stream, track_id, ssrc, | 1610 signaling_thread(), |
| 1632 session_->voice_channel())); | 1611 new AudioRtpReceiver(track_id, ssrc, session_->voice_channel())); |
| 1633 | 1612 stream->AddTrack( |
| 1613 static_cast<AudioTrackInterface*>(receiver->internal()->track().get())); |
| 1634 receivers_.push_back(receiver); | 1614 receivers_.push_back(receiver); |
| 1635 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | 1615 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
| 1636 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | 1616 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
| 1637 observer_->OnAddTrack(receiver, streams); | 1617 observer_->OnAddTrack(receiver, streams); |
| 1638 } | 1618 } |
| 1639 | 1619 |
| 1640 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, | 1620 void PeerConnection::CreateVideoReceiver(MediaStreamInterface* stream, |
| 1641 const std::string& track_id, | 1621 const std::string& track_id, |
| 1642 uint32_t ssrc) { | 1622 uint32_t ssrc) { |
| 1643 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> | 1623 rtc::scoped_refptr<RtpReceiverProxyWithInternal<RtpReceiverInternal>> |
| 1644 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( | 1624 receiver = RtpReceiverProxyWithInternal<RtpReceiverInternal>::Create( |
| 1645 signaling_thread(), | 1625 signaling_thread(), |
| 1646 new VideoRtpReceiver(stream, track_id, factory_->worker_thread(), | 1626 new VideoRtpReceiver(track_id, factory_->worker_thread(), ssrc, |
| 1647 ssrc, session_->video_channel())); | 1627 session_->video_channel())); |
| 1628 stream->AddTrack( |
| 1629 static_cast<VideoTrackInterface*>(receiver->internal()->track().get())); |
| 1648 receivers_.push_back(receiver); | 1630 receivers_.push_back(receiver); |
| 1649 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; | 1631 std::vector<rtc::scoped_refptr<MediaStreamInterface>> streams; |
| 1650 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); | 1632 streams.push_back(rtc::scoped_refptr<MediaStreamInterface>(stream)); |
| 1651 observer_->OnAddTrack(receiver, streams); | 1633 observer_->OnAddTrack(receiver, streams); |
| 1652 } | 1634 } |
| 1653 | 1635 |
| 1654 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote | 1636 // TODO(deadbeef): Keep RtpReceivers around even if track goes away in remote |
| 1655 // description. | 1637 // description. |
| 1656 void PeerConnection::DestroyReceiver(const std::string& track_id) { | 1638 void PeerConnection::DestroyReceiver(const std::string& track_id) { |
| 1657 auto it = FindReceiverForTrack(track_id); | 1639 auto it = FindReceiverForTrack(track_id); |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2565 | 2547 |
| 2566 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2548 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
| 2567 int64_t max_size_bytes) { | 2549 int64_t max_size_bytes) { |
| 2568 return event_log_->StartLogging(file, max_size_bytes); | 2550 return event_log_->StartLogging(file, max_size_bytes); |
| 2569 } | 2551 } |
| 2570 | 2552 |
| 2571 void PeerConnection::StopRtcEventLog_w() { | 2553 void PeerConnection::StopRtcEventLog_w() { |
| 2572 event_log_->StopLogging(); | 2554 event_log_->StopLogging(); |
| 2573 } | 2555 } |
| 2574 } // namespace webrtc | 2556 } // namespace webrtc |
| OLD | NEW |