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 |
1584 private: | 1590 private: |
1585 void RecreateAudioReceiveStream() { | 1591 void RecreateAudioReceiveStream() { |
1586 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 1592 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
1587 if (stream_) { | 1593 if (stream_) { |
1588 call_->DestroyAudioReceiveStream(stream_); | 1594 call_->DestroyAudioReceiveStream(stream_); |
1589 } | 1595 } |
1590 stream_ = call_->CreateAudioReceiveStream(config_); | 1596 stream_ = call_->CreateAudioReceiveStream(config_); |
1591 RTC_CHECK(stream_); | 1597 RTC_CHECK(stream_); |
1592 SetPlayout(playout_); | 1598 SetPlayout(playout_); |
1593 } | 1599 } |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2593 return; | 2599 return; |
2594 } | 2600 } |
2595 const auto it = recv_streams_.find(ssrc); | 2601 const auto it = recv_streams_.find(ssrc); |
2596 if (it == recv_streams_.end()) { | 2602 if (it == recv_streams_.end()) { |
2597 LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc; | 2603 LOG(LS_WARNING) << "SetRawAudioSink: no recv stream " << ssrc; |
2598 return; | 2604 return; |
2599 } | 2605 } |
2600 it->second->SetRawAudioSink(std::move(sink)); | 2606 it->second->SetRawAudioSink(std::move(sink)); |
2601 } | 2607 } |
2602 | 2608 |
| 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 |
2603 int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const { | 2618 int WebRtcVoiceMediaChannel::GetReceiveChannelId(uint32_t ssrc) const { |
2604 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 2619 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
2605 const auto it = recv_streams_.find(ssrc); | 2620 const auto it = recv_streams_.find(ssrc); |
2606 if (it != recv_streams_.end()) { | 2621 if (it != recv_streams_.end()) { |
2607 return it->second->channel(); | 2622 return it->second->channel(); |
2608 } | 2623 } |
2609 return -1; | 2624 return -1; |
2610 } | 2625 } |
2611 | 2626 |
2612 int WebRtcVoiceMediaChannel::GetSendChannelId(uint32_t ssrc) const { | 2627 int WebRtcVoiceMediaChannel::GetSendChannelId(uint32_t ssrc) const { |
(...skipping 13 matching lines...) Expand all Loading... |
2626 ssrc); | 2641 ssrc); |
2627 if (it != unsignaled_recv_ssrcs_.end()) { | 2642 if (it != unsignaled_recv_ssrcs_.end()) { |
2628 unsignaled_recv_ssrcs_.erase(it); | 2643 unsignaled_recv_ssrcs_.erase(it); |
2629 return true; | 2644 return true; |
2630 } | 2645 } |
2631 return false; | 2646 return false; |
2632 } | 2647 } |
2633 } // namespace cricket | 2648 } // namespace cricket |
2634 | 2649 |
2635 #endif // HAVE_WEBRTC_VOICE | 2650 #endif // HAVE_WEBRTC_VOICE |
OLD | NEW |