Chromium Code Reviews| Index: talk/session/media/channel.cc |
| diff --git a/talk/session/media/channel.cc b/talk/session/media/channel.cc |
| index 588a03661cf1e84e8d3d75e8cd058abd273c3e73..91808524e176be6ec0b46bd40042643048cfad59 100644 |
| --- a/talk/session/media/channel.cc |
| +++ b/talk/session/media/channel.cc |
| @@ -30,6 +30,7 @@ |
| #include "talk/media/base/constants.h" |
| #include "talk/media/base/rtputils.h" |
| #include "talk/session/media/channelmanager.h" |
| +#include "webrtc/audio/audio_sink.h" |
| #include "webrtc/base/bind.h" |
| #include "webrtc/base/buffer.h" |
| #include "webrtc/base/byteorder.h" |
| @@ -40,9 +41,18 @@ |
| #include "webrtc/p2p/base/transportchannel.h" |
| namespace cricket { |
| - |
| using rtc::Bind; |
| +namespace { |
| +// See comment below for why we need to use a pointer to a scoped_ptr. |
| +bool SetRawAudioSink_w(VoiceMediaChannel* channel, |
|
perkj_webrtc
2015/12/13 19:26:48
nit: Since this file contain implementation for au
tommi
2015/12/13 19:46:34
As is it's not a member function, so I figured I w
|
| + uint32_t ssrc, |
| + rtc::scoped_ptr<webrtc::AudioSinkInterface>* sink) { |
| + channel->SetRawAudioSink(ssrc, std::move(*sink)); |
| + return true; |
| +} |
| +} // namespace |
| + |
| enum { |
| MSG_EARLYMEDIATIMEOUT = 1, |
| MSG_SCREENCASTWINDOWEVENT, |
| @@ -1376,6 +1386,15 @@ bool VoiceChannel::SetOutputVolume(uint32_t ssrc, double volume) { |
| media_channel(), ssrc, volume)); |
| } |
| +void VoiceChannel::SetRawAudioSink( |
| + uint32_t ssrc, |
| + rtc::scoped_ptr<webrtc::AudioSinkInterface> sink) { |
| + // We need to work around Bind's lack of support for scoped_ptr and ownership |
| + // passing. So we invoke to our own little routine that gets a pointer to |
| + // our local variable. This is OK since we're synchronously invoking. |
| + InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink)); |
| +} |
| + |
| bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { |
| return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats, |
| media_channel(), stats)); |