| 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 } | 942 } |
| 943 | 943 |
| 944 rtc::scoped_refptr<DtmfSenderInterface> PeerConnection::CreateDtmfSender( | 944 rtc::scoped_refptr<DtmfSenderInterface> PeerConnection::CreateDtmfSender( |
| 945 AudioTrackInterface* track) { | 945 AudioTrackInterface* track) { |
| 946 TRACE_EVENT0("webrtc", "PeerConnection::CreateDtmfSender"); | 946 TRACE_EVENT0("webrtc", "PeerConnection::CreateDtmfSender"); |
| 947 if (IsClosed()) { | 947 if (IsClosed()) { |
| 948 return nullptr; | 948 return nullptr; |
| 949 } | 949 } |
| 950 if (!track) { | 950 if (!track) { |
| 951 LOG(LS_ERROR) << "CreateDtmfSender - track is NULL."; | 951 LOG(LS_ERROR) << "CreateDtmfSender - track is NULL."; |
| 952 return NULL; | 952 return nullptr; |
| 953 } | 953 } |
| 954 if (!local_streams_->FindAudioTrack(track->id())) { | 954 auto it = FindSenderForTrack(track); |
| 955 LOG(LS_ERROR) << "CreateDtmfSender is called with a non local audio track."; | 955 if (it == senders_.end()) { |
| 956 return NULL; | 956 LOG(LS_ERROR) << "CreateDtmfSender called with a non-added track."; |
| 957 return nullptr; |
| 957 } | 958 } |
| 958 | 959 |
| 959 rtc::scoped_refptr<DtmfSenderInterface> sender( | 960 return (*it)->GetDtmfSender(); |
| 960 DtmfSender::Create(track, signaling_thread(), session_.get())); | |
| 961 if (!sender.get()) { | |
| 962 LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create."; | |
| 963 return NULL; | |
| 964 } | |
| 965 return DtmfSenderProxy::Create(signaling_thread(), sender.get()); | |
| 966 } | 961 } |
| 967 | 962 |
| 968 rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender( | 963 rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender( |
| 969 const std::string& kind, | 964 const std::string& kind, |
| 970 const std::string& stream_id) { | 965 const std::string& stream_id) { |
| 971 TRACE_EVENT0("webrtc", "PeerConnection::CreateSender"); | 966 TRACE_EVENT0("webrtc", "PeerConnection::CreateSender"); |
| 972 if (IsClosed()) { | 967 if (IsClosed()) { |
| 973 return nullptr; | 968 return nullptr; |
| 974 } | 969 } |
| 975 rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender; | 970 rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> new_sender; |
| (...skipping 1589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2565 | 2560 |
| 2566 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2561 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
| 2567 int64_t max_size_bytes) { | 2562 int64_t max_size_bytes) { |
| 2568 return event_log_->StartLogging(file, max_size_bytes); | 2563 return event_log_->StartLogging(file, max_size_bytes); |
| 2569 } | 2564 } |
| 2570 | 2565 |
| 2571 void PeerConnection::StopRtcEventLog_w() { | 2566 void PeerConnection::StopRtcEventLog_w() { |
| 2572 event_log_->StopLogging(); | 2567 event_log_->StopLogging(); |
| 2573 } | 2568 } |
| 2574 } // namespace webrtc | 2569 } // namespace webrtc |
| OLD | NEW |