Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: talk/app/webrtc/remoteaudiosource.cc

Issue 1522903002: Add a 'remote' property to MediaSourceInterface. Also adding an implementation to the relevant sour… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « talk/app/webrtc/remoteaudiosource.h ('k') | talk/app/webrtc/remoteaudiotrack.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 provider->SetRawAudioSink( 99 provider->SetRawAudioSink(
100 ssrc, rtc::scoped_ptr<AudioSinkInterface>(new Sink(this))); 100 ssrc, rtc::scoped_ptr<AudioSinkInterface>(new Sink(this)));
101 } 101 }
102 } 102 }
103 103
104 MediaSourceInterface::SourceState RemoteAudioSource::state() const { 104 MediaSourceInterface::SourceState RemoteAudioSource::state() const {
105 RTC_DCHECK(main_thread_->IsCurrent()); 105 RTC_DCHECK(main_thread_->IsCurrent());
106 return state_; 106 return state_;
107 } 107 }
108 108
109 bool RemoteAudioSource::remote() const {
110 RTC_DCHECK(main_thread_->IsCurrent());
111 return true;
112 }
113
109 void RemoteAudioSource::SetVolume(double volume) { 114 void RemoteAudioSource::SetVolume(double volume) {
110 RTC_DCHECK(volume >= 0 && volume <= 10); 115 RTC_DCHECK(volume >= 0 && volume <= 10);
111 for (auto* observer : audio_observers_) 116 for (auto* observer : audio_observers_)
112 observer->OnSetVolume(volume); 117 observer->OnSetVolume(volume);
113 } 118 }
114 119
115 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) { 120 void RemoteAudioSource::RegisterAudioObserver(AudioObserver* observer) {
116 RTC_DCHECK(observer != NULL); 121 RTC_DCHECK(observer != NULL);
117 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(), 122 RTC_DCHECK(std::find(audio_observers_.begin(), audio_observers_.end(),
118 observer) == audio_observers_.end()); 123 observer) == audio_observers_.end());
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 } 167 }
163 168
164 void RemoteAudioSource::OnMessage(rtc::Message* msg) { 169 void RemoteAudioSource::OnMessage(rtc::Message* msg) {
165 RTC_DCHECK(main_thread_->IsCurrent()); 170 RTC_DCHECK(main_thread_->IsCurrent());
166 sinks_.clear(); 171 sinks_.clear();
167 state_ = MediaSourceInterface::kEnded; 172 state_ = MediaSourceInterface::kEnded;
168 FireOnChanged(); 173 FireOnChanged();
169 } 174 }
170 175
171 } // namespace webrtc 176 } // namespace webrtc
OLDNEW
« no previous file with comments | « talk/app/webrtc/remoteaudiosource.h ('k') | talk/app/webrtc/remoteaudiotrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698