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

Unified Diff: content/renderer/media/webrtc_audio_device_impl.h

Issue 1780653002: Revert of MediaStream audio object graph untangling and clean-ups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
Index: content/renderer/media/webrtc_audio_device_impl.h
diff --git a/content/renderer/media/webrtc_audio_device_impl.h b/content/renderer/media/webrtc_audio_device_impl.h
index de92afe4dda4d47ef36421178eecf030521cd41d..a3bbf6b8ee7f362b696f0911bc66509d78317cc7 100644
--- a/content/renderer/media/webrtc_audio_device_impl.h
+++ b/content/renderer/media/webrtc_audio_device_impl.h
@@ -7,7 +7,6 @@
#include <stdint.h>
-#include <list>
#include <string>
#include <vector>
@@ -307,12 +306,15 @@
// Called on the main renderer thread.
bool SetAudioRenderer(WebRtcAudioRenderer* renderer);
- // Adds/Removes the |capturer| to the ADM. Does NOT take ownership.
- // Capturers must remain valid until RemoveAudioCapturer() is called.
+ // Adds/Removes the capturer to the ADM.
// TODO(xians): Remove these two methods once the ADM does not need to pass
// hardware information up to WebRtc.
- void AddAudioCapturer(WebRtcAudioCapturer* capturer);
- void RemoveAudioCapturer(WebRtcAudioCapturer* capturer);
+ void AddAudioCapturer(const scoped_refptr<WebRtcAudioCapturer>& capturer);
+ void RemoveAudioCapturer(const scoped_refptr<WebRtcAudioCapturer>& capturer);
+
+ // Gets the default capturer, which is the last capturer in |capturers_|.
+ // The method can be called by both Libjingle thread and main render thread.
+ scoped_refptr<WebRtcAudioCapturer> GetDefaultCapturer() const;
// Gets paired device information of the capture device for the audio
// renderer. This is used to pass on a session id, sample rate and buffer
@@ -329,7 +331,7 @@
}
private:
- typedef std::list<WebRtcAudioCapturer*> CapturerList;
+ typedef std::list<scoped_refptr<WebRtcAudioCapturer> > CapturerList;
typedef std::list<WebRtcPlayoutDataSource::Sink*> PlayoutDataSinkList;
class RenderBuffer;
@@ -362,9 +364,7 @@
mutable int ref_count_;
// List of captures which provides access to the native audio input layer
- // in the browser process. The last capturer in this list is considered the
- // "default capturer" by the methods implementing the
- // webrtc::AudioDeviceModule interface.
+ // in the browser process.
CapturerList capturers_;
// Provides access to the audio renderer in the browser process.
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer_unittest.cc ('k') | content/renderer/media/webrtc_audio_device_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698