| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
| 9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
| (...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 rtc::scoped_refptr<DtmfSenderInterface> sender( | 806 rtc::scoped_refptr<DtmfSenderInterface> sender( |
| 807 DtmfSender::Create(track, signaling_thread(), session_.get())); | 807 DtmfSender::Create(track, signaling_thread(), session_.get())); |
| 808 if (!sender.get()) { | 808 if (!sender.get()) { |
| 809 LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create."; | 809 LOG(LS_ERROR) << "CreateDtmfSender failed on DtmfSender::Create."; |
| 810 return NULL; | 810 return NULL; |
| 811 } | 811 } |
| 812 return DtmfSenderProxy::Create(signaling_thread(), sender.get()); | 812 return DtmfSenderProxy::Create(signaling_thread(), sender.get()); |
| 813 } | 813 } |
| 814 | 814 |
| 815 rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender( | 815 rtc::scoped_refptr<RtpSenderInterface> PeerConnection::CreateSender( |
| 816 const std::string& kind) { | 816 const std::string& kind, |
| 817 const std::string& stream_id) { |
| 817 TRACE_EVENT0("webrtc", "PeerConnection::CreateSender"); | 818 TRACE_EVENT0("webrtc", "PeerConnection::CreateSender"); |
| 818 RtpSenderInterface* new_sender; | 819 RtpSenderInterface* new_sender; |
| 819 if (kind == MediaStreamTrackInterface::kAudioKind) { | 820 if (kind == MediaStreamTrackInterface::kAudioKind) { |
| 820 new_sender = new AudioRtpSender(session_.get(), stats_.get()); | 821 new_sender = new AudioRtpSender(session_.get(), stats_.get()); |
| 821 } else if (kind == MediaStreamTrackInterface::kVideoKind) { | 822 } else if (kind == MediaStreamTrackInterface::kVideoKind) { |
| 822 new_sender = new VideoRtpSender(session_.get()); | 823 new_sender = new VideoRtpSender(session_.get()); |
| 823 } else { | 824 } else { |
| 824 LOG(LS_ERROR) << "CreateSender called with invalid kind: " << kind; | 825 LOG(LS_ERROR) << "CreateSender called with invalid kind: " << kind; |
| 825 return rtc::scoped_refptr<RtpSenderInterface>(); | 826 return rtc::scoped_refptr<RtpSenderInterface>(); |
| 826 } | 827 } |
| 828 if (!stream_id.empty()) { |
| 829 new_sender->set_stream_id(stream_id); |
| 830 } |
| 827 senders_.push_back(new_sender); | 831 senders_.push_back(new_sender); |
| 828 return RtpSenderProxy::Create(signaling_thread(), new_sender); | 832 return RtpSenderProxy::Create(signaling_thread(), new_sender); |
| 829 } | 833 } |
| 830 | 834 |
| 831 std::vector<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::GetSenders() | 835 std::vector<rtc::scoped_refptr<RtpSenderInterface>> PeerConnection::GetSenders() |
| 832 const { | 836 const { |
| 833 std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders; | 837 std::vector<rtc::scoped_refptr<RtpSenderInterface>> senders; |
| 834 for (const auto& sender : senders_) { | 838 for (const auto& sender : senders_) { |
| 835 senders.push_back(RtpSenderProxy::Create(signaling_thread(), sender.get())); | 839 senders.push_back(RtpSenderProxy::Create(signaling_thread(), sender.get())); |
| 836 } | 840 } |
| (...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2072 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { | 2076 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { |
| 2073 for (const auto& channel : sctp_data_channels_) { | 2077 for (const auto& channel : sctp_data_channels_) { |
| 2074 if (channel->id() == sid) { | 2078 if (channel->id() == sid) { |
| 2075 return channel; | 2079 return channel; |
| 2076 } | 2080 } |
| 2077 } | 2081 } |
| 2078 return nullptr; | 2082 return nullptr; |
| 2079 } | 2083 } |
| 2080 | 2084 |
| 2081 } // namespace webrtc | 2085 } // namespace webrtc |
| OLD | NEW |