aboutsummaryrefslogtreecommitdiff
path: root/talk/app/webrtc/mediastreamhandler.cc
diff options
context:
space:
mode:
authorxians@webrtc.org <xians@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-13 15:09:40 +0000
committerxians@webrtc.org <xians@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d>2014-02-13 15:09:40 +0000
commite749c9ebdb2eb2a519c72c827e70107cbc56d270 (patch)
treeb0bf28e0293c6d1b3a189558db0664b41d59025f /talk/app/webrtc/mediastreamhandler.cc
parent8f690bc222aa484744eb6d97f4df241b4bd01c1b (diff)
downloadwebrtc-e749c9ebdb2eb2a519c72c827e70107cbc56d270.tar.gz
Update libjingle to 61514460
TBR=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/8649004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5545 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'talk/app/webrtc/mediastreamhandler.cc')
-rw-r--r--talk/app/webrtc/mediastreamhandler.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/talk/app/webrtc/mediastreamhandler.cc b/talk/app/webrtc/mediastreamhandler.cc
index a94eef322a..ca8e1053c9 100644
--- a/talk/app/webrtc/mediastreamhandler.cc
+++ b/talk/app/webrtc/mediastreamhandler.cc
@@ -106,6 +106,8 @@ void LocalAudioTrackHandler::Stop() {
void LocalAudioTrackHandler::OnEnabledChanged() {
cricket::AudioOptions options;
if (audio_track_->enabled() && audio_track_->GetSource()) {
+ // TODO(xians): Remove this static_cast since we should be able to connect
+ // a remote audio track to peer connection.
options = static_cast<LocalAudioSource*>(
audio_track_->GetSource())->options();
}
@@ -125,10 +127,12 @@ RemoteAudioTrackHandler::RemoteAudioTrackHandler(
: TrackHandler(track, ssrc),
audio_track_(track),
provider_(provider) {
+ track->GetSource()->RegisterAudioObserver(this);
OnEnabledChanged();
}
RemoteAudioTrackHandler::~RemoteAudioTrackHandler() {
+ audio_track_->GetSource()->UnregisterAudioObserver(this);
}
void RemoteAudioTrackHandler::Stop() {
@@ -143,6 +147,14 @@ void RemoteAudioTrackHandler::OnEnabledChanged() {
audio_track_->GetRenderer());
}
+void RemoteAudioTrackHandler::OnSetVolume(double volume) {
+ // When the track is disabled, the volume of the source, which is the
+ // corresponding WebRtc Voice Engine channel will be 0. So we do not allow
+ // setting the volume to the source when the track is disabled.
+ if (audio_track_->enabled())
+ provider_->SetAudioPlayoutVolume(ssrc(), volume);
+}
+
LocalVideoTrackHandler::LocalVideoTrackHandler(
VideoTrackInterface* track,
uint32 ssrc,