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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 if (playout) { | 1574 if (playout) { |
1575 LOG(LS_INFO) << "Starting playout for channel #" << channel(); | 1575 LOG(LS_INFO) << "Starting playout for channel #" << channel(); |
1576 stream_->Start(); | 1576 stream_->Start(); |
1577 } else { | 1577 } else { |
1578 LOG(LS_INFO) << "Stopping playout for channel #" << channel(); | 1578 LOG(LS_INFO) << "Stopping playout for channel #" << channel(); |
1579 stream_->Stop(); | 1579 stream_->Stop(); |
1580 } | 1580 } |
1581 playout_ = playout; | 1581 playout_ = playout; |
1582 } | 1582 } |
1583 | 1583 |
1584 std::vector<webrtc::RtpSource> GetSources() { | |
1585 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | |
1586 RTC_DCHECK(stream_); | |
1587 return stream_->GetSources(); | |
1588 } | |
1589 | |
1590 private: | 1584 private: |
1591 void RecreateAudioReceiveStream() { | 1585 void RecreateAudioReceiveStream() { |
1592 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1586 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1593 if (stream_) { | 1587 if (stream_) { |
1594 call_->DestroyAudioReceiveStream(stream_); | 1588 call_->DestroyAudioReceiveStream(stream_); |
1595 } | 1589 } |
1596 stream_ = call_->CreateAudioReceiveStream(config_); | 1590 stream_ = call_->CreateAudioReceiveStream(config_); |
1597 RTC_CHECK(stream_); | 1591 RTC_CHECK(stream_); |
1598 SetPlayout(playout_); | 1592 SetPlayout(playout_); |
1599 } | 1593 } |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2599 return; | 2593 return; |
2600 } | 2594 } |
2601 const auto it = recv_streams_.find(ssrc); | 2595 const auto it = recv_streams_.find(ssrc); |
2602 if (it == recv_streams_.end()) { | 2596 if (it == recv_streams_.end()) { |
2603 LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc; | 2597 LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc; |
2604 return; | 2598 return; |
2605 } | 2599 } |
2606 it->second->SetRawAudioSink(std::move(sink)); | 2600 it->second->SetRawAudioSink(std::move(sink)); |
2607 } | 2601 } |
2608 | 2602 |
2609 std::vector<webrtc::RtpSource> WebRtcVoiceMediaChannel::GetSources( | |
2610 uint32_t ssrc) const { | |
2611 auto it = recv_streams_.find(ssrc); | |
2612 RTC_DCHECK(it != recv_streams_.end()) | |
2613 << "Attempting to get contributing sources for SSRC:" << ssrc | |
2614 << " which doesn't exist."; | |
2615 return it->second->GetSources(); | |
2616 } | |
2617 | |
2618 int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const { | 2603 int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const { |
2619 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2604 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2620 const auto it = recv_streams_.find(ssrc); | 2605 const auto it = recv_streams_.find(ssrc); |
2621 if (it != recv_streams_.end()) { | 2606 if (it != recv_streams_.end()) { |
2622 return it->second->channel(); | 2607 return it->second->channel(); |
2623 } | 2608 } |
2624 return -1; | 2609 return -1; |
2625 } | 2610 } |
2626 | 2611 |
2627 int WebRtcVoiceMediaChannel::GetSendChannelId(uint32_t ssrc) const { | 2612 int WebRtcVoiceMediaChannel::GetSendChannelId(uint32_t ssrc) const { |
(...skipping 13 matching lines...) Expand all Loading... |
2641 ssrc); | 2626 ssrc); |
2642 if (it != unsignaled_recv_ssrcs_.end()) { | 2627 if (it != unsignaled_recv_ssrcs_.end()) { |
2643 unsignaled_recv_ssrcs_.erase(it); | 2628 unsignaled_recv_ssrcs_.erase(it); |
2644 return true; | 2629 return true; |
2645 } | 2630 } |
2646 return false; | 2631 return false; |
2647 } | 2632 } |
2648 } // namespace cricket | 2633 } // namespace cricket |
2649 | 2634 |
2650 #endif // HAVE_WEBRTC_VOICE | 2635 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |