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

Unified Diff: content/renderer/media/webrtc_local_audio_track.cc

Issue 857093002: Set audio format before adding pepper sink to audio track. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix tests. Created 5 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
Index: content/renderer/media/webrtc_local_audio_track.cc
diff --git a/content/renderer/media/webrtc_local_audio_track.cc b/content/renderer/media/webrtc_local_audio_track.cc
index 13aee2d50cd9af4b08edd0ebe9248d791b7ec879..0b570562645225cfc5c86aafeb799cb8cdc086c2 100644
--- a/content/renderer/media/webrtc_local_audio_track.cc
+++ b/content/renderer/media/webrtc_local_audio_track.cc
@@ -40,6 +40,15 @@ WebRtcLocalAudioTrack::~WebRtcLocalAudioTrack() {
Stop();
}
+const media::AudioParameters& WebRtcLocalAudioTrack::GetOutputFormat() const {
+ if (webaudio_source_.get()) {
+ static const media::AudioParameters empty_params;
dmichael (off chromium) 2015/01/20 17:07:03 ditto... it's almost always better to just return
DaleCurtis 2015/01/20 18:46:56 +1, just return media::AudioParameters().
Anand Mistry (off Chromium) 2015/01/27 02:12:10 Done. I just figured returning const reference was
dmichael (off chromium) 2015/01/27 18:24:10 Copying a small-ish object that doesn't do any hea
+ return empty_params;
+ } else {
+ return capturer_->GetOutputFormat();
+ }
+}
+
void WebRtcLocalAudioTrack::Capture(const media::AudioBus& audio_bus,
base::TimeTicks estimated_capture_time,
bool force_report_nonzero_energy) {

Powered by Google App Engine
This is Rietveld 408576698