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

Unified Diff: talk/media/base/fakemediaengine.h

Issue 1397773002: Change SetOutputScaling to set a single level, not left/right levels. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase+rename Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/media/base/mediachannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/base/fakemediaengine.h
diff --git a/talk/media/base/fakemediaengine.h b/talk/media/base/fakemediaengine.h
index 7325667aa544568cf29199af4736e5f6c6ffb519..4296ec1e85c78d696bcb2555afb66cfeecf09c26 100644
--- a/talk/media/base/fakemediaengine.h
+++ b/talk/media/base/fakemediaengine.h
@@ -243,7 +243,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
const AudioOptions& options)
: engine_(engine),
time_since_last_typing_(-1) {
- output_scalings_[0] = OutputScaling(); // For default channel.
+ output_scalings_[0] = 1.0; // For default channel.
SetOptions(options);
}
~FakeVoiceMediaChannel();
@@ -291,7 +291,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
virtual bool AddRecvStream(const StreamParams& sp) {
if (!RtpHelper<VoiceMediaChannel>::AddRecvStream(sp))
return false;
- output_scalings_[sp.first_ssrc()] = OutputScaling();
+ output_scalings_[sp.first_ssrc()] = 1.0;
return true;
}
virtual bool RemoveRecvStream(uint32_t ssrc) {
@@ -347,37 +347,29 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
return true;
}
- virtual bool SetOutputScaling(uint32_t ssrc, double left, double right) {
+ virtual bool SetOutputVolume(uint32_t ssrc, double volume) {
if (0 == ssrc) {
- std::map<uint32_t, OutputScaling>::iterator it;
+ std::map<uint32_t, double>::iterator it;
for (it = output_scalings_.begin(); it != output_scalings_.end(); ++it) {
- it->second.left = left;
- it->second.right = right;
+ it->second = volume;
}
return true;
} else if (output_scalings_.find(ssrc) != output_scalings_.end()) {
- output_scalings_[ssrc].left = left;
- output_scalings_[ssrc].right = right;
+ output_scalings_[ssrc] = volume;
return true;
}
return false;
}
- bool GetOutputScaling(uint32_t ssrc, double* left, double* right) {
+ bool GetOutputVolume(uint32_t ssrc, double* volume) {
if (output_scalings_.find(ssrc) == output_scalings_.end())
return false;
- *left = output_scalings_[ssrc].left;
- *right = output_scalings_[ssrc].right;
+ *volume = output_scalings_[ssrc];
return true;
}
virtual bool GetStats(VoiceMediaInfo* info) { return false; }
private:
- struct OutputScaling {
- OutputScaling() : left(1.0), right(1.0) {}
- double left, right;
- };
-
class VoiceChannelAudioSink : public AudioRenderer::Sink {
public:
explicit VoiceChannelAudioSink(AudioRenderer* renderer)
@@ -446,7 +438,7 @@ class FakeVoiceMediaChannel : public RtpHelper<VoiceMediaChannel> {
FakeVoiceEngine* engine_;
std::vector<AudioCodec> recv_codecs_;
std::vector<AudioCodec> send_codecs_;
- std::map<uint32_t, OutputScaling> output_scalings_;
+ std::map<uint32_t, double> output_scalings_;
std::vector<DtmfInfo> dtmf_info_queue_;
int time_since_last_typing_;
AudioOptions options_;
« no previous file with comments | « talk/app/webrtc/webrtcsession_unittest.cc ('k') | talk/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698