| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 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 |
| 11 #include "webrtc/pc/rtpreceiver.h" | 11 #include "webrtc/pc/rtpreceiver.h" |
| 12 | 12 |
| 13 #include "webrtc/api/mediastreamtrackproxy.h" | 13 #include "webrtc/api/mediastreamtrackproxy.h" |
| 14 #include "webrtc/api/videosourceproxy.h" | 14 #include "webrtc/api/videosourceproxy.h" |
| 15 #include "webrtc/base/ptr_util.h" |
| 15 #include "webrtc/base/trace_event.h" | 16 #include "webrtc/base/trace_event.h" |
| 17 #include "webrtc/modules/rtp_rtcp/include/rtp_receiver.h" |
| 16 #include "webrtc/pc/audiotrack.h" | 18 #include "webrtc/pc/audiotrack.h" |
| 17 #include "webrtc/pc/videotrack.h" | 19 #include "webrtc/pc/videotrack.h" |
| 18 | 20 |
| 19 namespace webrtc { | 21 namespace webrtc { |
| 20 | 22 |
| 21 AudioRtpReceiver::AudioRtpReceiver(const std::string& track_id, | 23 AudioRtpReceiver::AudioRtpReceiver(const std::string& track_id, |
| 22 uint32_t ssrc, | 24 uint32_t ssrc, |
| 23 cricket::VoiceChannel* channel) | 25 cricket::VoiceChannel* channel) |
| 24 : id_(track_id), | 26 : id_(track_id), |
| 25 ssrc_(ssrc), | 27 ssrc_(ssrc), |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return; | 92 return; |
| 91 } | 93 } |
| 92 if (channel_) { | 94 if (channel_) { |
| 93 // Allow that SetOutputVolume fail. This is the normal case when the | 95 // Allow that SetOutputVolume fail. This is the normal case when the |
| 94 // underlying media channel has already been deleted. | 96 // underlying media channel has already been deleted. |
| 95 channel_->SetOutputVolume(ssrc_, 0); | 97 channel_->SetOutputVolume(ssrc_, 0); |
| 96 } | 98 } |
| 97 stopped_ = true; | 99 stopped_ = true; |
| 98 } | 100 } |
| 99 | 101 |
| 102 std::vector<RtpContributingSource> AudioRtpReceiver::GetContributingSources() { |
| 103 return channel_->GetContributingSources(ssrc_); |
| 104 } |
| 105 |
| 100 void AudioRtpReceiver::Reconfigure() { | 106 void AudioRtpReceiver::Reconfigure() { |
| 101 RTC_DCHECK(!stopped_); | 107 RTC_DCHECK(!stopped_); |
| 102 if (!channel_) { | 108 if (!channel_) { |
| 103 LOG(LS_ERROR) << "AudioRtpReceiver::Reconfigure: No audio channel exists."; | 109 LOG(LS_ERROR) << "AudioRtpReceiver::Reconfigure: No audio channel exists."; |
| 104 return; | 110 return; |
| 105 } | 111 } |
| 106 if (!channel_->SetOutputVolume(ssrc_, | 112 if (!channel_->SetOutputVolume(ssrc_, |
| 107 track_->enabled() ? cached_volume_ : 0)) { | 113 track_->enabled() ? cached_volume_ : 0)) { |
| 108 RTC_NOTREACHED(); | 114 RTC_NOTREACHED(); |
| 109 } | 115 } |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 235 } |
| 230 | 236 |
| 231 void VideoRtpReceiver::OnFirstPacketReceived(cricket::BaseChannel* channel) { | 237 void VideoRtpReceiver::OnFirstPacketReceived(cricket::BaseChannel* channel) { |
| 232 if (observer_) { | 238 if (observer_) { |
| 233 observer_->OnFirstPacketReceived(media_type()); | 239 observer_->OnFirstPacketReceived(media_type()); |
| 234 } | 240 } |
| 235 received_first_packet_ = true; | 241 received_first_packet_ = true; |
| 236 } | 242 } |
| 237 | 243 |
| 238 } // namespace webrtc | 244 } // namespace webrtc |
| OLD | NEW |