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 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 void AudioRtpReceiver::OnChanged() { | 48 void AudioRtpReceiver::OnChanged() { |
49 if (cached_track_enabled_ != track_->enabled()) { | 49 if (cached_track_enabled_ != track_->enabled()) { |
50 cached_track_enabled_ = track_->enabled(); | 50 cached_track_enabled_ = track_->enabled(); |
51 Reconfigure(); | 51 Reconfigure(); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 void AudioRtpReceiver::OnSetVolume(double volume) { | 55 void AudioRtpReceiver::OnSetVolume(double volume) { |
56 RTC_DCHECK(volume >= 0 && volume <= 10); | 56 RTC_DCHECK_GE(volume, 0); |
| 57 RTC_DCHECK_LE(volume, 10); |
57 cached_volume_ = volume; | 58 cached_volume_ = volume; |
58 if (!channel_) { | 59 if (!channel_) { |
59 LOG(LS_ERROR) << "AudioRtpReceiver::OnSetVolume: No audio channel exists."; | 60 LOG(LS_ERROR) << "AudioRtpReceiver::OnSetVolume: No audio channel exists."; |
60 return; | 61 return; |
61 } | 62 } |
62 // When the track is disabled, the volume of the source, which is the | 63 // When the track is disabled, the volume of the source, which is the |
63 // corresponding WebRtc Voice Engine channel will be 0. So we do not allow | 64 // corresponding WebRtc Voice Engine channel will be 0. So we do not allow |
64 // setting the volume to the source when the track is disabled. | 65 // setting the volume to the source when the track is disabled. |
65 if (!stopped_ && track_->enabled()) { | 66 if (!stopped_ && track_->enabled()) { |
66 if (!channel_->SetOutputVolume(ssrc_, cached_volume_)) { | 67 if (!channel_->SetOutputVolume(ssrc_, cached_volume_)) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 235 } |
235 | 236 |
236 void VideoRtpReceiver::OnFirstPacketReceived(cricket::BaseChannel* channel) { | 237 void VideoRtpReceiver::OnFirstPacketReceived(cricket::BaseChannel* channel) { |
237 if (observer_) { | 238 if (observer_) { |
238 observer_->OnFirstPacketReceived(media_type()); | 239 observer_->OnFirstPacketReceived(media_type()); |
239 } | 240 } |
240 received_first_packet_ = true; | 241 received_first_packet_ = true; |
241 } | 242 } |
242 | 243 |
243 } // namespace webrtc | 244 } // namespace webrtc |
OLD | NEW |