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

Unified Diff: talk/session/media/channel.cc

Issue 1588693002: Revert of Storing raw audio sink for default audio track. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 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/session/media/channel.h ('k') | webrtc/audio/audio_receive_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/session/media/channel.cc
diff --git a/talk/session/media/channel.cc b/talk/session/media/channel.cc
index fa1165af87c796a49691f3cb308f0ce35ed67af5..a59c3f82b771848b79f88fa949e781d77c5f5a07 100644
--- a/talk/session/media/channel.cc
+++ b/talk/session/media/channel.cc
@@ -44,6 +44,16 @@
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,
+ uint32_t ssrc,
+ rtc::scoped_ptr<webrtc::AudioSinkInterface>* sink) {
+ channel->SetRawAudioSink(ssrc, std::move(*sink));
+ return true;
+}
+} // namespace
enum {
MSG_EARLYMEDIATIMEOUT = 1,
@@ -1389,9 +1399,11 @@
void VoiceChannel::SetRawAudioSink(
uint32_t ssrc,
- const rtc::scoped_refptr<webrtc::AudioSinkInterface>& sink) {
- worker_thread()->Invoke<void>(
- Bind(&VoiceMediaChannel::SetRawAudioSink, media_channel(), ssrc, sink));
+ 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) {
« no previous file with comments | « talk/session/media/channel.h ('k') | webrtc/audio/audio_receive_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698